You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Adrian Pillinger <ap...@dolby.co.uk> on 2007/10/29 17:21:48 UTC

Problem with ConstantScoreRangeQuery

I am programatically creating a query as follows.

     BooleanQuery query = new BooleanQuery();
     ConstantScoreRangeQuery range = new ConstantScoreRangeQuery 
("creationDate", "19500101", "20071029", false, false);
     query.add(range, Occur.MUST);

I am then executing the query which unexpectedly returns no results.

If I take the toString() of the boolean query I get

+creationDate:{19500101 TO 20071029}

Executing this in luke against the exact same index returns results  
as I expect.


Does anyone know what I am doing wrong?


The reason I am using a BooleanQuery is that I want to add extra  
clauses to this query once it is working.

Thanks
Adrian

-----------------------------------------
This message (including any attachments) may contain confidential
information intended for a specific individual and purpose.  If you
are not the intended recipient, delete this message.  If you are
not the intended recipient, disclosing, copying, distributing, or
taking any action based on this message is strictly prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org