Solr: Boosting-down phonetic variations?

2019-06-24 20:49发布

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?

标签: lucene solr
1条回答
我命由我不由天
2楼-- · 2019-06-24 21:14

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.

查看更多
登录 后发表回答