开发者

Solr Faceting result with more than just count

开发者 https://www.devze.com 2023-01-10 12:35 出处:网络
This is my requirment: I have a list of products indexed in Solr and categoryid, category name and category alias are MultiValued fields.

This is my requirment: I have a list of products indexed in Solr and categoryid, category name and category alias are MultiValued fields. I would like to do faceting on category but want the faceting result to have all categ开发者_Python百科oryID, CategoryName and Category Alias along with the count number. Is this possible? Or I have to do faceting only for CategoryID and with another request or query to our SQL server database get the rest of the information of that CategoryID?


If a slight increase in index size doesn't matter to you, you're able to change the schema, and you're able to do a full reindex, then add a new field 'categoryFacet' for this. This new field would hold the information you described in your question.

Most likely, you'll solve this by editing the SELECT statement you use for indexing.


Base on the set up in solrconfig,xml, you get back a list of facet value and count. When you select a facet, you'll get back results with all fields you defined in the schema.xml. I'm not aware of anything would allow facet to return more than facet value and count. What's your goal? Is it to display categoryName, categoryId and categoryAlias together as facet to end user? or is it something else? It'll be easier for people to help you if you state your goal clearly. I'm not sure if you checkout the wiki for facet already.

http://wiki.apache.org/solr/SimpleFacetParameters#facet

0

精彩评论

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