Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move back to BM25 similarity #36431

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Top hits response snippet with a nested hit, which resides in the first slot of
"value": 1,
"relation": "eq"
},
"max_score": 0.3616575,
"max_score": 0.16438977,
"hits": [
{
"_index": "sales",
Expand All @@ -342,7 +342,7 @@ Top hits response snippet with a nested hit, which resides in the first slot of
"field": "comments", <1>
"offset": 0 <2>
},
"_score": 0.3616575,
"_score": 0.16438977,
"_source": {
"comment": "This car could have better brakes", <3>
"username": "baddriver007"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ The output from the above is:
"value": 1,
"relation": "eq"
},
"max_score": 0.2876821,
"max_score": 0.13076457,
"hits": [
{
"_index": "my_index",
"_type": "_doc",
"_id": "1",
"_score": 0.2876821,
"_score": 0.13076457,
"_source": {
"text": "The fooBarBaz method"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,13 +304,13 @@ GET my_index/_search
"value": 1,
"relation": "eq"
},
"max_score": 0.5753642,
"max_score": 0.26152915,
"hits": [
{
"_index": "my_index",
"_type": "_doc",
"_id": "1",
"_score": 0.5753642,
"_score": 0.26152915,
"_source": {
"title": "Quick Foxes"
}
Expand Down
14 changes: 7 additions & 7 deletions docs/reference/how-to/recipes/stemming.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ GET index/_search
"value": 2,
"relation": "eq"
},
"max_score": 0.18232156,
"max_score": 0.082873434,
"hits": [
{
"_index": "index",
"_type": "_doc",
"_id": "1",
"_score": 0.18232156,
"_score": 0.082873434,
"_source": {
"body": "Ski resort"
}
Expand All @@ -103,7 +103,7 @@ GET index/_search
"_index": "index",
"_type": "_doc",
"_id": "2",
"_score": 0.18232156,
"_score": 0.082873434,
"_source": {
"body": "A pair of skis"
}
Expand Down Expand Up @@ -149,13 +149,13 @@ GET index/_search
"value": 1,
"relation": "eq"
},
"max_score": 0.8025915,
"max_score": 0.3648143,
"hits": [
{
"_index": "index",
"_type": "_doc",
"_id": "1",
"_score": 0.8025915,
"_score": 0.3648143,
"_source": {
"body": "Ski resort"
}
Expand Down Expand Up @@ -209,13 +209,13 @@ GET index/_search
"value": 1,
"relation": "eq"
},
"max_score": 0.8025915,
"max_score": 0.3648143,
"hits": [
{
"_index": "index",
"_type": "_doc",
"_id": "1",
"_score": 0.8025915,
"_score": 0.3648143,
"_source": {
"body": "Ski resort"
}
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/mapping/params/normalizer.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ both index and query time.
"value": 2,
"relation": "eq"
},
"max_score": 0.47000363,
"max_score": 0.21363801,
"hits": [
{
"_index": "index",
"_type": "_doc",
"_id": "1",
"_score": 0.47000363,
"_score": 0.21363801,
"_source": {
"foo": "BÀR"
}
Expand All @@ -108,7 +108,7 @@ both index and query time.
"_index": "index",
"_type": "_doc",
"_id": "2",
"_score": 0.47000363,
"_score": 0.21363801,
"_source": {
"foo": "bar"
}
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/query-dsl/terms-set-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ Response:
"value": 1,
"relation": "eq"
},
"max_score": 0.87546873,
"max_score": 0.39794034,
"hits": [
{
"_index": "my-index",
"_type": "_doc",
"_id": "2",
"_score": 0.87546873,
"_score": 0.39794034,
"_source": {
"codes": ["def", "ghi"],
"required_matches": 2
Expand Down
9 changes: 2 additions & 7 deletions docs/reference/search/explain.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,13 @@ This will yield the following result:
"_id":"0",
"matched":true,
"explanation":{
"value":1.6943597,
"value":0.7701635,
"description":"weight(message:elasticsearch in 0) [PerFieldSimilarity], result of:",
"details":[
{
"value":1.6943597,
"value":0.7701635,
"description":"score(freq=1.0), product of:",
"details":[
{
"value":2.2,
"description":"boost",
"details":[]
},
{
"value":1.3862944,
"description":"idf, computed as log(1 + (N - n + 0.5) / (n + 0.5)) from:",
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/search/request-body.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ And here is a sample response:
"value": 1,
"relation": "eq"
},
"max_score": 1.3862944,
"max_score": 0.6301338,
"hits" : [
{
"_index" : "twitter",
"_type" : "_doc",
"_id" : "0",
"_score": 1.3862944,
"_score": 0.6301338,
"_source" : {
"user" : "kimchy",
"message": "trying out Elasticsearch",
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/search/request/highlighting.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,13 @@ Response:
"value": 1,
"relation": "eq"
},
"max_score": 1.601195,
"max_score": 0.72781587,
"hits": [
{
"_index": "twitter",
"_type": "_doc",
"_id": "1",
"_score": 1.601195,
"_score": 0.72781587,
"_source": {
"user": "test",
"message": "some message with the number 1",
Expand Down Expand Up @@ -923,13 +923,13 @@ Response:
"value": 1,
"relation": "eq"
},
"max_score": 1.601195,
"max_score": 0.72781587,
"hits": [
{
"_index": "twitter",
"_type": "_doc",
"_id": "1",
"_score": 1.601195,
"_score": 0.72781587,
"_source": {
"user": "test",
"message": "some message with the number 1",
Expand Down
16 changes: 8 additions & 8 deletions docs/reference/search/request/inner-hits.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,13 @@ Response not included in text but tested for completeness sake.
"value": 1,
"relation": "eq"
},
"max_score": 1.0444684,
"max_score": 0.47475836,
"hits": [
{
"_index": "test",
"_type": "_doc",
"_id": "1",
"_score": 1.0444684,
"_score": 0.47475836,
"_source": ...,
"inner_hits": {
"comments": { <1>
Expand All @@ -289,7 +289,7 @@ Response not included in text but tested for completeness sake.
"value": 1,
"relation": "eq"
},
"max_score": 1.0444684,
"max_score": 0.47475836,
"hits": [
{
"_index": "test",
Expand All @@ -299,7 +299,7 @@ Response not included in text but tested for completeness sake.
"field": "comments",
"offset": 1
},
"_score": 1.0444684,
"_score": 0.47475836,
"fields": {
"comments.text.keyword": [
"words words words"
Expand Down Expand Up @@ -395,13 +395,13 @@ Which would look like:
"value": 1,
"relation": "eq"
},
"max_score": 0.6931472,
"max_score": 0.3150669,
"hits": [
{
"_index": "test",
"_type": "_doc",
"_id": "1",
"_score": 0.6931472,
"_score": 0.3150669,
"_source": ...,
"inner_hits": {
"comments.votes": { <1>
Expand All @@ -410,7 +410,7 @@ Which would look like:
"value": 1,
"relation": "eq"
},
"max_score": 0.6931472,
"max_score": 0.3150669,
"hits": [
{
"_index": "test",
Expand All @@ -424,7 +424,7 @@ Which would look like:
"offset": 0
}
},
"_score": 0.6931472,
"_score": 0.3150669,
"_source": {
"value": 1,
"voter": "kimchy"
Expand Down
4 changes: 2 additions & 2 deletions docs/reference/search/uri-request.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ And here is a sample response:
"value": 1,
"relation": "eq"
},
"max_score": 1.3862944,
"max_score": 0.6301338,
"hits" : [
{
"_index" : "twitter",
"_type" : "_doc",
"_id" : "0",
"_score": 1.3862944,
"_score": 0.6301338,
"_source" : {
"user" : "kimchy",
"date" : "2009-11-15T14:12:12",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
package org.elasticsearch.upgrades;

import org.apache.http.util.EntityUtils;
import org.elasticsearch.Version;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;
import org.elasticsearch.common.Booleans;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.action.document.RestBulkAction;
import org.elasticsearch.Version;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.Response;

import java.io.IOException;
import java.nio.charset.StandardCharsets;
Expand Down Expand Up @@ -145,7 +145,7 @@ public void testIndexing() throws IOException {
}
}

private void bulk(String index, String valueSuffix, int count) throws IOException {
private static void bulk(String index, String valueSuffix, int count) throws IOException {
StringBuilder b = new StringBuilder();
for (int i = 0; i < count; i++) {
b.append("{\"index\": {\"_index\": \"").append(index).append("\", \"_type\": \"_doc\"}}\n");
Expand Down
Loading