Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

/sample_query Secret

Created July 11, 2014 08:49
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/20fc650ca2ada3928b0b to your computer and use it in GitHub Desktop.
Save anonymous/20fc650ca2ada3928b0b to your computer and use it in GitHub Desktop.
[
{
"index": "vacancies",
"body": [
{
"type": "default-type"
},
{
"query": {
"filtered": {
"query": {
"query_string": {
"fields": [
"header^10000",
"company.name^500",
"search^50"
],
"default_operator": "AND",
"query": "php"
}
},
"filter": {
"bool": {
"must": [
{
"term": {
"state": 1
}
},
{
"term": {
"company.validate_state": 1
}
},
{
"terms": {
"geo_id": [
"826"
]
}
},
{
"terms": {
"visibility_type": [
1,
2
]
}
}
]
}
}
}
},
"size": 25,
"from": 0,
"highlight": {
"pre_tags": [
""
],
"post_tags": [
""
],
"fields": {
"header": {
"foo": "bar"
},
"company.name": {
"foo": "bar"
}
}
},
"aggregations": {
"category_id": {
"terms": {
"field": "category_id",
"size": 20000
}
},
"salary_min_rub": {
"filter": {
"range": {
"salary_min_rub": {
"gte": "5000",
"lte": "200000"
}
}
},
"aggregations": {
"average_salary": {
"avg": {
"field": "salary_min_rub"
}
}
}
},
"salary_max_rub": {
"filter": {
"range": {
"salary_max_rub": {
"gte": "5000",
"lte": "200000"
}
}
},
"aggregations": {
"average_salary": {
"avg": {
"field": "salary_max_rub"
}
}
}
}
},
"sort": [
{
"min_service_weight": "asc"
},
{
"sort_date": "desc"
},
{
"_score": "desc"
}
]
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment