lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Why do range queries work on fields only ?
Date Tue, 03 Mar 2009 20:30:38 GMT
But it's still not clear what the semantics of your
search are. Do you mean
"I want index04, index05, index06, index07 and index08
to appear in that order in the field"? If so you can use one
of the SpanQuery family, specifying a large slop and
respecting order. But this could get clumsy with large
numbers of terms.

If you mean "at least one of index04...08 in the field"
that's just an OR clause.

Best
Erick


On Tue, Mar 3, 2009 at 1:18 PM, Raymond Balmès <raymond.balmes@gmail.com>wrote:

> sorry [index04 TO index 08]
>
> On Tue, Mar 3, 2009 at 7:18 PM, Raymond Balmès <raymond.balmes@gmail.com
> >wrote:
>
> > Just a simplified view of my problem :
> >
> > A document contains the terms "index01 blabla index02 xxx yyy index03 ...
> > index10".  I have the terms indexed in the collection.
> > I now want to look for documents which contains [page04 TO page08]...
> looks
> > like I can't do it
> > -RB-
> >   On Tue, Mar 3, 2009 at 6:33 PM, Steven A Rowe <sarowe@syr.edu> wrote:
> >
> >> Hi Raymond,
> >>
> >> On 3/3/2009 at 12:04 PM, Raymond Balmès wrote:
> >> > The range query only works on fields (using a string compare)... is
> >> > there any reason why it is not possible on the words of the document.
> >> >
> >> > The following query  [stringa TO stringb] would just give the list of
> >> > documents which contains words between those two strings.
> >>
> >> Can you give an example of what you want to do?
> >>
> >> I suspect what you want is to look at a range of terms that appear in
> the
> >> collection (that is, across all documents) - if this is so, then you may
> be
> >> interested in IndexReader.terms(Term):
> >>
> >>
> >>
> http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/index/IndexReader.html#terms(org.apache.lucene.index.Term)<http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/index/IndexReader.html#terms%28org.apache.lucene.index.Term%29>
> >>
> >> Steve
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message