Skip to content

Instantly share code, notes, and snippets.

@frazerh
Created January 27, 2012 14:00
Show Gist options
  • Save frazerh/1688915 to your computer and use it in GitHub Desktop.
Save frazerh/1688915 to your computer and use it in GitHub Desktop.
Example engram query
'http://localhost:9200/test,test2/_search?timeout=10s&size=10' -d '
{
"sort":
[
"_score"
],
"query":
{
"filtered":
{
"filter":
{
"bool":
{
"must":
[
{
"term":
{
"site_id":22
}
},
{
"term":
{
"published":1
}
},
{
"term":
{
"show_in_portal":1
}
},
{
"term":
{
"topic_show_in_portal":1
}
},
{
"term":
{
"topic_allow_questions":1
}
}
]
}
},
"query":
{
"query_string":
{
"fields":
[
"subject.auto^2.1",
"body_text.auto^2.5",
"keywords.auto^2.9",
"question.auto^2.5",
"answer.auto^2.5"
],
"query":"sample",
"use_dis_max":true
}
}
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment