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 Igor Shalyminov <is...@yandex-team.ru> on 2013/01/31 17:14:46 UTC

Getting the number of all hits for the SpanQuery

Hello!

I want to perform a SpanQuery and get the precise overall number of all hits throughout the entire index (i.e. if the query words combination appears multiple times in a document, I need that number counted).
I've found a method called SpanQuery.getSpans, but the way of using it in the stable release is somewhat changed (using it with just an IndexReader doesn't seem to be possible).

What is the way to do this now?

-- 
Best Regards,
Igor Shalyminov

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Getting the number of all hits for the SpanQuery

Posted by Igor Shalyminov <is...@yandex-team.ru>.
Hi again!

So far I think that the easiest way to get all span matches is indeed this method (Lucene v 4.1 code):
public Spans getSpans(final AtomicReaderContext context, Bits acceptDocs, Map<Term,TermContext> termContexts)

But there is no annotation for this code except 'for internal use only', and the input parameters do not make sense to me.

What are these objects for, and how does one build them?

-- 
Best Regards,
Igor Shalyminov

31.01.2013, 20:15, "Igor Shalyminov" <is...@yandex-team.ru>:
> Hello!
>
> I want to perform a SpanQuery and get the precise overall number of all hits throughout the entire index (i.e. if the query words combination appears multiple times in a document, I need that number counted).
> I've found a method called SpanQuery.getSpans, but the way of using it in the stable release is somewhat changed (using it with just an IndexReader doesn't seem to be possible).
>
> What is the way to do this now?
>
> --
> Best Regards,
> Igor Shalyminov
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org