Open IT Experts for Enterprise

Zylk empresa de desarrollo de ecommerce

Using the editorial marker field in SOLR elevation component

Cesar Capillas
Cesar Capillas
Solr logo

Recommended search in SOLR

One of the nice features of SOLR is the ability for doing promoted or recommended searches. 
With this feature, you can basically use a kind of query (elevation query), that is able to elevate static searches configured by id.

Use case example: Imagine that you have a popular Alfresco blog in your site, and you want that when searching for term «alfresco blog», your first or  just a «recommended page» is the solutions page.

In elevate.xml:

  <query text="alfresco blog">
    <doc id="" />

In your solrconfig.xml:

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

Then in the fl parameter of your query should include the field «[elevated]«. Using solr admin with qt=/elevate or the bash script of the other day:

$ ./ "alfresco blog" url,score,[elevated] "" elevate zylk

It is clear that if you order by score, you can see something diferent in the resultset.

  "url": "",
  "score": 0,
  "[elevated]": true
  "url": "",
  "score": 2.7496874,
  "[elevated]": false
  "url": "",
  "score": 2.3795006,
  "[elevated]": false


Si te ha parecido interesante comparte este post en RRS


Leer más sobre temas relacionados

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *