Skip to content

Instantly share code, notes, and snippets.

Created June 15, 2011 12:06
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 anonymous/1026952 to your computer and use it in GitHub Desktop.
Save anonymous/1026952 to your computer and use it in GitHub Desktop.
"dfs_query_then_fetch" search type returns Error
1. curl -XPUT 'http://localhost:9200/dbtest123'
2. curl -XPUT 'http://localhost:9200/dbtest123/datatable/_mapping' -d '{"datatable" : { "properties" : { "message" : {"type" : "string","store" : "yes"} ,"userid": { "type":"long" , "store":"yes" } } }'
3. curl -XPUT 'http://localhost:9200/dbtest123/datatable/1' -d '{"message" :"test", "userid":1}'
4. curl -XPUT 'http://localhost:9200/dbtest123/datatable/2' -d '{"message" : "test", "userid":2}'
5. curl -XPUT 'http://localhost:9200/dbtest123/datatable/3' -d '{"message" :"test", "userid":3 }'
6. curl -XPUT 'http://localhost:9200/dbtest123/datachild/_mapping' -d '{"child" : { "_parent" : {"type" : "datatable" } }}'
7. curl -XPUT 'http://localhost:9200/dbtest123/datachild/1?parent=1' -d '{ "tag" : "test"}'
8. curl -XPUT 'http://localhost:9200/dbtest123/datachild/2?parent=2' -d '{ "tag" : "test"}'
9. curl -XGET 'http://localhost:9200/dbtest123/datatable/_search?search_type=dfs_query_then_fetch' -d '{"query" :{ "bool" :{ "must_not" : [{ "has_child" : {"type" : "datachild", "query" :{ "bool" : { "should" : [{ "query_string" : { "default_field" :"tag","query" : "tag:*","default_operator" :"OR","allow_leading_wildcard" :true,"lowercase_expanded_terms": true,"enable_position_increments" :true,"fuzzy_prefix_length" : 0,"fuzzy_min_sim" : 0.5,"phrase_slop" :0,"boost" : 1.0 } }] } }} }] } }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment