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 "Christine Poerschke (BLOOMBERG/ LONDON)" <cp...@bloomberg.net> on 2017/09/18 11:50:53 UTC

Learning-to-Rank with Bees: question answer follow-up

Hi everyone,

At my "Learning-to-Rank with Apache Solr and Bees" talk on Friday [1] there was one question that wasn't properly understood (by me) and so not fully answered in the room but later in individual conversation the question/answer became clearer. So here I just wanted to follow-up and share with everyone (using a fictional mini example).

Hope that helps.

Thanks,

Christine

---

Scenario:
* a schema with multiple text fields e.g. title, summary, details
* search queries consider the text fields

Intention:
* have features that capture how well the user query matches various text fields

Example queries and feature definitions:

* without LTR:
  select?q=developer
  select?q=chef

* with LTR:
  select?q=developer&rq={!ltr model=myDemoModel efi.userQuery=developer}
  select?q=chef&rq={!ltr model=myDemoModel efi.userQuery=chef}

Notice how in the above example the two users' queries pass different efi.userQuery values and how the feature definitions below include a ${userQuery} placeholder.

myDemoFeatures.json

[
 {
  "name" : "userQueryTitle",
  "class" : "org.apache.solr.ltr.feature.SolrFeature",
  "params" : { "q" : "title:${userQuery}" }
 },
 {
  "name" : "userQuerySummary",
  "class" : "org.apache.solr.ltr.feature.SolrFeature",
  "params" : { "q" : "summary:${userQuery}" }
 },
 {
  "name" : "userQueryDetails",
  "class" : "org.apache.solr.ltr.feature.SolrFeature",
  "params" : { "q" : "details:${userQuery}" }
 }
]

---

Links

[1] http://sched.co/BAwI
[2] http://lucene.apache.org/solr/guide/6_6/learning-to-rank.html
[3] https://github.com/cpoerschke/ltr-with-bees