[
https://issues.apache.org/jira/browse/SOLR-6494?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14262963#comment-14262963
]
Shawn Heisey commented on SOLR-6494:
------------------------------------
bq. what if Solr detecting that the filter does use date rages like [* TO
2014-09-08T23:59:59Z] (or probably any ranges where cache is not very efficient)
I don't understand why a date range would not be very efficient on the cache.
If the values in the range are static, it is just like any other filter query.
The only time a date range affects cache usage is if that date range uses an
unaltered "NOW" keyword. NOW changes with every millisecond that passes, so
multiple queries using that keyword will be different, which makes the cache
useless. If NOW is rounded (NOW/HOUR, NOW/DAY, etc), then the value will not
change from query to query, and the cache will be useful.
There is a capability called postfilter, which lets you declare a filter's cost
as high enough that it will be executed AFTER everything else, but I don't
think the standard query parser supports that functionality. I would love to
be proven wrong about that assumption.
http://heliosearch.org/advanced-filter-caching-in-solr/
> Query filters applied in a wrong order
> --------------------------------------
>
> Key: SOLR-6494
> URL: https://issues.apache.org/jira/browse/SOLR-6494
> Project: Solr
> Issue Type: Bug
> Affects Versions: 4.8.1
> Reporter: Alexander S.
>
> This query:
> {code}
> {
> fq: ["type:Award::Nomination"],
> sort: "score desc",
> start: 0,
> rows: 20,
> q: "*:*"
> }
> {code}
> takes just a few milliseconds, but this one:
> {code}
> {
> fq: [
> "type:Award::Nomination",
> "created_at_d:[* TO 2014-09-08T23:59:59Z]"
> ],
> sort: "score desc",
> start: 0,
> rows: 20,
> q: "*:*"
> }
> {code}
> takes almost 15 seconds.
> I have just ≈12k of documents with type "Award::Nomination", but around half
> a billion with created_at_d field set. And it seems Solr applies the
> created_at_d filter first going through all documents where this field is
> set, which is not very smart.
> I think if it can't do anything better than applying filters in the alphabet
> order it should apply them in the order they were received.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]