lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <markrmil...@gmail.com>
Subject Re: Simple query API question
Date Wed, 30 Apr 2008 23:06:10 GMT
When using the API you will create a Term object that specifies the
field for each term...so visually its more like field1:x or field1:y or
field1:z
and then a rangequery set to field2, all joined using the BooleanQuery
object setting Occur.must Occur.should Occur.mustnot.

Take a look at the range of classes that extend Query. Start with
TermQuery and BooleanQuery.

- mark

On Wed, 2008-04-30 at 16:25 -0600, Preston Price wrote:
> This should be a pretty easy question to answer but I haven't been  
> able to figure out how to do this with the API.
> 
> I want to search two fields in my index; field 1 is and ID, field 2 is  
> a date of the form yyyymmdd.
> Now I can write a query string by hand to do a search like this on  
> both fields: "field1:(x or y or z) AND field2:[20080400 TO 20080500]"
> But I don't see how to generate an equivalent query using the API.
> 
> Thanks in advance!
> 
> Preston Price
> price@strands.com
> 


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


Mime
View raw message