0

I am searching with keyword camera. I have two records in solr. One record has camera in three different searchable fields. Where as in the other record i have camera in only one field.

Solr give me back the 2nd record first.

I want them to be sorted based on the weight.

2 Answers2

1

I'm assuming you are using the edismax query handler. That uses the score from the highest scoring field.

Create a new combined field. Use copyField directives in the schema.xml file to copy each of the three fields to the combined field. Search on the combined field. That will have the word camera three times.

Like this:

<copyField source="field1" dest="combined">
<copyField source="field2" dest="combined">
<copyField source="field3" dest="combined">
Walter Underwood
  • 1,201
  • 9
  • 11
1

With eDisMax, you could try adding tie parameter to use the weight of other fields as an influence.

Alexandre Rafalovitch
  • 9,709
  • 1
  • 24
  • 27