Skip to content

Instantly share code, notes, and snippets.

@loren
Created October 29, 2014 15:09
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 loren/7741c52bd8e74d7ef626 to your computer and use it in GitHub Desktop.
Save loren/7741c52bd8e74d7ef626 to your computer and use it in GitHub Desktop.
Recognize proximity of words
{
"bool": {
"should": [
{
"match": {
"tags": {
"query": "jefferson memorial",
"analyzer": "tag_analyzer"
}
}
},
{
"simple_query_string": {
"fields": [
"title",
"description",
"caption"
],
"query": "jefferson memorial",
"analyzer": "en_analyzer",
"default_operator": "AND"
}
},
{
"match_phrase": {
"title": "jefferson memorial"
}
},
{
"match_phrase": {
"description": "jefferson memorial"
}
},
{
"match_phrase": {
"caption": "jefferson memorial"
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment