Hello everybody,

First of all, thanks for this great tool!

Do you know if there is a way to apply a *boost inside a SpanOrQuery*
please? (Solr 7.1, lucene of same version I think.)

Example of query structure generated by edismax query parser (inside the
usual BooleanQuery / DisjunctionMaxQuery for multiple fields):

   - SpanNearQuery
      - List of SpanOrQuery
         - List of SpanTermQuery or SpanNearQuery* <-- I want to boost
         those terms*

I want to apply a boost to each clause inside the SpanOrQuery. So I tried
(via custom query parser extending edismax):

   - SpanNearQuery
      - List of SpanOrQuery
         - List of *SpanBoostQuery*, each wrapping:
            - a SpanTermQuery or a SpanNearQuery.

The boost seems to be ignored, although the query is executed successfully
(except boost not applied).

Here is the use case:

The input is a sentence, a PhraseQuery to valuate proximity. I am using
edismax query parser and a SynonymGraphFilter and I want to apply a
different boost for each synonym, so the boost information is attached to
each term in the synonym file (e.g. 0.7_foo). In case of multi-term
synonyms (expanded version), edismax generates a SpanQuery, which sounds to
me like a graph search, so far so good.

Where it fails is when I insert a SpanBoostQuery to wrap each clause inside
the SpanOrQuery (via a custom query parser extending edismax, extracting
boosts from term text). While the query is still returning results, the
boost seems just ignored.



Is that a misusage? A bug? Any advice about how I can fix it or work around
it please?

To have a similar behavior, I replaced the SpanQuery by a list of
PhraseQueries, one for each possible combination of terms in the SpanQuery,
which can result in lots of phrases, and the performances seem highly
affected.

Thanks a lot!
Best Regards,
Antoine

Reply via email to