You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Anders Melchiorsen <ma...@spoon.kalibalik.dk> on 2009/09/21 11:27:36 UTC

Overlapping zipcodes

We are in a situation where we are trying to match up documents based on a
number of zipcodes.

In our case, zipcodes are just integers, so that hopefully simplifies
things.


So, we might have a document listing a number of zipcodes:

  1200-1450,2000,5000-5999

and we want to do a search of "1100-1300,8000" and have it match the
document.


How can this be done using Solr?


Thanks,
Anders.


Re: Overlapping zipcodes

Posted by Erik Hatcher <er...@gmail.com>.
Seems wrong, but actually is how I've done this sort of thing (with  
year ranges like 1860-1865).   Denormalizing/expanding is a pretty  
common way to solve problems with Lucene/Solr.  There's not that many  
zip codes, so expanding shouldn't be prohibitive.

	Erik

On Sep 21, 2009, at 9:49 AM, Anders Melchiorsen wrote:

> Yeah, that takes care of the query side, but how can we index a list  
> like
> that?
>
> It seems wrong to create a multivalue zipcode field and populate it  
> with
> each individual number in all the ranges.
>
>
> Regards,
> Anders.
>
>
> On Mon, 21 Sep 2009 19:05:01 +0530, Avlesh Singh <av...@gmail.com>  
> wrote:
>> Range queries?
>>
>> Cheers
>> Avlesh
>>
>> On Mon, Sep 21, 2009 at 2:57 PM, Anders Melchiorsen
>> <mail@spoon.kalibalik.dk
>>> wrote:
>>
>>> We are in a situation where we are trying to match up documents  
>>> based
> on
>>> a
>>> number of zipcodes.
>>>
>>> In our case, zipcodes are just integers, so that hopefully  
>>> simplifies
>>> things.
>>>
>>>
>>> So, we might have a document listing a number of zipcodes:
>>>
>>> 1200-1450,2000,5000-5999
>>>
>>> and we want to do a search of "1100-1300,8000" and have it match the
>>> document.
>>>
>>>
>>> How can this be done using Solr?
>>>
>>>
>>> Thanks,
>>> Anders.
>>>
>>>


Re: Overlapping zipcodes

Posted by Anders Melchiorsen <ma...@spoon.kalibalik.dk>.
Yeah, that takes care of the query side, but how can we index a list like
that?

It seems wrong to create a multivalue zipcode field and populate it with
each individual number in all the ranges.


Regards,
Anders.


On Mon, 21 Sep 2009 19:05:01 +0530, Avlesh Singh <av...@gmail.com> wrote:
> Range queries?
>
> Cheers
> Avlesh
>
> On Mon, Sep 21, 2009 at 2:57 PM, Anders Melchiorsen
> <mail@spoon.kalibalik.dk
>> wrote:
>
>> We are in a situation where we are trying to match up documents based
on
>> a
>> number of zipcodes.
>>
>> In our case, zipcodes are just integers, so that hopefully simplifies
>> things.
>>
>>
>> So, we might have a document listing a number of zipcodes:
>>
>>  1200-1450,2000,5000-5999
>>
>> and we want to do a search of "1100-1300,8000" and have it match the
>> document.
>>
>>
>> How can this be done using Solr?
>>
>>
>> Thanks,
>> Anders.
>>
>>

Re: Overlapping zipcodes

Posted by Avlesh Singh <av...@gmail.com>.
Range queries?

Cheers
Avlesh

On Mon, Sep 21, 2009 at 2:57 PM, Anders Melchiorsen <mail@spoon.kalibalik.dk
> wrote:

> We are in a situation where we are trying to match up documents based on a
> number of zipcodes.
>
> In our case, zipcodes are just integers, so that hopefully simplifies
> things.
>
>
> So, we might have a document listing a number of zipcodes:
>
>  1200-1450,2000,5000-5999
>
> and we want to do a search of "1100-1300,8000" and have it match the
> document.
>
>
> How can this be done using Solr?
>
>
> Thanks,
> Anders.
>
>