Skip to content

Instantly share code, notes, and snippets.

@dadoonet
Last active December 14, 2015 04:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dadoonet/5031671 to your computer and use it in GitHub Desktop.
Save dadoonet/5031671 to your computer and use it in GitHub Desktop.
NPE when doing fuzzy (tested on empty and filed index)
curl -XDELETE http://localhost:9200/npefuzzy
curl -XPUT http://localhost:9200/npefuzzy?pretty -d '{
"settings" : { "index" : { "number_of_shards" : 1, "number_of_replicas" : 0 }}
}'
curl -XPUT http://localhost:9200/npefuzzy/beer/1?pretty -d '{
"brand":"Grimbergen",
"colour":"PALE",
"size":1.3476184461445255,
"price":7.318647685097387,
"date":1320090719440
}'
curl -XPOST "localhost:9200/npefuzzy/_refresh?pretty"
# This one is OK
curl -XPOST http://localhost:9200/npefuzzy/beer/_search?pretty -d '
{"query":{
"flt" : {
"fields" : [ "brand", "colour" ],
"like_text" : "heineken is a pale beer",
"max_query_terms" : 12
}
}}'
# This one was ok (no error) in 0.20 (Lucene 3) but fails with 0.21 (Lucene 4)
curl -XPOST http://localhost:9200/npefuzzy/beer/_search?pretty -d '
{"query":{
"flt" : {
"fields" : [ "brand", "nonexistingfield" ],
"like_text" : "heineken is a pale beer",
"max_query_terms" : 12
}
}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment