tags:

views:

58

answers:

2

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 categoryID, 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?

A: 

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

Wen
In my web page each facet will be a link to another page and I need categoryId and categoryAlias to generate that link and of course caregoryName to show on the screen.
Reza
A: 

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.

Karl Johansson