Skip to content

Instantly share code, notes, and snippets.

@robyoung
Created July 11, 2012 18: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 robyoung/3092079 to your computer and use it in GitHub Desktop.
Save robyoung/3092079 to your computer and use it in GitHub Desktop.
Elasticsearch Query
curl -XGET 'http://localhost:9200/rummager/_search' -H 'Content-type: application/json' -d '{
"from": 0, "size": 50,
"query": {
"bool": {
"must": {
"query_string": {
"fields": ["title", "description", "indexable_content"],
"query": "bank holidays",
"minimum_should_match": "75%"
}
},
"should": {
"query_string": {
"default_field": "format",
"query": "transaction OR recommended-link",
"boost": 3.0
}
}
}
},
"highlight": {
"pre_tags": ["HIGHLIGHT_START"],
"post_tags": ["HIGHLIGHT_END"],
"fields": {
"description":{ },
"indexable_content":{ }
}
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment