Skip to content

Instantly share code, notes, and snippets.

@jappievw

jappievw/query Secret

Created August 24, 2011 16:40
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 jappievw/cb4db4d846b27b94501e to your computer and use it in GitHub Desktop.
Save jappievw/cb4db4d846b27b94501e to your computer and use it in GitHub Desktop.
Caching AND filter in Elasticsearch
{
"filter": {
"_cache": true,
"and": [
{
"terms": {
"shop.id": [
100,
101,
104,
106,
108,
113,
115,
120,
122,
127,
131,
275,
277,
279,
281,
284,
285,
286,
287,
288,
290,
295,
298,
320,
322,
323,
329,
330,
333,
335,
339,
343,
344,
345,
351
]
}
},
{
"term": {
"state": true
}
}
]
},
"query": {
"match_all": {}
},
"size": 1
}
{
"status" : 500,
"error" : "SearchPhaseExecutionException[Failed to execute phase [query_fetch], total failure; shardFailures {[RF4D4TZIRPCadEsvSzNB2Q][products_prod][0]: SearchParseException[[products_prod][0]: from[-1],size[-1]: Parse Failure [Failed to parse source [{\n \"filter\": {\n\t\t\"_cache\": true,\n\t\t\"and\": [\n\t\t\t{\n\t\t\t\t\"terms\": {\n\t\t\t\t\t\"shop.id\": [\n\t\t\t\t\t\t100, \n\t\t\t\t\t\t101, \n\t\t\t\t\t\t104, \n\t\t\t\t\t\t106, \n\t\t\t\t\t\t108, \n\t\t\t\t\t\t113, \n\t\t\t\t\t\t115, \n\t\t\t\t\t\t120, \n\t\t\t\t\t\t122, \n\t\t\t\t\t\t127, \n\t\t\t\t\t\t131, \n\t\t\t\t\t\t275, \n\t\t\t\t\t\t277, \n\t\t\t\t\t\t279, \n\t\t\t\t\t\t281, \n\t\t\t\t\t\t284, \n\t\t\t\t\t\t285, \n\t\t\t\t\t\t286, \n\t\t\t\t\t\t287, \n\t\t\t\t\t\t288, \n\t\t\t\t\t\t290, \n\t\t\t\t\t\t295, \n\t\t\t\t\t\t298, \n\t\t\t\t\t\t320, \n\t\t\t\t\t\t322, \n\t\t\t\t\t\t323, \n\t\t\t\t\t\t329, \n\t\t\t\t\t\t330, \n\t\t\t\t\t\t333, \n\t\t\t\t\t\t335, \n\t\t\t\t\t\t339, \n\t\t\t\t\t\t343, \n\t\t\t\t\t\t344, \n\t\t\t\t\t\t345, \n\t\t\t\t\t\t351\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t}, \n\t\t\t{\n\t\t\t\t\"term\": {\n\t\t\t\t\t\"state\": true\n\t\t\t\t}\n\t\t\t}\n\t\t]\n }, \n \"query\": {\n \"match_all\": {}\n }, \n \"size\": 1\n}\n]]]; nested: QueryParsingException[[products_prod] No filter registered for [_cache]]; }]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment