开发者

Filtered results highlighting with Solr 1.4, 1.5

开发者 https://www.devze.com 2023-01-17 00:46 出处:网络
Consider we have a database of US people in Solr. We\'ve 20 persons who are interested to find either Mans or Womans in the database. Besides that those 20 persons are distributed among US and are wil

Consider we have a database of US people in Solr. We've 20 persons who are interested to find either Mans or Womans in the database. Besides that those 20 persons are distributed among US and are willing to find only people in their cities. We're doing Solr query: q=gender:Man&fq=location:'New York' for example. Highlighting is ON on all fields. People will see only gender highlighted, but they would be really happier if they can se also the location开发者_如何学编程 field highlighted. Is there any simple way to do that? For speed optimization must run filter query. This is a must.


I don't think so. But you could alwasy implement it yourself. It's not hard. For example, after you get results from solr and before you display the results to the end user, replace "location" with "<font color='red'>location</font>" (just an example. you'd better to use CSS)

0

精彩评论

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