I am attempting to create a cached filter that will be used to filter
out search results according to some "whitelist" and "blacklist" URLs.
The filter I created can be viewed at the following gist:
My question is do I need to explicitly cache each filter? Or can I
just set { "_cache": true } on the outermost and filter?
The first file in the gist shows the explicit caching, and the second
file in the gist shows the implicit caching (only caching the and
filter). I only care about the collection of all the filters taken
together. I will not be using these same filters individually in other
queries.
You can only cache the outmost "and", assuming the same filter will be used
in other requests. Internal filters can be cached, and then, if they are
used on their own in other type of filters, the cached form will be used
(term filters, for example, are automatically cached).
One thing that I would try and see, if possibly use a single bool filter
instead of the combination of and / or / not over the relevant term /
prefix filters. With many elements, it might make more sense.
I am attempting to create a cached filter that will be used to filter
out search results according to some "whitelist" and "blacklist" URLs.
The filter I created can be viewed at the following gist:
My question is do I need to explicitly cache each filter? Or can I
just set { "_cache": true } on the outermost and filter?
The first file in the gist shows the explicit caching, and the second
file in the gist shows the implicit caching (only caching the and
filter). I only care about the collection of all the filters taken
together. I will not be using these same filters individually in other
queries.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.