lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christine Poerschke (BLOOMBERG/ LONDON)" <>
Subject Re:Opposite termfrequency / Solr LTR
Date Thu, 29 Jun 2017 13:03:01 GMT
Hi Stefan,

Thanks for the question.

The existing FieldValueFeature class uses the field value and you would instead like to map
the value to a number that will vary from query to query.

External feature information (efi) can help with the query-to-query variation but for the
mapping we don't (as yet) have features to support that (I think).

Here's what the configuration and usage for a new FieldValueMapFeature class might look like:

# configuration
  "name":  "userCategoryHistory",
  "class": "org.apache.solr.ltr.feature.FieldValueMapFeature",
  "params": {
      "field" : "category",
      "defaultValue" : 0,
      "mapping" : "${userHistory}"

# usage
...&rq={!ltr model="myModel" efi.userHistory="{ 'shoes' : 3, 'socks' : 1 }"} 

The mailing thread is related, though slightly
different, and may also be of interest.

Hope that helps.

Best wishes,


----- Original Message -----
At: 06/29/17 11:13:59

Hello everybody,
I'm using Solr LTR and i want to calculte a Feature value using the
following way:

I have a String with all Categories that are in a users search-history:
e.g. "shoes,shoes,socks,shoes"
Now I'd like to count the occurances of the value of the category field in
the String (for each document).

doc 1:{ category:shoes}
myString: "shoes,shoes,socks,shoes"

result = 3

I tried using termfrequency but it works only in the opposite direction.
Is there a way to acchieve this though?

Best regards,

View this message in context:
Sent from the Solr - User mailing list archive at

View raw message