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
> [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to