lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: TermRangeQuery
Date Fri, 26 Nov 2010 20:18:18 GMT
What sort of ranges are you trying to use?  Maybe you could store a
separate field, just for these queries, with some normalized form of
the ids, with all numbers padded out to the same length etc.

--
Ian.

On Fri, Nov 26, 2010 at 4:34 PM, Amin Mohammed-Coleman <aminmc@gmail.com> wrote:
> Hi
>
> Unfortunately my range query approach did not work.   It seems to be related to the
ids themselves.  The list has ids that look this:
>
>
> ID-NYC-1234
> ID-LND-1234
> TX-NYC-1334
> TX-NYC-BBC-123
>
> The ids may range from 90 to 1000.  Is there another approach I could take?  I tried
building a string with all the ids and set them against a field for example:
>
> dataId: ID-NYC-123 dataId: ID-NYC-1234....
>
> but that's not a great approach I know...
>
> any help would be appreciated.
>
> Thanks
> Amin
>
>
>
> On 26 Nov 2010, at 14:39, Ian Lea wrote:
>
>> Absolutely, as long as your ids will sort as you expect.
>>
>> I'm not clear what you mean by XDF-123 but if you've got
>>
>> AAA-123
>> AAA-124
>> ...
>> ABC-123
>> ABC-234
>> etc.
>>
>> then you'll be fine.  If they don't sort so neatly you can use the
>> TermRangeQuery constructor that takes a Collator but note the
>> performance warning in the javadocs.
>>
>>
>> --
>> Ian.
>>
>>
>> On Fri, Nov 26, 2010 at 2:18 PM, Amin Mohammed-Coleman <aminmc@gmail.com> wrote:
>>> Hi All
>>>
>>> I was wondering whether I can use TermRangeQuery for my use case.  I have a
collection of ids (represented as XDF-123) and I would like to do a search for all the ids
(might be in the range of 10000) and for each matching id I want to get the corresponding
data that is stored in the index (for example the document contains id and string value).
 I am using a custom collector to collect that string value for each match.  Is it ok to
use a TermRangeQuery for the ids rather than creating a massive query string?
>>>
>>>
>>> Thanks
>>> Amin
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

---------------------------------------------------------------------
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