Skip to content

Instantly share code, notes, and snippets.

@eire1130
Forked from santiago/query.json
Last active January 2, 2016 20:19
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 eire1130/44d18734503267c835b9 to your computer and use it in GitHub Desktop.
Save eire1130/44d18734503267c835b9 to your computer and use it in GitHub Desktop.
{
"filter": {
"term": {
"skills": "Engineering"
}
},
"query": {
"filtered": {
"query": {
"multi_match": {
"fields": [
"courses.name",
"courses.description",
"courses.categories.categories.index",
"profile.skills.skills.index",
"profile.firstName",
"profile.lastName"
],
"type": "phrase_prefix",
"query": "engineer"
}
}
}
},
"size": 50,
"facets": {
"location": {
"terms": {
"field": "location",
"size": 10
}
},
"skills": {
"terms": {
"field": "skills",
"size": 10
}
},
"categories": {
"terms": {
"field": "categories",
"size": 10
}
},
"startDate": {
"range": {
"startDate": [
{
"label": "Last week",
"from": 1388275200000,
"to": 1388879999000,
"count": 0
},
{
"label": "This week",
"from": 1388880000000,
"to": 1389484799000,
"count": 0
},
{
"label": "Next week",
"from": 1389484800000,
"to": 1390089599000,
"count": 0
},
{
"label": "Within 2 weeks",
"from": 1390089600000,
"to": 1390694399000,
"count": 0
},
{
"label": "Within 3 weeks",
"from": 1390694400000,
"to": 1391299199000,
"count": 0
}
],
"size": 50
}
}
}
}
{
"user": {
"properties": {
"courses": {
"properties": {
"_id": {
"type": "string"
},
"active": {
"type": "boolean"
},
"categories": {
"type": "multi_field",
"fields": {
"categories": {
"type": "string",
"index": "not_analyzed"
},
"categories.index": {
"type": "string",
"index": "analyzed"
}
}
},
"description": {
"type": "string"
},
"name": {
"type": "string"
},
"sessions": {
"properties": {
"_id": {
"type": "string"
},
"active": {
"type": "boolean"
},
"startDate": {
"type": "date",
"format": "dateOptionalTime"
}
}
}
}
},
"model": {
"type": "string"
},
"photoUrl": {
"type": "string"
},
"profile": {
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"location": {
"type": "multi_field",
"fields": {
"location": {
"type": "string",
"index": "not_analyzed"
},
"location.index": {
"type": "string",
"index": "analyzed"
}
}
},
"skills": {
"type": "multi_field",
"fields": {
"skills": {
"type": "string",
"index": "not_analyzed"
},
"skills.index": {
"type": "string",
"index": "analyzed"
}
}
}
}
},
"username": {
"type": "string"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment