开发者

Solr: Boosting-down phonetic variations?

开发者 https://www.devze.com 2023-02-09 22:12 出处:网络
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 c

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 t开发者_如何学Gowo 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消