Skip to content

Instantly share code, notes, and snippets.

@TwP
Created November 7, 2011 21:58
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 TwP/1346329 to your computer and use it in GitHub Desktop.
Save TwP/1346329 to your computer and use it in GitHub Desktop.
Examples of ES Filter Cache
{
"filter": {
"and": { "_cache": true, "filters": [
{ "or": { "_cache": true, "filters": [
{"prefix": { "_id": "http://www.example.com" }}
]}},
{ "not": { "_cache": true, "filter": { "or": { "_cache": true, "filters": [
{"term": { "_id": "http://www.example.com" }},
{"term": { "_id": "http://www.example.com/sitemap" }},
{"term": { "_id": "http://www.example.com/contact" }},
{"term": { "_id": "http://www.example.com/get-featured" }},
{"term": { "_id": "http://www.example.com/search" }},
{"prefix": { "_id": "http://www.example.com/user/" }},
{"prefix": { "_id": "http://www.example.com/community/" }}
]}}}}
]}
}
}
{
"filter": {
"and": { "_cache": true, "filters": [
{ "or": [
{"prefix": { "_id": "http://www.example.com" }}
]},
{ "not": { "filter": { "or": [
{"term": { "_id": "http://www.example.com" }},
{"term": { "_id": "http://www.example.com/sitemap" }},
{"term": { "_id": "http://www.example.com/contact" }},
{"term": { "_id": "http://www.example.com/get-featured" }},
{"term": { "_id": "http://www.example.com/search" }},
{"prefix": { "_id": "http://www.example.com/user/" }},
{"prefix": { "_id": "http://www.example.com/community/" }}
]}}}
]}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment