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

PostingsFormat Fix for odfe 1.9 #249

Merged

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.

@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 9295b31 into opendistro-for-elasticsearch:opendistro-1.9 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