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 Sébastien Muller <se...@gmail.com> on 2015/09/03 10:58:13 UTC

Elevation working for some queries, not others

Hi!
I have a Solr 4.10.4 installation where elevation is behaving strangely
i.e. some queries correctly elevate the appropriate doc(s) while others
don't. I've debugged the queries and other than the query term itself they
are identical. Also confirmed that the doc that should be elevated actually
appears in the results. What have I missed?

The elevation component:

<searchComponent name="elevator" class="solr.QueryElevationComponent" >
    <!-- pick a fieldType to analyze queries -->
    <str name="queryFieldType">elevate_test</str>
    <str name="config-file">elevate.xml</str>
  </searchComponent>

The query component:

<requestHandler name="/select" class="solr.SearchHandler">
    <lst name="invariants">
      <str name="defType">edismax</str>
    </lst>
    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <int name="rows">10</int>
      <str name="mm">75%</str>
      <str name="df">content</str>
      <str name="facet">on</str>
      <str name="fq"></str>
      <!-- Highlighting defaults -->
      <str name="hl">on</str>
      <str name="hl.simple.pre">&lt;span
class="frontsearch-highlight"&gt;</str>
      <str name="hl.simple.post">&lt;/span&gt;</str>
      <str name="f.author_fullname.hl.preserveMulti">true</str>
      <str name="f.title.hl.fragsize">0</str>
      <str name="f.url.hl.fragsize">0</str>
      <str name="f.email.hl.fragsize">0</str>
      <str name="f.phone.hl.fragsize">0</str>
      <str name="f.mobile.hl.fragsize">0</str>
      <str name="f.summary.hl.fragsize">300</str>
      <str name="f.summary.hl.alternateField">summary</str>
      <str name="f.summary.hl.maxAlternateFieldLength">300</str>
      <str name="f.content.hl.fragsize">300</str>
      <str name="f.content.hl.alternateField">content</str>
      <str name="f.content.hl.maxAlternateFieldLength">300</str>
      <str name="enableElevation">true</str>
      <str name="forceElevation">true</str>
    </lst>
      <arr name="last-components">
        <str>spellcheck</str>
        <str>elevator</str>
      </arr>
    </requestHandler>

The elevate_text fieldtype:

 <fieldType name="elevate_test" class="solr.TextField">
        <analyzer>
            <tokenizer class="solr.StandardTokenizerFactory"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
    </fieldType>

An example query:

http://localhost:8983/solr/select?q=petroleum&fl=[elevated],id,title&wt=json&hl=false&facet=false&defType=edismax&debugQuery=true&rows=200&qf=title&enableElevation=true&forceElevation=true

Elevation config, all except biotechnology and petroleum are successful:

<elevate>

  <query text="ict">
  <doc id="epi_184668" />
  </query>

  <query text="energy">
  <doc id="epi_178546" />
  </query>

  <query text="sintef energy">
  <doc id="epi_178546" />
  </query>

  <query text="jobs">
  <doc id="epi_240033" />
  </query>

  <query text="biotechnology">
  <doc id="epi_184660" />
  </query>

  <query text="petroleum">
  <doc id="epi_177127" />
  </query>

</elevate>

Seb