Filtered results highlighting with Solr 1.4, 1.5

2019-07-30 05:16发布

问题:

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.

回答1:

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)



标签: solr