Last active
December 19, 2015 14:38
-
-
Save ronpastore/5970509 to your computer and use it in GitHub Desktop.
not able to get a match on percolate with constant score. ElasticSearch Version: 0.19.10, JVM: 20.6-b01-415
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#updated: fix below | |
curl -X PUT "http://localhost:9200/segments__1369334274" | |
curl -X PUT "http://localhost:9200/_percolator/segments__1369334274/test_percolator_query" -d '{ | |
"constant_score" : { | |
"filter" : { | |
"term" : { | |
"topics" : ["aging"] | |
} | |
}, | |
"query" : { | |
"query_string" : { | |
"query" : "*" | |
} | |
}, | |
"boost" : 1.2 | |
} | |
}' | |
curl -XPOST localhost:9200/_percolator/_refresh | |
#Percolate Doc that Should Match | |
curl -X GET "http://localhost:9200/segments__1369334274/segment/_percolate?pretty=1" -d '{ | |
"doc":{ | |
"id":"51dc70e0e54206213b000003", | |
"type":"segment", | |
"title":"hmmm", | |
"description":"hmmm", | |
"topics":["aging"] | |
} | |
}' | |
#####THE FIX: Wrap the constant_score in a query object########### | |
curl -X PUT "http://localhost:9200/_percolator/segments__1369334274/test_percolator_query" -d '{ | |
"query" : { | |
"constant_score" : { | |
"filter" : { | |
"term" : { | |
"topics" : ["aging"] | |
} | |
}, | |
"query" : { | |
"query_string" : { | |
"query" : "*" | |
} | |
}, | |
"boost" : 1.2 | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment