lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Rochkind <>
Subject Re: query for point in time
Date Thu, 15 Sep 2011 19:33:26 GMT
You didn't tell us what your schema looks like, what fields with what 
types are involved.

But similar to how you'd do it in your database, you need to find 
'documents' that have a start date before your date in question, and an 
end date after your date in question, to find the ones whose range 
includes your date in question.

Something like this:

q=start_date:[* TO '2010-01-05'] AND end_date:['2010-01-05' TO *]

Of course, you need to add on your restriction to just documents about 
'John Smith', through another AND clause or an 'fq'.

But in general, if you've got a db with this info already, and this is 
all you need, why not just use the db?  Multi-hieararchy data like this 
is going to give you trouble in Solr eventually, you've got to arrange 
the solr indexes/schema to answer your questions, and eventually you're 
going to have two questions which require mutually incompatible schema 
to answer.

An rdbms is a great general purpose question answering tool for 
structured data.  lucene/Solr is a great indexing tool for text matching.

On 9/15/2011 2:55 PM, gary tam wrote:
> Hi
> I have a scenario that I am not sure how to write the query for.
> Here is the scenario - have an employee record with multi value for project,
> started date, end date.
> looks something like
> John Smith             web site bug fix       2010-01-01       2010-01-03
>                               unit testing              2010-01-04
> 2010-01-06
>                               QA support             2010-01-07
> 2010-01-12
>                               implementation       2010-01-13
>   2010-01-22
> I want to find what project John Smith was working on 2010-01-05
> Is this possible or I have to back to my database ?
> Thanks

View raw message