Created
August 19, 2012 06:08
-
-
Save dylanahsmith/3392534 to your computer and use it in GitHub Desktop.
elasticsearch ignores boost on prefix search
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
#!/bin/sh | |
curl -XDELETE 'http://localhost:9200/foo' | |
curl -XPUT 'http://localhost:9200/foo/?pretty=true' -d ' | |
{ | |
"mappings" : { | |
"bar" : { | |
"properties" : { | |
"title" : { | |
"boost" : 2, | |
"type" : "string" | |
}, | |
"body" : { | |
"type" : "string" | |
} | |
} | |
} | |
} | |
} | |
' | |
curl -XPOST 'http://localhost:9200/foo/bar?pretty=true' -d '{ | |
"title" : "Configure", | |
"body" : "Stuff about how to setup something" | |
}' | |
curl -XPOST 'http://localhost:9200/foo/bar?pretty=true' -d '{ | |
"title" : "Setup", | |
"body" : "Stuff about how to configure something" | |
}' | |
curl -XPOST 'http://localhost:9200/_refresh' | |
curl -XGET 'http://localhost:9200/foo/bar/_search?pretty=true' -d '{ | |
"query" : { | |
"field" : { | |
"_all" : "configure" | |
} | |
} | |
}' | |
curl -XGET 'http://localhost:9200/foo/bar/_search?pretty=true' -d '{ | |
"query" : { | |
"field" : { | |
"_all": { | |
"query": "configure*", | |
"rewrite": "top_terms_10" | |
} | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment