Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Fix PostingsFormat in KNN Codec (#236) #248

Conversation

vamshin
Copy link
Member

@vamshin vamshin commented Oct 14, 2020

  • postings list fix

Issue #, if available:
#227

Description of changes:
#236

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Oct 14, 2020

Codecov Report

Merging #248 into opendistro-1.10 will decrease coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                  Coverage Diff                  @@
##             opendistro-1.10     #248      +/-   ##
=====================================================
- Coverage              77.87%   77.76%   -0.11%     
- Complexity               308      311       +3     
=====================================================
  Files                     50       50              
  Lines                   1184     1192       +8     
  Branches                 100      100              
=====================================================
+ Hits                     922      927       +5     
- Misses                   218      221       +3     
  Partials                  44       44              
Impacted Files Coverage Δ Complexity Δ
...csearch/knn/index/codec/KNN86Codec/KNN86Codec.java 92.00% <100.00%> (+2.00%) 14.00 <4.00> (+2.00)
...roforelasticsearch/knn/plugin/KNNCodecService.java 75.00% <100.00%> (+8.33%) 3.00 <1.00> (+1.00)
...oforelasticsearch/knn/plugin/KNNEngineFactory.java 100.00% <100.00%> (ø) 3.00 <2.00> (ø)
...istroforelasticsearch/knn/index/KNNIndexCache.java 92.30% <0.00%> (-2.89%) 35.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ed9c7dc...680d821. Read the comment docs.

@vamshin
Copy link
Member Author

vamshin commented Oct 14, 2020

Manually verified suggest Field to check PostingsFormat fix

curl -X PUT "localhost:9200/music?pretty" -H 'Content-Type: application/json' -d'

{
"settings": {
"index": {
"knn": true
}
},
"mappings": {
"properties": {
"suggest": {
"type": "completion"
}
}
}
}
'

curl -X POST "localhost:9200/music/_doc/1?refresh=true" -H 'Content-Type: application/json' -d'
{
"suggest" : {
"input": [ "Nevermind", "Nirvana" ],
"weight" : 34
}
}
'

curl -X POST "localhost:9200/music/_search?pretty" -H 'Content-Type: application/json' -d'
{
"suggest": {
"song-suggest": {
"prefix": "nir",
"completion": {
"field": "suggest"
}
}
}
}
'

Output:-

{
"took" : 92,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 0,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
},
"suggest" : {
"song-suggest" : [
{
"text" : "nir",
"offset" : 0,
"length" : 3,
"options" : [
{
"text" : "Nirvana",
"_index" : "music",
"_type" : "_doc",
"_id" : "1",
"_score" : 34.0,
"_source" : {
"suggest" : {
"input" : [
"Nevermind",
"Nirvana"
],
"weight" : 34
}
}
}
]
}
]
}
}

@vamshin vamshin requested a review from jmazanec15 October 14, 2020 22:33
@vamshin vamshin merged commit a496778 into opendistro-for-elasticsearch:opendistro-1.10 Oct 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants