lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg K <>
Subject Filtering on a SpanQuery without losing spans
Date Wed, 16 Nov 2005 20:19:33 GMT
Hi All,

I'm using a bunch of SpanNearQueries combined in a SpanOrQuery to do a set
of searches matches a phrase with a prefix search at the end. I.e.

"phrase with prefix s*" kind of thing that matches "phrase with prefix
search" and "phrase with prefix string".

It works great and lets me quickly produce excerpts with the spans that I
get via getSpans.

Now, however, I'd like to be able restrict the search to certain documents
in the index, so I don't have to stream through a couple of thousand spans
to produce the 10 excerpts on a subset of the documents.

I've tried added a term to the SpanNearQueries that targets a keyword field
containing the document ids, but SNQ (understandably) can't handle that.
There isn't a SpanBooleanQuery and if I wrap the SpanOrQuery in a
BooleanQuery I'll lose access to the getSpans() method - same if I use a
Filter - can't get spans out of a Hits object, right?

Am I missing something? Is there a straightforward way to do what I'm trying
to do that I'm missing?



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