You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Mykola Peleshchyshyn <mp...@yahoo.com> on 2009/02/23 10:12:14 UTC

Range search in dependent collections

Hello,
I'm new to Lucene and I have the following problem:

I have a Users with first name, last name etc. and User Jobs (collection) with job title, start date, end date.

I need to perform search on all user fields (fist name, last name etc) and job fields (job title and optionally start date and end date).

What would be the best way to index and search this data?

Thank you,
Mykola Peleshchyshyn 


      

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


Re: Range search in dependent collections

Posted by Ian Lea <ia...@gmail.com>.
Just repeat the first and last names in each document.  How many users
and jobs are you talking about?  Lucene will cope unless the numbers
are extremely large.

Note that I'm not claiming this is necessarily the "best" way, just
the simplest which is often, but not always, the best.


--
Ian.

On Mon, Feb 23, 2009 at 2:49 PM, Mykola Peleshchyshyn
<mp...@yahoo.com> wrote:
> What about the case with several jobs? I.e.:
>
> firstname: whatever
> lastname: whatever
>
> jobtitle1: somejob
> startdate1: whenever
> enddate1: whenever
> .............................................
> jobtitleN: somejob
> startdateN: whenever
> enddateN: whenever
>
>
>
> ----- Original Message ----
> From: Ian Lea <ia...@gmail.com>
> To: java-user@lucene.apache.org
> Sent: Monday, February 23, 2009 4:14:37 PM
> Subject: Re: Range search in dependent collections
>
> Hi
>
>
> The simplest way is to flatten your data into lucene documents that
> hold all relevant info for user/job combinations.  That will let you
> search easily across whichever fields you want.
>
> Your documents could look like this:
>
> firstname: whatever
> lastname: whatever
> jobtitle: somejob
> startdate: whenever
> enddate: whenever
>
> and searches could be something like lastname:whatever jobtitle:somejob.
>
>
> --
> Ian.
>
>
> On Mon, Feb 23, 2009 at 9:12 AM, Mykola Peleshchyshyn
> <mp...@yahoo.com> wrote:
>> Hello,
>> I'm new to Lucene and I have the following problem:
>>
>> I have a Users with first name, last name etc. and User Jobs (collection) with job title, start date, end date.
>>
>> I need to perform search on all user fields (fist name, last name etc) and job fields (job title and optionally start date and end date).
>>
>> What would be the best way to index and search this data?
>>
>> Thank you,
>> Mykola Peleshchyshyn

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


Re: Range search in dependent collections

Posted by Mykola Peleshchyshyn <mp...@yahoo.com>.
What about the case with several jobs? I.e.:

firstname: whatever
lastname: whatever

jobtitle1: somejob
startdate1: whenever
enddate1: whenever
.............................................
jobtitleN: somejob
startdateN: whenever
enddateN: whenever



----- Original Message ----
From: Ian Lea <ia...@gmail.com>
To: java-user@lucene.apache.org
Sent: Monday, February 23, 2009 4:14:37 PM
Subject: Re: Range search in dependent collections

Hi


The simplest way is to flatten your data into lucene documents that
hold all relevant info for user/job combinations.  That will let you
search easily across whichever fields you want.

Your documents could look like this:

firstname: whatever
lastname: whatever
jobtitle: somejob
startdate: whenever
enddate: whenever

and searches could be something like lastname:whatever jobtitle:somejob.


--
Ian.


On Mon, Feb 23, 2009 at 9:12 AM, Mykola Peleshchyshyn
<mp...@yahoo.com> wrote:
> Hello,
> I'm new to Lucene and I have the following problem:
>
> I have a Users with first name, last name etc. and User Jobs (collection) with job title, start date, end date.
>
> I need to perform search on all user fields (fist name, last name etc) and job fields (job title and optionally start date and end date).
>
> What would be the best way to index and search this data?
>
> Thank you,
> Mykola Peleshchyshyn

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


Re: Range search in dependent collections

Posted by Ian Lea <ia...@gmail.com>.
Hi


The simplest way is to flatten your data into lucene documents that
hold all relevant info for user/job combinations.  That will let you
search easily across whichever fields you want.

Your documents could look like this:

firstname: whatever
lastname: whatever
jobtitle: somejob
startdate: whenever
enddate: whenever

and searches could be something like lastname:whatever jobtitle:somejob.


--
Ian.


On Mon, Feb 23, 2009 at 9:12 AM, Mykola Peleshchyshyn
<mp...@yahoo.com> wrote:
> Hello,
> I'm new to Lucene and I have the following problem:
>
> I have a Users with first name, last name etc. and User Jobs (collection) with job title, start date, end date.
>
> I need to perform search on all user fields (fist name, last name etc) and job fields (job title and optionally start date and end date).
>
> What would be the best way to index and search this data?
>
> Thank you,
> Mykola Peleshchyshyn

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