Hagai Cibulski
Hagai Cibulski

Reputation: 4541

Solr: Boosting-down phonetic variations?

I'm trying to search by two fields, each having its own boost factor, and include phonetic variations, but results with these variations should always be ranked lower in the results. The problem is currently that results with phonetic variation in the field with the higher boost are preferred over results with exact match in the field with lower boost.

In schema.xml I have a field named "text" containing two other searchable fields ("title" and "description" implemented via copyField), each with its boost factor (defined in a dismax SearchHandler in solrconfig.xml). This field has a solr.PhoneticFilterFactory filter with DoubleMetaphone on both "index" and "query" analyzers. As I understand this, phonetic variations of each word are added to the query and to the index.

My question is how can I tell solr to give a separate boost factor (e.g. 0.3) to the phonetic variations?

Upvotes: 4

Views: 1049

Answers (1)

Yuval F
Yuval F

Reputation: 20621

One possible solution is to create two more fields: Suppose your original fields are named "title" and "description". Create "title_phonetic" and "description_phonetic" copy_fields, and only add the phonetic variations to these fields. Next, use the dismax parser to give different boosts to these fields.

Upvotes: 5

Related Questions