lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manuj singh <s.manuj...@gmail.com>
Subject Must clause with filter queries
Date Mon, 07 May 2018 15:51:47 GMT
Hi all,
I am kind of confused how must clause(+) behaves with the filter queries.
e.g i have below query:
q=*:*&fq=+{!frange cost=200 l=NOW-179DAYS u=NOW/DAY+1DAY incl=true
incu=false}date

So i am filtering documents which are less then 179 old days.
So e.g if now is May 7th, 10.23 cst,2018, i should only see documents which
have date > Nov 9th, 10.23 cst, 2017.

However with the above query i am also seeing documents which are done on
Nov 5th,2017 (which seems like it is returning some docs from filter cache.
which is wired because in my date range for the start date  i am using
NOW-179DAYS and
Now is changing every time, so it shouldn't go to filtercache as every new
request will have  a different time stamp. )

However if i remove the + from the filter query it seems to work fine.

I am mostly thinking it seems to be a filtercache issue but not sure how i
prove that.

Our auto soft commit is 500 ms , so every 0.5 second we should have a new
searcher open and cache should be flushed.

Something is not right and i am not able to figure out what. Has some one
seen this kind of issue before ?

If i move the query from fq to q then also it works fine.

One more thing when i put debug query i see the following in the parse query


*"QParser": "LuceneQParser", "filter_queries": [ "+{!frange cost=200
l=NOW-179DAYS u=NOW/DAY+1DAY incl=true incu=false}date", "-_parent_:F" ],
"parsed_filter_queries": [
"+FunctionRangeQuery(ConstantScore(frange(date(date)):[NOW-179DAYS TO
NOW/DAY+1DAY}))", "-_parent_:false" ]*

So in the above i do not see the date getting resolved to an actual time
stamp.

However if i change the syntax of the query to not use frange and local
params i see the transaction date resolving into correct timestamp.

So for the following query
q=*:*&fq=+date:[NOW-179DAYS TO NOW/DAY+1DAY]

i see the following in the debug query, and see the actualy timestamp:
"QParser": "LuceneQParser", "filter_queries": [ "date:[NOW-179DAYS TO
NOW/DAY+1DAY]", "-_parent_:F" ], "parsed_filter_queries": [
"date:[1510242067383
TO 1525737600000]", "-_parent_:false" ],


Not sure if its just a red herring ?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message