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 Lance Norskog <go...@gmail.com> on 2011/07/10 02:04:03 UTC

Join and Range Queries

Does the Join feature work with Range queries?

Given a time series of events stored as documents with time ranges, is
it possible to do a search that finds certain events, and then add
other documents whose time ranges overlap?

-- 
Lance Norskog
goksron@gmail.com

Re: Join and Range Queries

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Sat, Jul 9, 2011 at 8:04 PM, Lance Norskog <go...@gmail.com> wrote:
> Does the Join feature work with Range queries?

Not in any generic manner - joins are based on exact matches of
indexed tokens only.
But if you wanted something specific enough like same year, then you
could index that year for each document and do the join on that (it
would actually be a self join).

You could also get other resolutions by say indexing months...

doc1:
   description:...
   date:May
   close_dates:Apr May Jun

doc2:
  description...
  date: Jun
  close_dates: May Jun Jul

Then to find other events within 1 month of the selected events:
{!join from:date to:close_dates}description:octoberfest

Or to find other events within 2 months:
{!join from:close to:close_dates}description:octoberfest

-Yonik
http://www.lucidimagination.com


> Given a time series of events stored as documents with time ranges, is
> it possible to do a search that finds certain events, and then add
> other documents whose time ranges overlap?
>
> --
> Lance Norskog
> goksron@gmail.com
>