1

I am new to solr. I want to implement hierarchical faceting in my application. I went through http://wiki.apache.org/solr/HierarchicalFaceting and also for the preparation of correct xml.

My need is to push XML to solr for indexing and it should show expected results as shown in solr wiki.

Problem: I am not understanding how should I specify facet fields in solrconfig/schema and also in the xml that will be posted. IF anyone out there can provide me example configuration that will be great. I would like to do it as it is performing on solr hierarchical wiki above.

I may be sounding like a total newbie here but I am stuck .

Ref Document-

<add>
  <doc> 
    <field name="id">4</field> 
    <field name="0/NonFic">General</field> 
    <field name="1/NonFic/Law">Rules</field> 
    <field name="1/NonFic/Sci">Chemistry</field> 
    <field name="1/NonFic/Sci">Physics</field> 
  </doc> 
</add>

Thanks 89neuron

Srikanth Venugopalan
  • 9,011
  • 3
  • 36
  • 76
89n3ur0n
  • 921
  • 11
  • 24

1 Answers1

1

There is no difference in configuration for Solr Pivots and they don't need special configuration.

With the XML data configure as a simple field or multivalued field separate field.

Configure the fields as is in string format multivalued fields, if needed.
For e.g. field for Country and state would be 2 different fields.

Only during Search, you would need to pass facet.pivot=country,state to get the Hierarchy Facets.

<add>
  <doc> 
    <field name="id">4</field> 
    <field name="country">US</field> 
    <field name="country">India</field> 
    <field name="state">mumbai</field> 
    <field name="state">Nevada</field> 
  </doc> 
</add>
pi.
  • 21,112
  • 8
  • 38
  • 59
Jayendra
  • 52,349
  • 4
  • 80
  • 90
  • Could you pelase check if my document data is correct ? 4 General Rules Chemistry Physics – 89n3ur0n Aug 30 '13 at 13:47
  • you need not have the data to change now. added example. – Jayendra Aug 30 '13 at 18:31
  • I wanted to have something like-http://wiki.apache.org/solr/HierarchicalFaceting#A.27facet.prefix.27__Based_Drill_Down – 89n3ur0n Aug 31 '13 at 03:51
  • Thanks a lot Jayendra. I also posted my document which Srikanth has edited above to solr and also made some configurations in schema to recognize 0/NonFic and others. Facet Pivot and Field queries seem to be working now. Will work more on it and come back. Are we sure we do not need to make any configurations in solrconfig to tell prefix? – 89n3ur0n Aug 31 '13 at 04:19