开发者

Search Against Series Of Fields - Solr

开发者 https://www.devze.com 2023-02-12 07:40 出处:网络
Lets consider a product catalog with fields Category, Brand, BrandAndCategory And default search field.

Lets consider a product catalog with fields Category, Brand, BrandAndCategory And default search field.

If i search for "dell laptops" at first solr should search against Category field, if no results are found then against Brand field and then BrandAndCategory field and finally against the default search field.Right now i am mak开发者_如何学运维ing four different calls one by one to the solr from my Java Code to achieve this.It might affect the performance eventually.Is there any other way to achieve this from solr itself?.

Please help me on this issue.Thanks in Advance.


I believe you can use the DisMaxQueryParser for this.


If getting the best results at the top is enough and lower priority results towards the bottom of the result set are acceptable, then something like this may work for you:

 q=dell laptops&qf=Category^100 Brand^50 BrandAndCategory^10 Default
0

精彩评论

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