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 Christopher M Collins <co...@us.ibm.com> on 2008/08/25 19:18:50 UTC

SpanQuery and FilteredQuery

Hello,

Can anyone tell me if it's possible to apply a filter to a SpanQuery and
still use query.getSpans(indexReader)?  I'm using getSpans to get back the
original positions in the text but I would like to filter the results
returned by getSpans.  I have a Filter I can apply if I just search with
the query, but I don't see a way to apply the filter and still use the
getSpans method.  I thought maybe FilteredQuery looked promising, but of
course if I wrap my SpanQuery and Filter in a FilteredQuery, getSpans is no
longer available.

Any suggestions? Thanks!

Chris
______________________________________________________________
Christopher Collins \ http://www.cs.utoronto.ca/~ccollins
Department of Computer Science \ University of Toronto
Collaborative User Experience Group \ IBM Research

Re: SpanQuery and FilteredQuery

Posted by Eran Sevi <er...@gmail.com>.
Hi Chris,
I asked exactly the same question a little while ago and got a pretty good
answer from Paul Elschot.
Try searching the archives for 'Filtering a SpanQuery'. It was around the
13/5/08.

Hope it helps,
Eran.

On Mon, Aug 25, 2008 at 8:18 PM, Christopher M Collins
<co...@us.ibm.com>wrote:

>
> Hello,
>
> Can anyone tell me if it's possible to apply a filter to a SpanQuery and
> still use query.getSpans(indexReader)?  I'm using getSpans to get back the
> original positions in the text but I would like to filter the results
> returned by getSpans.  I have a Filter I can apply if I just search with
> the query, but I don't see a way to apply the filter and still use the
> getSpans method.  I thought maybe FilteredQuery looked promising, but of
> course if I wrap my SpanQuery and Filter in a FilteredQuery, getSpans is no
> longer available.
>
> Any suggestions? Thanks!
>
> Chris
> ______________________________________________________________
> Christopher Collins \ http://www.cs.utoronto.ca/~ccollins
> Department of Computer Science \ University of Toronto
> Collaborative User Experience Group \ IBM Research