Can't you use the PathHierarchyTokenizerFactory mentioned on that page?
I think it is called descendent-path in the default schema. Won't that
get you what you want?

  UK/London/Covent Garden
becomes
  UK
  UK/London
  UK/London/Covent Garden

and 
  India/Maharastra/Pune/Dapodi
becomes
  India
  India/Maharastra
  India/Maharastra/Pune
  India/Maharastra/Pune/Dapodi

These fields can be multivalued.

Upayavira

On Wed, May 15, 2013, at 12:29 PM, varsha.yadav wrote:
> Hi
> 
> I go through that but i want to index multiple location in single 
> document and a single location have multiple feature/attribute like 
> country,state,district etc. I want  Index and want hierarchical facet 
> result on facet pivot query. One more thing , my document varies may 
> have single ,two ,three.. any number of location.
> 
> 
> On 05/15/2013 03:55 PM, Upayavira wrote:
> > http://wiki.apache.org/solr/HierarchicalFaceting
> >
> > On Wed, May 15, 2013, at 09:44 AM, varsha.yadav wrote:
> >> Hi Everyone,
> >>
> >> I am working on Hierarchical Faceting. I am indexing location of
> >> document with their state and district.
> >>    I would like to find counts of every country with state count and
> >> district count. I found facet pivot working well to give me count if i
> >> use single valued fields like
> >> -------
> >> <doc>
> >> <str name="country">india</str>
> >> <str name="state">maharashtra</str>
> >> </doc>
> >> <doc>
> >> <str name="country">india</str>
> >> <str name="state">gujrat</str>
> >> </doc>
> >> <doc>
> >> <str name="country">india</str>
> >> <str name="district">Faridabad</str>
> >> <str name="state">Haryana</str>
> >> </doc>
> >> <doc>
> >> <str name="country">china</str>
> >> <str name="district">foshan</str>
> >> <str name="state">guangdong</str>
> >> </doc>
> >> ------------
> >> I found results that is fine :
> >> <arr name="country,state,district,event">
> >> <lst>
> >> <str name="field">country</str>
> >> <str name="value">india</str>
> >> <int name="count">1</int>
> >> <arr name="pivot">
> >>
> >> <lst>
> >> <str name="field">state</str>
> >> <str name="value">maharashtra</str>
> >> <int name="count">1</int>
> >> <arr name="pivot"></arr>
> >> <lst>
> >> <str name="field">state</str>
> >> <str name="value">Haryana</str>
> >> <int name="count">1</int>
> >> <arr name="pivot">
> >> <lst>
> >> <str name="field">district</str>
> >> <str name="value">Faridabad</str>
> >> <int name="count">1</int>
> >> </lst>
> >> </arr>
> >> </lst>
> >> </arr>
> >> </lst>
> >> </arr>
> >> </lst>
> >> <lst>
> >> <str name="field">country</str>
> >> <str name="value">china</str>
> >> <int name="count">1</int>
> >> <arr name="pivot">
> >> <lst>
> >> <str name="field">state</str>
> >> ....
> >> </lst>
> >> </arr>
> >>
> >>
> >> But if my document have multiple location like :
> >>
> >> <doc>
> >> <arr name="location">
> >> <str>japan|JAPAN|null|</str>
> >> <str>
> >> brisbane|Australia|Queensland
> >> </str>
> >> <str>
> >> afghanistan|AFGHANISTAN|null
> >> </str>
> >> </arr>
> >> </doc>
> >>
> >> <doc>
> >> <arr name="location">
> >> <str>
> >> afghanistan|AFGHANISTAN|null
> >> </str>
> >> </arr>
> >> </doc>
> >>
> >> <doc>
> >> <arr name="location">
> >> <str>
> >> brisbane|Australia|Queensland
> >> </str>
> >> </str>
> >> </arr>
> >> </doc>
> >>
> >>
> >> Can anyone tell , me how should i put data in solr index to get
> >> hierarical data.
> >>
> >> Thanks
> >> Varsha
> 
> 
> -- 
> Thanks & Regards
> Varsha
> 

Reply via email to