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 "Sreenivas.T" <sr...@gmail.com> on 2017/12/19 03:41:02 UTC

Span queries

Hi,

I'm writing span query with in own custom query parser. I get the tokens
from query analyzer and create span term queries from each token. Later I'm
doing span near query with all these span term queries.

This would work if all the tokens are present in the index with in
specified slop. However if One of them missing no results comes up. I know
it is kind of phrase query.

Is there a way to write span queries to ignore few tokens? I would like to
return results even if few tokens are present. Please suggest.

Regards,
Sreenivas

Re: Span queries

Posted by Emir Arnautović <em...@sematext.com>.
Hi Sreenivas,
If you go extreme and accept that you want to return even if slop is large, you could utilize edismax: use mm to define how much terms must match and pf and ps and pf2/3 and ps2/3 to boost results that match slop requirements. Maybe you can see if extending edismax might be simpler option for you if OOTB features do not match your case.

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 19 Dec 2017, at 04:41, Sreenivas.T <sr...@gmail.com> wrote:
> 
> Hi,
> 
> I'm writing span query with in own custom query parser. I get the tokens
> from query analyzer and create span term queries from each token. Later I'm
> doing span near query with all these span term queries.
> 
> This would work if all the tokens are present in the index with in
> specified slop. However if One of them missing no results comes up. I know
> it is kind of phrase query.
> 
> Is there a way to write span queries to ignore few tokens? I would like to
> return results even if few tokens are present. Please suggest.
> 
> Regards,
> Sreenivas