Marco Remy created SOLR-12960:
---------------------------------

             Summary: mm.autoRelax not working with cascaded qf
                 Key: SOLR-12960
                 URL: https://issues.apache.org/jira/browse/SOLR-12960
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: query parsers
    Affects Versions: 6.5
            Reporter: Marco Remy


Hi,

The _edismax_ query parser parameter *mm.autoRelax* won't work in a particular 
configuration. I consider this as a bug and therefore open this ticket.
----
A minimalized brief about the core configuration:
 We maintain a solr core with some localized fields with respective analyzers 
and different stopword lists, like the schema configuration you can see below.
{code:xml}
<field name="title" type="strings" indexed="false" stored="true"/>
<field name="title_de" type="text_german" indexed="true" stored="false"/>
<field name="title_en" type="text_english" indexed="true" stored="false"/>
...
{code}
The indexed data is processed by langID module and put into the appropriate 
localized field. The upper field is intended for display only. The lower two 
will be indexed.

The search request handler configuration is set up as followed.
{code:xml}
<!-- minimal configuration wich reproduces the problem -->
<requestHandler name="/select" class="solr.SearchHandler">
  <lst name="defaults">
    <str name="defType">edismax</str>
    <str name="qf">title</str>
    <str name="mm">100%</str> <!-- all clauses must match -->
    <bool name="mm.autoRelax">true</bool>
  </lst>
  <lst name="invariants">
    <str name="f.title.qf">
      title_de
      title_en
  </lst>
</requestHandler>
{code}
For convenient search for a title the qf parameter is also defined on field 
name *title*. The field itself is not indexed (not searchable), but the query 
is delegated to the underlying localized fields.

As you can see the qf parameter is cascaded.
{noformat}
qf=title >> title_de title_en
{noformat}
*By this the mm.autoRelax parameter doesn't work as expected.*
{quote}If true, the number of clauses required (minimum should match) will 
automatically be relaxed if a clause is removed (by e.g., stopwords filter) 
from some but not all qf fields.
{quote}
Example query and debug:
{noformat}
q=introduction to measurement

(
  +(
    DisjunctionMaxQuery(
      (
        (
          langid_title_en:introduct | 
          langid_title_de:introduction
        )
      )
    )
    DisjunctionMaxQuery(
      (
        (
          langid_title_de:to
        )
      )
    )
    DisjunctionMaxQuery(
      (
        (
          langid_title_en:measur | 
          langid_title_de:measurement
        )
      )
    )
  )~3
)
{noformat}
Although one stopword is detected and removed from query the overall number of 
required clauses remains 3.

If the localized fields are defined directly in the qf parameter everything 
will be fine:
{noformat}
q=introduction to measurement
qf=title_de title_en

(
  +(
    DisjunctionMaxQuery(
      (
        langid_title_en:introduct | 
        langid_title_de:introduction
      )
    )
    DisjunctionMaxQuery(
      (
        langid_title_de:to
      )
    ) 
    DisjunctionMaxQuery(
      (
        langid_title_en:measur | 
        langid_title_de:measurement
      )
    )
  )~2
)
{noformat}
To avoid the problem by not cascading qf might be no big deal. But if many 
localized fields exist and should be searched by default the configuration 
overhead increases massively. We have 6 languages and 12 localized fields. This 
leads to 72 fields to be defined in qf.
{code:xml}
<str name="qf">
  <!-- title : localized field -->
  title_de^4
  title_en^4
  title_fr^4
  title_ja^4
  title_cjk^4
  title_txt^4
  <!-- summary : localized field -->
  ...
</str>
{code}
If someone has any questions, feel free to comment. I will reply as soon as 
possible.

- Regards



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to