I think you'd have to get creative with function queries. The trick is to define a function that returns 0 in the case where your if test is false, and 1 otherwise. Since the return is multiplied into the score, the eventual score is 0 and the doc is not returned.
Best Erick On Fri, Jun 13, 2014 at 2:49 AM, Pbbhoge <pradip.bh...@gmail.com> wrote: > Hi, > > I have two date fields in Solr Schema, I want to compare two different date > fields in solr itself . > how can i write the Query in Solr for comparing the two dates in solr itself > . > > I want to retrieve all docs or records from solr where updateDate >= > appliedDate OR appliedDate == null > > you can assume relational Query like > Retrieve all the records from reference data where updateDate >= > appliedDate OR appliedDate == null > > > My schema is as follows > <field name="_root_" type="string" indexed="true" stored="false"/> > <field name="DataId" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="FromFieldName" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="FromFieldType" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="FromFieldValue" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="ToFieldName" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="ToFieldType" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="ToFieldValue" type="string" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="UpdateDate" type="date" indexed="true" stored="true" > required="true" multiValued="false"/> > <field name="AppliedDate" type="date" indexed="true" stored="true" > required="false" multiValued="false"/> > </fields> > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/How-to-Query-to-Solr-for-comparing-two-dates-in-solr-tp4141611.html > Sent from the Solr - User mailing list archive at Nabble.com.