Hello, Yash.
The syntax you come up with makes sense. It's important to don't prepend it
with space; probably bracket may be redundant; you can also resolve syntax
ambiguity with local params.
fq={!cache=false v="filter(planName:all_features) OR zipCode:1234"}
debugQuery=true shows how it's parsed.
Another esoteric options:
https://solr.apache.org/guide/solr/latest/query-guide/block-join-query-parser.html#all-parents-syntax
fq={!cache=false v=$refq}&refq=zipCode:1234 {!parent
which=planName:all_features}On Thu, May 25, 2023 at 8:04 PM Wei <[email protected]> wrote: > Send on behalf of my colleague as his email seems not showing up in the > list. > > Hi Team, > > > I was reading about special filter syntax in Solr documentation - > > > https://solr.apache.org/guide/8_3/the-standard-query-parser.html#differences-between-lucenes-classic-query-parser-and-solrs-standard-query-parser > > > Support for a special filter(…) syntax to indicate that some query > clauses should be cached in the filter cache (as a constant score > boolean query). This allows sub-queries to be cached and re-used in > other queries. For example inStock:true will be cached and re-used in > all three of the queries below: > > q=features:songs OR filter(inStock:true) > > > My question is how do I disable cache for part of OR filter query and > enable for part of OR filter query? > > > For e.g. - Current FQ - > > fq: planName:all_features OR zipCode:1234 (in this case entire FQ is > cached) > > > I don't want to cache the entire FQ given it's very unique , but I > want to cache the first part (plan_name:all_features) to improve > performance . How do I achieve this? > > > My understanding is the following should work? Is this correct? > > fq: {!cache=false}(filter(planName:all_features) OR zipCode:1234) > > > Will the above syntax result in planName:all_features to be cached in > Filter Cache? Otherwise how can I achieve this? > > > I am on Solr 8.4 > > > Thanks, > > Yash > -- Sincerely yours Mikhail Khludnev https://t.me/MUST_SEARCH A caveat: Cyrillic!
