lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Mixing database and lucene searches
Date Wed, 12 May 2004 00:13:24 GMT
On May 11, 2004, at 7:41 PM, Glen Stampoultzis wrote:
>
> Is it possible to use float and date ranges in that case?  Or maybe I 
> should
> just read the details in the manual and stop asking stupid questions. 
> :-)

Terms in the index are *always* text.  The DateField class in Lucene 
helps do conversions, but see the wiki for more info on date fields.  I 
wouldn't recommend using it, personally, unless millisecond granularity 
is really desired.

For other types, if you need range queries, you need to make the 
textual representation be ordered lexicographically (i.e. pad the 
numbers with leading zeros so that all numbers have the same width) - 
again, some of this is on the wiki.

There really isn't anything in the "manual" about field types, that I 
know of, only brief mentions on the wiki and e-mail archives.

	Erik


>
> "Matt Quail" <matt@ctx.com.au> wrote in message
> news:40A15BF3.6050301@ctx.com.au...
>> Eric Jain wrote:
>>>> To ask a silly question:  What approach does Lucene use for
>>>> ranges and sorting?
>>>
>>>
>>> A range such as '10-60' is expanded into a boolean query containing 
>>> all
>>> terms that are in the index and lie within the specified range, e.g. 
>>> '10
>>> or 11 or 20 or 59'.
>>
>> Yes, using a range search requires loading all the (existant) terms
>> between '10' and '60' and combining them into one big Boolean "or"
>> query. There is a limit to how big such a query can get.
>>
>> The performant alternative is to use a Filter. You lose the ability to
>> do boosting on that field, but it can handle ranges of any size.
>>
>> =Matt
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


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


Mime
View raw message