lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tao, Jing" <>
Subject Conditional Filter Queries
Date Thu, 16 Apr 2015 15:48:58 GMT

I want to filter my search results by different date fields based on content type.
In other words: if contentType is A, filter out results that are older than 1 year; if contentType
is B, filter out results that are older than 2 years; otherwise, date does not matter.

Is that possible with fq parameters?
Would it be something like  fq=(contentType:"A" AND startDate:[NOW-1YEAR TO NOW]) OR (contentType:"B"
AND startDate:[NOW-2YEAR TO NOW]) OR !contentType: ("A" or "B")

Is there a better way to do this?


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