RE: Hierarchical faceting

2014-11-18 Thread Appaneravanda, Rashmy
Thanks Evan and Jason.

I'll probably go with the approach that Evan suggested. This allows the UI to 
change and display full hierarchy if required in future.


-Original Message-
From: Evan Pease [mailto:evancpe...@gmail.com] 
Sent: Tuesday, November 18, 2014 12:41 AM
To: solr-user@lucene.apache.org
Subject: Re: Hierarchical faceting

>I'm looking to see if Solr has any in-built tokenizer that splits the
tokens
>and prepends with the depth information. I'd like to avoid building 
>depth information into the filed values if Solr already has something 
>that can be used.

So the goal is to find out the level of the tree for each category? You could 
determine this in the UI by splitting the category facet value string by the 
separator.

As you're aware, when you query a field indexed using 
solr.PathHierarchyTokenizerFactory
you still get the full path category path back as a facet value.

For example, if a user navigates to "Phy":
fq={!term f=category}NonFic/Sci/Phy

The facet values that are returned will look like this (made up counts):


  10
  
wrote:

> I realize you want to avoid putting depth details into the field 
> values, but something has to imply the depth.  So with that in mind, 
> here is another approach (with the assumption that you are chasing 
> down a single branch of a tree (and all its subbranch offshoots)),
>
> Use dynamic fields
> Step from one level to the next with a simple increment Build the 
> facet for the next level on the call The UI needs only know the 
> current level
>
> This would possibly be as so:
>
> step_fieldname_n
>
> With a dynamic field configuration of:
>
> step_*
>
> The content of the step_fieldname_n field would either be the strong 
> of the field value or the delimited path of the current level (as 
> suited to taste).  Either way, most likely a fieldType of String (or 
> some variation
> thereof)
>
> The UI would then call:
>
> facet.field=step_fieldname_n+1
>
> And the UI would need to be aware to carry the n+1 into the fq link
> verbiage:
>
> fq=step_fieldname_n+1:facetvalue
>
> The trick of all of this is that you must build your index with the 
> depth of your hierarchy in mind to place the values into the suitable fields.
> You could, of course, write an UpdateProcessor to accomplish this if 
> that seems fitting.
>
> Jason
>
> > On Nov 17, 2014, at 12:22 PM, Alexandre Rafalovitch 
> > 
> wrote:
> >
> > You might be able to stick in a couple of 
> > PatternReplaceFilterFactory in a row with regular expressions to catch 
> > different levels.
> >
> > Something like:
> >
> >  > pattern="^[^0-9][^/]+/[^/]/[^/]+$" replacement="2$0" />  > class="solr.PatternReplaceFilterFactory"
> > pattern="^[^0-9][^/]+/[^/]$" replacement="1$0" /> ...
> >
> > I did not test this, you may need to escape some thing or put 
> > explicit groups in there.
> >
> > Regards,
> >   Alex.
> > P.s.
> http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/analys
> is/pattern/PatternReplaceFilterFactory.html
> >
> > Personal: http://www.outerthoughts.com/ and @arafalov Solr resources 
> > and newsletter: http://www.solr-start.com/ and @solrstart Solr 
> > popularizers community: https://www.linkedin.com/groups?gid=6713853
> >
> >
> > On 17 November 2014 15:01, rashmy1 
> > 
> wrote:
> >> Hi Alexandre,
> >> Yes, I've read this post and that's the 'Option1' listed in my 
> >> initial
> post.
> >>
> >> I'm looking to see if Solr has any in-built tokenizer that splits 
> >> the
> tokens
> >> and prepends with the depth information. I'd like to avoid building
> depth
> >> information into the filed values if Solr already has something 
> >> that
> can be
> >> used.
> >>
> >> Thanks!
> >>
> >>
> >>
> >> --
> >> View this message in context:
> http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263p416
> 9536.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


Re: Hierarchical faceting

2014-11-17 Thread Evan Pease
>I'm looking to see if Solr has any in-built tokenizer that splits the
tokens
>and prepends with the depth information. I'd like to avoid building depth
>information into the filed values if Solr already has something that can be
>used.

So the goal is to find out the level of the tree for each category? You
could determine this in the UI by splitting the category facet value string
by the separator.

As you're aware, when you query a field indexed using
solr.PathHierarchyTokenizerFactory
you still get the full path category path back as a facet value.

For example, if a user navigates to "Phy":
fq={!term f=category}NonFic/Sci/Phy

The facet values that are returned will look like this (made up counts):


  10
  
wrote:

> I realize you want to avoid putting depth details into the field values,
> but something has to imply the depth.  So with that in mind, here is
> another approach (with the assumption that you are chasing down a single
> branch of a tree (and all its subbranch offshoots)),
>
> Use dynamic fields
> Step from one level to the next with a simple increment
> Build the facet for the next level on the call
> The UI needs only know the current level
>
> This would possibly be as so:
>
> step_fieldname_n
>
> With a dynamic field configuration of:
>
> step_*
>
> The content of the step_fieldname_n field would either be the strong of
> the field value or the delimited path of the current level (as suited to
> taste).  Either way, most likely a fieldType of String (or some variation
> thereof)
>
> The UI would then call:
>
> facet.field=step_fieldname_n+1
>
> And the UI would need to be aware to carry the n+1 into the fq link
> verbiage:
>
> fq=step_fieldname_n+1:facetvalue
>
> The trick of all of this is that you must build your index with the depth
> of your hierarchy in mind to place the values into the suitable fields.
> You could, of course, write an UpdateProcessor to accomplish this if that
> seems fitting.
>
> Jason
>
> > On Nov 17, 2014, at 12:22 PM, Alexandre Rafalovitch 
> wrote:
> >
> > You might be able to stick in a couple of PatternReplaceFilterFactory
> > in a row with regular expressions to catch different levels.
> >
> > Something like:
> >
> >  > pattern="^[^0-9][^/]+/[^/]/[^/]+$" replacement="2$0" />
> >  > pattern="^[^0-9][^/]+/[^/]$" replacement="1$0" />
> > ...
> >
> > I did not test this, you may need to escape some thing or put explicit
> > groups in there.
> >
> > Regards,
> >   Alex.
> > P.s.
> http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/analysis/pattern/PatternReplaceFilterFactory.html
> >
> > Personal: http://www.outerthoughts.com/ and @arafalov
> > Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
> > Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
> >
> >
> > On 17 November 2014 15:01, rashmy1 
> wrote:
> >> Hi Alexandre,
> >> Yes, I've read this post and that's the 'Option1' listed in my initial
> post.
> >>
> >> I'm looking to see if Solr has any in-built tokenizer that splits the
> tokens
> >> and prepends with the depth information. I'd like to avoid building
> depth
> >> information into the filed values if Solr already has something that
> can be
> >> used.
> >>
> >> Thanks!
> >>
> >>
> >>
> >> --
> >> View this message in context:
> http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263p4169536.html
> >> Sent from the Solr - User mailing list archive at Nabble.com.
>
>


Re: Hierarchical faceting

2014-11-17 Thread Jason Hellman
I realize you want to avoid putting depth details into the field values, but 
something has to imply the depth.  So with that in mind, here is another 
approach (with the assumption that you are chasing down a single branch of a 
tree (and all its subbranch offshoots)),

Use dynamic fields
Step from one level to the next with a simple increment
Build the facet for the next level on the call
The UI needs only know the current level

This would possibly be as so:

step_fieldname_n

With a dynamic field configuration of:

step_*

The content of the step_fieldname_n field would either be the strong of the 
field value or the delimited path of the current level (as suited to taste).  
Either way, most likely a fieldType of String (or some variation thereof)

The UI would then call:

facet.field=step_fieldname_n+1

And the UI would need to be aware to carry the n+1 into the fq link verbiage:

fq=step_fieldname_n+1:facetvalue

The trick of all of this is that you must build your index with the depth of 
your hierarchy in mind to place the values into the suitable fields.  You 
could, of course, write an UpdateProcessor to accomplish this if that seems 
fitting.

Jason

> On Nov 17, 2014, at 12:22 PM, Alexandre Rafalovitch  
> wrote:
> 
> You might be able to stick in a couple of PatternReplaceFilterFactory
> in a row with regular expressions to catch different levels.
> 
> Something like:
> 
>  pattern="^[^0-9][^/]+/[^/]/[^/]+$" replacement="2$0" />
>  pattern="^[^0-9][^/]+/[^/]$" replacement="1$0" />
> ...
> 
> I did not test this, you may need to escape some thing or put explicit
> groups in there.
> 
> Regards,
>   Alex.
> P.s. 
> http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/analysis/pattern/PatternReplaceFilterFactory.html
> 
> Personal: http://www.outerthoughts.com/ and @arafalov
> Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
> Solr popularizers community: https://www.linkedin.com/groups?gid=6713853
> 
> 
> On 17 November 2014 15:01, rashmy1  wrote:
>> Hi Alexandre,
>> Yes, I've read this post and that's the 'Option1' listed in my initial post.
>> 
>> I'm looking to see if Solr has any in-built tokenizer that splits the tokens
>> and prepends with the depth information. I'd like to avoid building depth
>> information into the filed values if Solr already has something that can be
>> used.
>> 
>> Thanks!
>> 
>> 
>> 
>> --
>> View this message in context: 
>> http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263p4169536.html
>> Sent from the Solr - User mailing list archive at Nabble.com.



Re: Hierarchical faceting

2014-11-17 Thread Alexandre Rafalovitch
You might be able to stick in a couple of PatternReplaceFilterFactory
in a row with regular expressions to catch different levels.

Something like:



...

I did not test this, you may need to escape some thing or put explicit
groups in there.

Regards,
   Alex.
P.s. 
http://www.solr-start.com/javadoc/solr-lucene/org/apache/lucene/analysis/pattern/PatternReplaceFilterFactory.html

Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 17 November 2014 15:01, rashmy1  wrote:
> Hi Alexandre,
> Yes, I've read this post and that's the 'Option1' listed in my initial post.
>
> I'm looking to see if Solr has any in-built tokenizer that splits the tokens
> and prepends with the depth information. I'd like to avoid building depth
> information into the filed values if Solr already has something that can be
> used.
>
> Thanks!
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263p4169536.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Hierarchical faceting

2014-11-17 Thread rashmy1
Hi Alexandre,
Yes, I've read this post and that's the 'Option1' listed in my initial post.

I'm looking to see if Solr has any in-built tokenizer that splits the tokens
and prepends with the depth information. I'd like to avoid building depth
information into the filed values if Solr already has something that can be
used.

Thanks!



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263p4169536.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Hierarchical faceting

2014-11-16 Thread Alexandre Rafalovitch
Would this approach be an answer?
https://lucidworks.com/blog/easy-hierarchical-faceting-and-display-with-solr-and-jquery-and-a-tiny-bit-of-python/

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 16 November 2014 20:36, rashmy1  wrote:
> Thank you Evan and Oleg.
>
> This is exactly what I had implemented (Option 2).
> My issue is
>
> Evan Pease wrote
>> Then, in your Solr query, you can simply add:
>>
>> &facet=true
>> &facet.field=category
>>
>> You should see a facet that contains each level of the taxonomy with
>> counts.
>
> As you mentioned, we get each level of the taxonomy while I'd like to do
> drill down query.
>
> For example, if the Solr query was:
> &facet=true
> &facet.field=category
>
> My intention is to get just the first level as results:
> NonFic (8)
> Fic (3)
>
> Then if user clicks on 'NonFic' in UI, we want to fetch only the next
> immediate level:
> NonFic
> Hist (2)
> Sci (6)
>
> Then if user clicks on 'Sci' in UI, we want to fetch only the next immediate
> level:
> NonFic
> Sci
> Phy(4)
> Chem(1)
> Math(1)
>
> Myabe I can still use PathHierarchyTokenizer, but could you let me know how
> to form my facet query to fetch the results one level at a time.
>
> Thanks!
>
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263p4169413.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Hierarchical faceting

2014-11-16 Thread rashmy1
Thank you Evan and Oleg.

This is exactly what I had implemented (Option 2).
My issue is 

Evan Pease wrote
> Then, in your Solr query, you can simply add:
> 
> &facet=true
> &facet.field=category
> 
> You should see a facet that contains each level of the taxonomy with
> counts.

As you mentioned, we get each level of the taxonomy while I'd like to do
drill down query.

For example, if the Solr query was:
&facet=true
&facet.field=category

My intention is to get just the first level as results:
NonFic (8)
Fic (3)

Then if user clicks on 'NonFic' in UI, we want to fetch only the next
immediate level:
NonFic
Hist (2)
Sci (6)

Then if user clicks on 'Sci' in UI, we want to fetch only the next immediate
level:
NonFic
Sci
Phy(4)
Chem(1)
Math(1)

Myabe I can still use PathHierarchyTokenizer, but could you let me know how
to form my facet query to fetch the results one level at a time.

Thanks!




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263p4169413.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Hierarchical faceting

2014-11-14 Thread Evan Pease
Hi Rashmi,

Here is some more details on how to use PathHierarchyTokenizer that Oleg
provided the link to.

If this is your document:

> *Sample document*
> 
> name=Pbook1
> category=NonFic/Sci/Phy/Quantum
> author=ABC
> price=20.00
> 

Then, in your schema.xml:



  

  
  

  


Then, in your Solr query, you can simply add:

&facet=true
&facet.field=category

You should see a facet that contains each level of the taxonomy with counts.

To navigate the taxonomy you add filter queries using the part of the path
you want narrow the results down to (values from the category facet).

So, for example a user clicks on "NonFic"

&facet=true
&facet.field=category
&fq={!term f=category}NonFic

Then "NonFic/Sci"

&fq={!term f=category}NonFic/Sci

Then "NonFic/Sci/Phy"

&fq={!term f=category}NonFic/Sci/Phy

etc..

If you only want to display the leaf level category and indent child
categories you can easily do this in your UI by splitting the facet value
on your separator, "/" in this case.


Thanks,
Evan



On Nov 14, 2014 8:06 PM, "Oleg Savrasov"  wrote:

> Hi Rashmi,
>
> I believe you are looking for PathHierarchyTokenizer,
> see
>
> https://lucene.apache.org/core/4_0_0/analyzers-common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html
>
> Oleg
>
> 2014-11-14 17:53 GMT-05:00 rashmy1 :
>
> > Hello,
> > I'm trying to setup Solr for fetching hierarchical facets.
> > Please advice which of the below approaches should be followed for my
> > scenario.
> > *Scenario:
> > *
> > NonFic
> > Hist
> > HistBook1
> > HistBook2
> > Sci
> > Phy
> > Quantum
> > Pbook1
> > Pbook2
> > Thermodynamics
> > Pbook3
> > Pbook4
> > Chem
> > Cbook1
> > Math
> > Mbook1
> > Fic
> > Mystery
> > Mybook1
> > Childrens
> > Chbook1
> > Chbook2
> >
> > *Sample document*
> > 
> > name=Pbook1
> > category=NonFic/Sci/Phy/Quantum
> > author=ABC
> > price=20.00
> > 
> >
> > *Requirements:*
> > -Show drill down facets
> > -If user searched for "*", the initial set of facets to be shown are
> > 'NonFic' and 'Fic'
> > -If user selects facet 'NonFic', we then show the facets 'Hist' and 'Sci'
> > only.
> >
> > *Option1:*
> > /Solr schema:/
> >  > stored="true" type="string"/>
> > /Document supplied for indexing:/
> > 
> > name=Pbook1
> > category=0/NonFic
> > category=1/NonFic/Sci
> > category=2/NonFic/Sci/Phy
> > category=3/NonFic/Sci/Phy/Quantum
> > category=0/Other (a book can belong to multiple categories)
> > author=ABC
> > price=20.00
> > 
> > With Option2, we can do a drill down facet query.
> > For example, if we give facet.prefix=NonFic/Sci/, the facet results are:
> > NonFic/Sci/Phy
> > NonFic/Sci/Chem
> > NonFic/Sci/Math
> > The only issue is that I have to take care of generating all possible
> path
> > information for 'category'
> >
> > *Option2:*
> > /Solr schema:/
> > 
> >   
> >  > delimiter="/"/>
> >   
> > 
> >  > stored="true" type="path"/>
> > /Document supplied for indexing:/
> > 
> > name=Pbook1
> > category=NonFic/Sci/Phy/Quantum
> > author=ABC
> > price=20.00
> > 
> > With Option2, we can do facet query but it returns all possible
> combination
> > of paths.
> > For example, if we give facet.prefix=Fic, the facet results are:
> > Fic (3)
> > Fic/Mystery (1)
> > Fic/Childrens (2)
> >
> >
> > I'm looking to supply a doc with just a single entry (like
> > 'category=NonFic/Sci/Phy/Quantum' ) and be able to do a drill down query.
> > Is
> > there some existing Solr tokernizer which takes care of generating all
> > possibly combinations which indexing instead of having to generating them
> > as
> > part of  creation?
> >
> > Thanks
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> > http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
>


Re: Hierarchical faceting

2014-11-14 Thread Oleg Savrasov
Hi Rashmi,

I believe you are looking for PathHierarchyTokenizer,
see
https://lucene.apache.org/core/4_0_0/analyzers-common/org/apache/lucene/analysis/path/PathHierarchyTokenizer.html

Oleg

2014-11-14 17:53 GMT-05:00 rashmy1 :

> Hello,
> I'm trying to setup Solr for fetching hierarchical facets.
> Please advice which of the below approaches should be followed for my
> scenario.
> *Scenario:
> *
> NonFic
> Hist
> HistBook1
> HistBook2
> Sci
> Phy
> Quantum
> Pbook1
> Pbook2
> Thermodynamics
> Pbook3
> Pbook4
> Chem
> Cbook1
> Math
> Mbook1
> Fic
> Mystery
> Mybook1
> Childrens
> Chbook1
> Chbook2
>
> *Sample document*
> 
> name=Pbook1
> category=NonFic/Sci/Phy/Quantum
> author=ABC
> price=20.00
> 
>
> *Requirements:*
> -Show drill down facets
> -If user searched for "*", the initial set of facets to be shown are
> 'NonFic' and 'Fic'
> -If user selects facet 'NonFic', we then show the facets 'Hist' and 'Sci'
> only.
>
> *Option1:*
> /Solr schema:/
>  stored="true" type="string"/>
> /Document supplied for indexing:/
> 
> name=Pbook1
> category=0/NonFic
> category=1/NonFic/Sci
> category=2/NonFic/Sci/Phy
> category=3/NonFic/Sci/Phy/Quantum
> category=0/Other (a book can belong to multiple categories)
> author=ABC
> price=20.00
> 
> With Option2, we can do a drill down facet query.
> For example, if we give facet.prefix=NonFic/Sci/, the facet results are:
> NonFic/Sci/Phy
> NonFic/Sci/Chem
> NonFic/Sci/Math
> The only issue is that I have to take care of generating all possible path
> information for 'category'
>
> *Option2:*
> /Solr schema:/
> 
>   
>  delimiter="/"/>
>   
> 
>  stored="true" type="path"/>
> /Document supplied for indexing:/
> 
> name=Pbook1
> category=NonFic/Sci/Phy/Quantum
> author=ABC
> price=20.00
> 
> With Option2, we can do facet query but it returns all possible combination
> of paths.
> For example, if we give facet.prefix=Fic, the facet results are:
> Fic (3)
> Fic/Mystery (1)
> Fic/Childrens (2)
>
>
> I'm looking to supply a doc with just a single entry (like
> 'category=NonFic/Sci/Phy/Quantum' ) and be able to do a drill down query.
> Is
> there some existing Solr tokernizer which takes care of generating all
> possibly combinations which indexing instead of having to generating them
> as
> part of  creation?
>
> Thanks
>
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Hierarchical-faceting-tp4169263.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


Re: Hierarchical Faceting

2013-05-16 Thread varsha.yadav

Hi,

Thanks Upayavira . But still i am not getting results well.
I have been followinghttp://wiki.apache.org/solr/HierarchicalFaceting
I have hierarchical data for facet . Some documents also have multiple 
hierarchy. like :

Doc#1 London > UK > 51.5
Doc#2 UK >54.0
Doc#3 Indiana > United States > 40.0, London >UK>51.5
Doc#4 United States > 39.7, Washington > United States > 38.8

what can be optimal schema for indexing this data so that i get 
following result by solr query :
1) i want to retrieve hierarchical data count by facet pivot query . ex: 
facet.pivot=country,state
2) I want Lat values wrt every document in query output.ex: Doc#3 
40.0,51.5 . Doc#2 54.0
3) I get direct search query like country:"United states" . state 
:"Washington"


 I think through this i am able to express my requirement along with data .
Please tell me how can i put data index and retreive through query .
I check out solution which you provided me about 
PathHierarchyTokenizerFactory. But along with hierarachy i have to put 
data with name State,district,lat,lon etc. So that i can also access 
direct query on fields.


Thanks
Varsha

On 05/15/2013 10:32 PM, Upayavira wrote:

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
---

india
maharashtra


india
gujrat


india
Faridabad
Haryana


china
foshan
guangdong


I found results that is fine :


country
india
1



state
maharashtra
1


state
Haryana
1


district
Faridabad
1








country
china
1


state





But if my document have multiple location like :



japan|JAPAN|null|

brisbane|Australia|Queensland


afghanistan|AFGHANISTAN|null







afghanistan|AFGHANISTAN|null







brisbane|Australia|Queensland






Can anyone tell , me how should i put data in solr index to get
hierarical data.

Thanks
Varsha


--
Thanks & Regards
Varsha




--
Thanks & Regards
Varsha



Re: Hierarchical Faceting

2013-05-15 Thread Chris Hostetter

: Subject: Hierarchical Faceting
: References:
: <15062_1368600769_zzi0n0aykpk6h.00_519330be.7000...@uni-bielefeld.de>
: In-Reply-To:
: <15062_1368600769_zzi0n0aykpk6h.00_519330be.7000...@uni-bielefeld.de>

https://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.



-Hoss


Re: Hierarchical Faceting

2013-05-15 Thread Upayavira
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
> >> ---
> >> 
> >> india
> >> maharashtra
> >> 
> >> 
> >> india
> >> gujrat
> >> 
> >> 
> >> india
> >> Faridabad
> >> Haryana
> >> 
> >> 
> >> china
> >> foshan
> >> guangdong
> >> 
> >> 
> >> I found results that is fine :
> >> 
> >> 
> >> country
> >> india
> >> 1
> >> 
> >>
> >> 
> >> state
> >> maharashtra
> >> 1
> >> 
> >> 
> >> state
> >> Haryana
> >> 1
> >> 
> >> 
> >> district
> >> Faridabad
> >> 1
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> country
> >> china
> >> 1
> >> 
> >> 
> >> state
> >> 
> >> 
> >> 
> >>
> >>
> >> But if my document have multiple location like :
> >>
> >> 
> >> 
> >> japan|JAPAN|null|
> >> 
> >> brisbane|Australia|Queensland
> >> 
> >> 
> >> afghanistan|AFGHANISTAN|null
> >> 
> >> 
> >> 
> >>
> >> 
> >> 
> >> 
> >> afghanistan|AFGHANISTAN|null
> >> 
> >> 
> >> 
> >>
> >> 
> >> 
> >> 
> >> brisbane|Australia|Queensland
> >> 
> >> 
> >> 
> >> 
> >>
> >>
> >> Can anyone tell , me how should i put data in solr index to get
> >> hierarical data.
> >>
> >> Thanks
> >> Varsha
> 
> 
> -- 
> Thanks & Regards
> Varsha
> 


Re: Hierarchical Faceting

2013-05-15 Thread varsha.yadav

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
---

india
maharashtra


india
gujrat


india
Faridabad
Haryana


china
foshan
guangdong


I found results that is fine :


country
india
1



state
maharashtra
1


state
Haryana
1


district
Faridabad
1








country
china
1


state





But if my document have multiple location like :



japan|JAPAN|null|

brisbane|Australia|Queensland


afghanistan|AFGHANISTAN|null







afghanistan|AFGHANISTAN|null







brisbane|Australia|Queensland






Can anyone tell , me how should i put data in solr index to get
hierarical data.

Thanks
Varsha



--
Thanks & Regards
Varsha



Re: Hierarchical Faceting

2013-05-15 Thread Upayavira
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
> ---
> 
> india
> maharashtra
> 
> 
> india
> gujrat
> 
> 
> india
> Faridabad
> Haryana
> 
> 
> china
> foshan
> guangdong
> 
> 
> I found results that is fine :
> 
> 
> country
> india
> 1
> 
> 
> 
> state
> maharashtra
> 1
> 
> 
> state
> Haryana
> 1
> 
> 
> district
> Faridabad
> 1
> 
> 
> 
> 
> 
> 
> 
> 
> country
> china
> 1
> 
> 
> state
> 
> 
> 
> 
> 
> But if my document have multiple location like :
> 
> 
> 
> japan|JAPAN|null|
> 
> brisbane|Australia|Queensland
> 
> 
> afghanistan|AFGHANISTAN|null
> 
> 
> 
> 
> 
> 
> 
> afghanistan|AFGHANISTAN|null
> 
> 
> 
> 
> 
> 
> 
> brisbane|Australia|Queensland
> 
> 
> 
> 
> 
> 
> Can anyone tell , me how should i put data in solr index to get 
> hierarical data.
> 
> Thanks
> Varsha


Re: Hierarchical faceting and filter query exclusions

2012-08-30 Thread Nicholas Swarr
Tanguy, thanks for the confirmation!  We found the same issue with 
facet.missing parameter as well. 

Sent from my iPad

On Aug 30, 2012, at 10:18 AM, "Tanguy Moal"  wrote:

> You are correct, it doesn't work :
> 
> Queries like :
> http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot={!ex=a_tag}field1,field2&facet.limit=5&rows=0&fq={!tag=a_tag}field3:"filter";
> result in the following response :
> 
> 
> 
> 
>  400
>  1
>  
>   on
>   *:*
>   5
>   {!ex=a_tag}field1,field2
>   {!tag=a_tag}field3:"filter"
>   0
>  
> 
> 
> 
>  undefined field: "{!ex=a_tag}field1"
>  400
> 
> 
> 
> Seems like that face.pivot didn't expect the {!ex } local params and died
> horribly (not even fully repeated: the ',field2' part is missing in the
> error message)
> 
> Don't know if that's supposed to be supported.
> 
> I've got another funny one : facet pivoting doesn't work when missing
> values are faceted :
> Queries like :
> http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot=field1,field2&facet.limit=5&facet.missing=on&rows=0result
> in the following error :
> 
> 
> 
> 
>  500
>  3
>  
>   on
>   on
>   on
>   *:*
>   5
>   field1,field2
>   0
>  
> 
> 
> 
>  java.lang.NullPointerException at
> org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:376) at
> org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:109)
> at
> org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:126)
> at
> org.apache.solr.handler.component.PivotFacetHelper.process(PivotFacetHelper.java:85)
> at
> org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:90)
> at
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:206)
> at
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
> at
> org.apache.solr.core.SolrCore.execute(SolrCore.java:1656) at
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:454)
> at
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:275)
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
> at
> org.eclipse.jetty.server.Server.handle(Server.java:349) at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
> at
> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
> at
> java.lang.Thread.run(Thread.java:722)
>  
>  500
> 
> 
> 
> Here also, I don't know if that's supposed to be supported, but it
> obviously isn't.
> Worst, it results in an horrible 500 response with a stack instead of a
> clean 400 + message : "sorry, facet.missing can't be turned on with
> facet.pivot. Search again better :)"
> 
> Regards,
> 
> --
> Tanguy
> 
> 2012/8/30 Nicholas Swarr 
> 
>> Thanks, Erick. I have looked at the documentation at length and done a
>> number of tests. I don't see a way to do exclusions with hierarchical
>> facets.
>> 
>> Thanks,
>> Nick
>> 
>> 
>> On Aug 29, 2012, at 9:50 PM, "Erick Erickson" 
>> wrote:
>> 
>>> See "Tagging and excluding filters" here:
>>> http://lucidworks.lucidimagination.com/display/solr/Faceting
>>> 
>>> 
>>> Best
>>> Erick
>>> 
>>> 
>>> On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr 
>> wrote:

Re: Hierarchical faceting and filter query exclusions

2012-08-30 Thread Tanguy Moal
You are correct, it doesn't work :

Queries like :
http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot={!ex=a_tag}field1,field2&facet.limit=5&rows=0&fq={!tag=a_tag}field3:"filter";
result in the following response :



 
  400
  1
  
   on
   *:*
   5
   {!ex=a_tag}field1,field2
   {!tag=a_tag}field3:"filter"
   0
  
 
 
 
  undefined field: "{!ex=a_tag}field1"
  400
 


Seems like that face.pivot didn't expect the {!ex } local params and died
horribly (not even fully repeated: the ',field2' part is missing in the
error message)

Don't know if that's supposed to be supported.

I've got another funny one : facet pivoting doesn't work when missing
values are faceted :
Queries like :
http://localhost:8983/solr/collection1/select?q=*:*&facet=on&facet.pivot=field1,field2&facet.limit=5&facet.missing=on&rows=0result
in the following error :



 
  500
  3
  
   on
   on
   on
   *:*
   5
   field1,field2
   0
  
 
 
 
  java.lang.NullPointerException at
org.apache.solr.schema.FieldType.readableToIndexed(FieldType.java:376) at
org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:109)
at
org.apache.solr.handler.component.PivotFacetHelper.doPivots(PivotFacetHelper.java:126)
at
org.apache.solr.handler.component.PivotFacetHelper.process(PivotFacetHelper.java:85)
at
org.apache.solr.handler.component.FacetComponent.process(FacetComponent.java:90)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:206)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at
org.apache.solr.core.SolrCore.execute(SolrCore.java:1656) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:454)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:275)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at
org.eclipse.jetty.server.Server.handle(Server.java:349) at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at
org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at
java.lang.Thread.run(Thread.java:722)
  
  500
 


Here also, I don't know if that's supposed to be supported, but it
obviously isn't.
Worst, it results in an horrible 500 response with a stack instead of a
clean 400 + message : "sorry, facet.missing can't be turned on with
facet.pivot. Search again better :)"

Regards,

--
Tanguy

2012/8/30 Nicholas Swarr 

> Thanks, Erick. I have looked at the documentation at length and done a
> number of tests. I don't see a way to do exclusions with hierarchical
> facets.
>
> Thanks,
> Nick
>
>
> On Aug 29, 2012, at 9:50 PM, "Erick Erickson" 
> wrote:
>
> > See "Tagging and excluding filters" here:
> > http://lucidworks.lucidimagination.com/display/solr/Faceting
> >
> >
> > Best
> > Erick
> >
> >
> > On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr 
> wrote:
> >> We're using Solr 4.0 Beta, testing the hierarchical faceting support to
> see if it's a good fit to facet on taxonomies.  One issue we've encountered
> is that we can't apply filter exclusions to the hierarchical facets so as
> to preserve facet count with multi-select.  I haven't been able to locate
> or otherwise determine if there's documentation that would outline how this
> is done.  We've tried a few things with local 

Re: Hierarchical faceting and filter query exclusions

2012-08-30 Thread Nicholas Swarr
Thanks, Erick. I have looked at the documentation at length and done a number 
of tests. I don't see a way to do exclusions with hierarchical facets.  

Thanks,
Nick


On Aug 29, 2012, at 9:50 PM, "Erick Erickson"  wrote:

> See "Tagging and excluding filters" here:
> http://lucidworks.lucidimagination.com/display/solr/Faceting
> 
> 
> Best
> Erick
> 
> 
> On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr  wrote:
>> We're using Solr 4.0 Beta, testing the hierarchical faceting support to see 
>> if it's a good fit to facet on taxonomies.  One issue we've encountered is 
>> that we can't apply filter exclusions to the hierarchical facets so as to 
>> preserve facet count with multi-select.  I haven't been able to locate or 
>> otherwise determine if there's documentation that would outline how this is 
>> done.  We've tried a few things with local params but it appears those 
>> aren't parsed with the facet.pivot argument.  I found this ticket related to 
>> that:
>> 
>> https://issues.apache.org/jira/browse/SOLR-2255
>> 
>> Could anyone offer some insight or guidance on this?
>> 
>> Thanks,
>> Nick
>> This e-mail message, and any attachments, is intended only for the use of 
>> the individual or entity identified in the alias address of this message and 
>> may contain information that is confidential, privileged and subject to 
>> legal restrictions and penalties regarding its unauthorized disclosure and 
>> use. Any unauthorized review, copying, disclosure, use or distribution is 
>> strictly prohibited. If you have received this e-mail message in error, 
>> please notify the sender immediately by reply e-mail and delete this 
>> message, and any attachments, from your system. Thank you.
>> 
>> 
> 

This e-mail message, and any attachments, is intended only for the use of the 
individual or entity identified in the alias address of this message and may 
contain information that is confidential, privileged and subject to legal 
restrictions and penalties regarding its unauthorized disclosure and use. Any 
unauthorized review, copying, disclosure, use or distribution is strictly 
prohibited. If you have received this e-mail message in error, please notify 
the sender immediately by reply e-mail and delete this message, and any 
attachments, from your system. Thank you.




Re: Hierarchical faceting and filter query exclusions

2012-08-29 Thread Erick Erickson
See "Tagging and excluding filters" here:
http://lucidworks.lucidimagination.com/display/solr/Faceting


Best
Erick


On Wed, Aug 29, 2012 at 11:44 AM, Nicholas Swarr  wrote:
> We're using Solr 4.0 Beta, testing the hierarchical faceting support to see 
> if it's a good fit to facet on taxonomies.  One issue we've encountered is 
> that we can't apply filter exclusions to the hierarchical facets so as to 
> preserve facet count with multi-select.  I haven't been able to locate or 
> otherwise determine if there's documentation that would outline how this is 
> done.  We've tried a few things with local params but it appears those aren't 
> parsed with the facet.pivot argument.  I found this ticket related to that:
>
> https://issues.apache.org/jira/browse/SOLR-2255
>
> Could anyone offer some insight or guidance on this?
>
> Thanks,
> Nick
> This e-mail message, and any attachments, is intended only for the use of the 
> individual or entity identified in the alias address of this message and may 
> contain information that is confidential, privileged and subject to legal 
> restrictions and penalties regarding its unauthorized disclosure and use. Any 
> unauthorized review, copying, disclosure, use or distribution is strictly 
> prohibited. If you have received this e-mail message in error, please notify 
> the sender immediately by reply e-mail and delete this message, and any 
> attachments, from your system. Thank you.
>
>


Re: hierarchical faceting?

2012-05-01 Thread sam ”
yup.














and ?facet.field=colors_facet



On Mon, Apr 30, 2012 at 9:35 PM, Chris Hostetter
wrote:

>
> : Is there a tokenizer that tokenizes the string as one token?
>
> Using KeywordTokenizer at query time should do whta you want.
>
>
> -Hoss
>


Re: hierarchical faceting?

2012-04-30 Thread Chris Hostetter

: Is there a tokenizer that tokenizes the string as one token?

Using KeywordTokenizer at query time should do whta you want.


-Hoss


Re: hierarchical faceting?

2012-04-18 Thread Charlie Maroto
 The PathHierarchyTokenizerFactory is intended for file path therefore
assumes that all documents should be indexed with all of the paths to the
parent folders but you are trying to use it for a taxonomy so you can't
simply use the PathHierarchyTokenizerFactory.   Use the analysis page (
http://localhost:8983/solr/admin/analysis.jsp) so that you can see what's
happening with the content both at index and query time.

Field  (Type)  text_path
Field value (Index)  red/pink
Field value (Query) red/pink
You'd notice that the result of both is identical, therefore explaining why
both documents are retrieved:

Index Analyzer:
   red
   red/pink
Query Analyzer:
   red
   red/pink

 Carlos

-Original Message-
From: Darren Govoni [mailto:dar...@ontrenet.com]
Sent: Wednesday, April 18, 2012 8:10 AM
To: solr-user@lucene.apache.org
Subject: Re: hierarchical faceting?



Put the parent term in all the child documents at index time and the
re-issue the facet query when you expand the parent using the parent's
term. works perfect.



On Wed, 2012-04-18 at 10:56 -0400, sam ” wrote:

> I have hierarchical colors:

>  stored="true" multiValued="true"/>

> text_path is TextField with PathHierarchyTokenizerFactory as tokenizer.

>

> Given these two documents,

> Doc1: red

> Doc2: red/pink

>

> I want the result to be the following:

> ?fq=red

> ==> Doc1, Doc2

>

> ?fq=red/pink

> ==> Doc2

>

> But, with PathHierarchyTokenizer, Doc1 is included for the query:

> ?fq=red/pink

> ==> Doc1, Doc2

>

> How can I query for hierarchical facets?

> http://wiki.apache.org/solr/HierarchicalFaceting describes facet.prefix..

> But it looks too cumbersome to me.

>

> Is there a simpler way to implement hierarchical facets?


Re: hierarchical faceting?

2012-04-18 Thread Darren Govoni
I don't use any of that stuff in my app, so not sure how it works.

I just manage my taxonomy outside of solr at index time and don't need
any special fields or tokenizers. I use a string field type and insert
the proper field at index time and query it normally. Nothing special
required.

On Wed, 2012-04-18 at 13:00 -0400, sam ” wrote:
> It looks like TextField is the problem.
> 
> This fixed:
>  positionIncrementGap="100">
>   
>delimiter="/"/>
>   
>   
>   
>   
> 
> 
> I am assuming the text_path fields won't include whitespace characters.
> 
> ?q=colors:red/pink
> ==> Doc2   (Doc1, which has colors = red isn't included!)
> 
> 
> Is there a tokenizer that tokenizes the string as one token?
> I tried to extend Tokenizer myself  but it fails:
> public class AsIsTokenizer extends Tokenizer {
> @Override
> public boolean incrementToken() throws IOException {
> return true;//or false;
> }
> }
> 
> 
> On Wed, Apr 18, 2012 at 11:33 AM, sam ”  wrote:
> 
> > Yah, that's exactly what PathHierarchyTokenizer does.
> >  > positionIncrementGap="100">
> >   
> > 
> >   
> > 
> >
> > I think I have a query time tokenizer that tokenizes at /
> >
> > ?q=colors:red
> > ==> Doc1, Doc2
> >
> > ?q=colors:redfoobar
> > ==>
> >
> > ?q=colors:red/foobarasdfoaijao
> > ==> Doc1, Doc2
> >
> >
> >
> >
> > On Wed, Apr 18, 2012 at 11:10 AM, Darren Govoni wrote:
> >
> >> Put the parent term in all the child documents at index time
> >> and the re-issue the facet query when you expand the parent using the
> >> parent's term. works perfect.
> >>
> >> On Wed, 2012-04-18 at 10:56 -0400, sam ” wrote:
> >> > I have hierarchical colors:
> >> >  >> > stored="true" multiValued="true"/>
> >> > text_path is TextField with PathHierarchyTokenizerFactory as tokenizer.
> >> >
> >> > Given these two documents,
> >> > Doc1: red
> >> > Doc2: red/pink
> >> >
> >> > I want the result to be the following:
> >> > ?fq=red
> >> > ==> Doc1, Doc2
> >> >
> >> > ?fq=red/pink
> >> > ==> Doc2
> >> >
> >> > But, with PathHierarchyTokenizer, Doc1 is included for the query:
> >> > ?fq=red/pink
> >> > ==> Doc1, Doc2
> >> >
> >> > How can I query for hierarchical facets?
> >> > http://wiki.apache.org/solr/HierarchicalFaceting describes
> >> facet.prefix..
> >> > But it looks too cumbersome to me.
> >> >
> >> > Is there a simpler way to implement hierarchical facets?
> >>
> >>
> >>
> >




Re: hierarchical faceting?

2012-04-18 Thread sam ”
It looks like TextField is the problem.

This fixed:

  
  
  
  
  
  


I am assuming the text_path fields won't include whitespace characters.

?q=colors:red/pink
==> Doc2   (Doc1, which has colors = red isn't included!)


Is there a tokenizer that tokenizes the string as one token?
I tried to extend Tokenizer myself  but it fails:
public class AsIsTokenizer extends Tokenizer {
@Override
public boolean incrementToken() throws IOException {
return true;//or false;
}
}


On Wed, Apr 18, 2012 at 11:33 AM, sam ”  wrote:

> Yah, that's exactly what PathHierarchyTokenizer does.
>  positionIncrementGap="100">
>   
> 
>   
> 
>
> I think I have a query time tokenizer that tokenizes at /
>
> ?q=colors:red
> ==> Doc1, Doc2
>
> ?q=colors:redfoobar
> ==>
>
> ?q=colors:red/foobarasdfoaijao
> ==> Doc1, Doc2
>
>
>
>
> On Wed, Apr 18, 2012 at 11:10 AM, Darren Govoni wrote:
>
>> Put the parent term in all the child documents at index time
>> and the re-issue the facet query when you expand the parent using the
>> parent's term. works perfect.
>>
>> On Wed, 2012-04-18 at 10:56 -0400, sam ” wrote:
>> > I have hierarchical colors:
>> > > > stored="true" multiValued="true"/>
>> > text_path is TextField with PathHierarchyTokenizerFactory as tokenizer.
>> >
>> > Given these two documents,
>> > Doc1: red
>> > Doc2: red/pink
>> >
>> > I want the result to be the following:
>> > ?fq=red
>> > ==> Doc1, Doc2
>> >
>> > ?fq=red/pink
>> > ==> Doc2
>> >
>> > But, with PathHierarchyTokenizer, Doc1 is included for the query:
>> > ?fq=red/pink
>> > ==> Doc1, Doc2
>> >
>> > How can I query for hierarchical facets?
>> > http://wiki.apache.org/solr/HierarchicalFaceting describes
>> facet.prefix..
>> > But it looks too cumbersome to me.
>> >
>> > Is there a simpler way to implement hierarchical facets?
>>
>>
>>
>


Re: hierarchical faceting?

2012-04-18 Thread sam ”
Yah, that's exactly what PathHierarchyTokenizer does.

  

  


I think I have a query time tokenizer that tokenizes at /

?q=colors:red
==> Doc1, Doc2

?q=colors:redfoobar
==>

?q=colors:red/foobarasdfoaijao
==> Doc1, Doc2



On Wed, Apr 18, 2012 at 11:10 AM, Darren Govoni  wrote:

> Put the parent term in all the child documents at index time
> and the re-issue the facet query when you expand the parent using the
> parent's term. works perfect.
>
> On Wed, 2012-04-18 at 10:56 -0400, sam ” wrote:
> > I have hierarchical colors:
> >  > stored="true" multiValued="true"/>
> > text_path is TextField with PathHierarchyTokenizerFactory as tokenizer.
> >
> > Given these two documents,
> > Doc1: red
> > Doc2: red/pink
> >
> > I want the result to be the following:
> > ?fq=red
> > ==> Doc1, Doc2
> >
> > ?fq=red/pink
> > ==> Doc2
> >
> > But, with PathHierarchyTokenizer, Doc1 is included for the query:
> > ?fq=red/pink
> > ==> Doc1, Doc2
> >
> > How can I query for hierarchical facets?
> > http://wiki.apache.org/solr/HierarchicalFaceting describes
> facet.prefix..
> > But it looks too cumbersome to me.
> >
> > Is there a simpler way to implement hierarchical facets?
>
>
>


Re: hierarchical faceting?

2012-04-18 Thread Darren Govoni
Put the parent term in all the child documents at index time
and the re-issue the facet query when you expand the parent using the
parent's term. works perfect.

On Wed, 2012-04-18 at 10:56 -0400, sam ” wrote:
> I have hierarchical colors:
>  stored="true" multiValued="true"/>
> text_path is TextField with PathHierarchyTokenizerFactory as tokenizer.
> 
> Given these two documents,
> Doc1: red
> Doc2: red/pink
> 
> I want the result to be the following:
> ?fq=red
> ==> Doc1, Doc2
> 
> ?fq=red/pink
> ==> Doc2
> 
> But, with PathHierarchyTokenizer, Doc1 is included for the query:
> ?fq=red/pink
> ==> Doc1, Doc2
> 
> How can I query for hierarchical facets?
> http://wiki.apache.org/solr/HierarchicalFaceting describes facet.prefix..
> But it looks too cumbersome to me.
> 
> Is there a simpler way to implement hierarchical facets?




Re: Hierarchical faceting with solr 1.4 version

2012-02-01 Thread Erick Erickson
Well, a lot depends on how you need to query. The simplest
would be to store triplets MSA/Area/Hood, that is denormalize
the data and store each. If you used a multiValued field to store
it, you could do some tricky dancing with positionIncrementGap
to insure that matches occurred as you wish.

But if that doesn't make sense, perhaps you could expand on
the kinds of queries that need to happen.

Best
Erick

On Wed, Feb 1, 2012 at 12:58 AM, Gupta, Veeranjaneya
 wrote:
> Hi,
>
> I am using SOLR1.4 version. I have a requirement to display the data as below.
>
>  dictionaryId="297224">
> 
>  dictionaryId="400702">
>  dictionaryId="14993"/>
>  dictionaryId="279265"/>
> 
>  dictionaryId="297286">
>  dictionaryId="15424"/>
> 
> 
> 
> 
>  dictionaryId="279770"/>
>  dictionaryId="278905"/>
>  dictionaryId="296856"/>
> 
> 
>
> Here we store 3 types of polygons MSA, AREA and HOOD.
> One MSA can have more than one AREA types as children and one AREA can have 
> more than one HOOD types as children.
> How to store this kind of data in solr and how to query the solr to get this 
> hierarchical data?
>
> Thanks, Gupta


Re: Hierarchical faceting in UI

2012-01-31 Thread Chris Hostetter

I'm not really following your specific example, but a worked through 
example of the "index full breadcrumb" type approach darren was suggesting 
for doing drill down i na hierarchy is described in slides 32-35 of 
this presentation (which was recorded as a webcast)...

http://people.apache.org/%7Ehossman/apachecon2010/facets/
http://www.lucidimagination.com/why-lucid/webinars/mastering-power-faceted-search

in general, i *strongly* recommend that you use unique ids for each 
"node" of your taxonomy as a way to avoid confusion when multiple nodes 
have the same label/name.  (in the presentation i talk about doing that, 
but the slides show simple strings to help viewers follow what's going on)

-Hoss


Re: Hierarchical faceting in UI

2012-01-31 Thread Chris Hostetter

: References:
: 
: Message-ID: <1327357980.36539.yahoomail...@web160302.mail.bf1.yahoo.com>
: Subject: Hierarchical faceting in UI

https://people.apache.org/~hossman/#threadhijack
Thread Hijacking on Mailing Lists

When starting a new discussion on a mailing list, please do not reply to 
an existing message, instead start a fresh email.  Even if you change the 
subject line of your email, other mail headers still track which thread 
you replied to and your question is "hidden" in that thread and gets less 
attention.   It makes following discussions in the mailing list archives 
particularly difficult.



-Hoss


Re: Hierarchical faceting in UI

2012-01-24 Thread Yuhao
Hi Darren.  You said: 


"Your UI will associate the correct parent id to build the facet query"

This is the part I'm having trouble figuring out how to accomplish and some 
guidance would help. How would I get the value of the parent to build the facet 
query in the UI, if the value is in another document field?  I was imagining 
that I would add the additional filter of "parent:" to the "fq" 
URL parameter.  But I don't have a way to do it yet.

Perhaps seeing some data would help.  Here is a record in old (flattened) and 
new (parent-enabled) versions, both in JSON format:

OLD:
    {
        "ID" : "3816",
        "Gene Symbol" : "KLK1",
        "Alternate Names" : "hCG_22931;Klk6;hK1;KLKR",
        "Description" : "Kallikrein 1, a peptidase that cleaves kininogen, 
functions in glucose homeostasis, heart contraction, semen liquefaction, and 
vasoconstriction, aberrantly expressed in pancreatitis and endometrial cancer; 
gene polymorphism correlates with kidney failure (BKL)",
        "GAD_Positive_Disease_Associations" : ["Mental Disorders(MESH:D001523) 
>> Dementia, Vascular(MESH:D015140)", "Cardiovascular Diseases(MESH:D002318) >> 
Coronary Artery Disease(MESH:D003324)"],
        "HuGENet_GeneProspector_Associations" : ["atherosclerosis", "HDL"],
    }



NEW:
    {
        "ID" : "3816",
        "Gene Symbol" : "KLK1",
        "Alternate Names" : "hCG_22931;Klk6;hK1;KLKR",
        "Description" : "Kallikrein 1, a peptidase that cleaves kininogen, 
functions in glucose homeostasis, heart contraction, semen liquefaction, and 
vasoconstriction, aberrantly expressed in pancreatitis and endometrial cancer; 
gene polymorphism correlates with kidney failure (BKL)",
        "GAD_Positive_Disease_Associations" : ["Dementia, 
Vascular(MESH:D015140)", "Coronary Artery Disease(MESH:D003324)"],
        "GAD_Positive_Disease_Associations_parent" : ["Mental 
Disorders(MESH:D001523)", "Cardiovascular Diseases(MESH:D002318)"],
        "HuGENet_GeneProspector_Associations" : ["atherosclerosis", "HDL"],
    }

In the old version, the field "GAD_Positive_Disease_Associations" had 2 levels 
of hierarchy that were flattened.  It had the full path of the hierarchy 
leading to the current term.  In the new version, the field only has the 
current term.  A separate field called 
"GAD_Positive_Disease_Associations_parent" has the full path preceding the 
current term.

So, let's say in the UI, I click on the term "Dementia, Vascular(MESH:D015140)" 
to get its child terms and data.  My filters in the URL querystring would be 
exactly: 

fq=GAD_Positive_Disease_Associations:"Dementia, 
Vascular(MESH:D015140)"&fq=GAD_Positive_Disease_Associations_parent:"Mental 
Disorders(MESH:D001523)"

My question is, how to get the parent value of "Mental Disorders(MESH:D001523)" 
to build that querystring?

Thanks!

Yuhao





 From: Darren Govoni 
To: solr-user@lucene.apache.org 
Sent: Tuesday, January 24, 2012 1:23 PM
Subject: Re: Hierarchical faceting in UI
 
Yuhao,
     Ok, let me think about this. A term can have multiple parents. Each of 
those parents would be 'different', yes?
In this case, use a multivalued field for the parent and add all the parent 
names or id's to it. The relations should be unique.

Your UI will associate the correct parent id to build the facet query from and 
return the correct children because the user
is descending down a specific path in the UI and the parent node unique id's 
are returned along the way.

Now, if you are having parent names/id's that themselves can appear in multiple 
locations (vs. just terms 'the leafs'),
then perhaps your hierarchy needs refactoring for redundancy?

Happy to help with more details.

Darren


On 01/24/2012 11:22 AM, Yuhao wrote:
> Darren,
>
> One challenge for me is that a term can appear in multiple places of the 
> hierarchy.  So it's not safe to simply use the term as it appears to get its 
> children; I probably need to include the entire tree path up to this term.  
> For example, if the hierarchy is "Cardiovascular Diseases>  
> Arteriosclerosis>  Coronary Artery Disease", and I'm getting the children of 
> the middle term Arteriosclerosi, I need to filter on something like 
> "parent:Cardiovascular Diseases/Arteriosclerosis".
>
> I'm having trouble figuring out how I can get the complete path per above to 
> add to the URL of each facet term.  I know "velocity/facet_field.vm" is whe

Re: Hierarchical faceting in UI

2012-01-24 Thread Darren Govoni

Yuhao,
Ok, let me think about this. A term can have multiple parents. Each of 
those parents would be 'different', yes?
In this case, use a multivalued field for the parent and add all the parent 
names or id's to it. The relations should be unique.

Your UI will associate the correct parent id to build the facet query from and 
return the correct children because the user
is descending down a specific path in the UI and the parent node unique id's 
are returned along the way.

Now, if you are having parent names/id's that themselves can appear in multiple 
locations (vs. just terms 'the leafs'),
then perhaps your hierarchy needs refactoring for redundancy?

Happy to help with more details.

Darren


On 01/24/2012 11:22 AM, Yuhao wrote:

Darren,

One challenge for me is that a term can appear in multiple places of the hierarchy.  So it's not safe to 
simply use the term as it appears to get its children; I probably need to include the entire tree path up 
to this term.  For example, if the hierarchy is "Cardiovascular Diseases>  Arteriosclerosis>  
Coronary Artery Disease", and I'm getting the children of the middle term Arteriosclerosi, I need to 
filter on something like "parent:Cardiovascular Diseases/Arteriosclerosis".

I'm having trouble figuring out how I can get the complete path per above to add to the URL of each facet term.  I 
know "velocity/facet_field.vm" is where I build the URL.  I know how to simply add a 
"parent:" filter to the URL.  But I don't know how to access a document field, like the 
complete parent path, in "facet_field.vm".  Any help would be great.

Yuhao





  From: "dar...@ontrenet.com"
To: Yuhao
Cc: solr-user@lucene.apache.org
Sent: Monday, January 23, 2012 7:16 PM
Subject: Re: Hierarchical faceting in UI


On Mon, 23 Jan 2012 14:33:00 -0800 (PST), Yuhao
wrote:

Programmatically, something like this might work: for each facet field,
add another hidden field that identifies its parent.  Then, program
additional logic in the UI to show only the facet terms at the currently
selected level.  For example, if one filters on "cat:electronics", the

new

UI logic would apply the additional filter "cat_parent:electronics".

Can

this be done?

Yes. This is how I do it.


Would it be a lot of work?

No. Its not a lot of work, simply represent your hierarchy as parent/child
relations in the document fields and in your UI drill down by issuing new
faceted searches. Use the current facet (tree level) as the parent:
in the next query. Its much easier than other suggestions for this.


Is there a better way?

Not in my opinion, there isn't. This is the simplest to implement and
understand.


By the way, Flamenco (another faceted browser) has built-in support for
hierarchies, and it has worked well for my data in this aspect (but less
well than Solr in others).  I'm looking for the same kind of

hierarchical

UI feature in Solr.




Re: Hierarchical faceting in UI

2012-01-24 Thread Yuhao
Darren,

One challenge for me is that a term can appear in multiple places of the 
hierarchy.  So it's not safe to simply use the term as it appears to get its 
children; I probably need to include the entire tree path up to this term.  For 
example, if the hierarchy is "Cardiovascular Diseases > Arteriosclerosis > 
Coronary Artery Disease", and I'm getting the children of the middle term 
Arteriosclerosi, I need to filter on something like "parent:Cardiovascular 
Diseases/Arteriosclerosis".

I'm having trouble figuring out how I can get the complete path per above to 
add to the URL of each facet term.  I know "velocity/facet_field.vm" is where I 
build the URL.  I know how to simply add a "parent:" filter to the URL.  
But I don't know how to access a document field, like the complete parent path, 
in "facet_field.vm".  Any help would be great.

Yuhao





 From: "dar...@ontrenet.com" 
To: Yuhao  
Cc: solr-user@lucene.apache.org 
Sent: Monday, January 23, 2012 7:16 PM
Subject: Re: Hierarchical faceting in UI
 

On Mon, 23 Jan 2012 14:33:00 -0800 (PST), Yuhao 
wrote:
> Programmatically, something like this might work: for each facet field,
> add another hidden field that identifies its parent.  Then, program
> additional logic in the UI to show only the facet terms at the currently
> selected level.  For example, if one filters on "cat:electronics", the
new
> UI logic would apply the additional filter "cat_parent:electronics". 
Can
> this be done?  

Yes. This is how I do it.

> Would it be a lot of work?  
No. Its not a lot of work, simply represent your hierarchy as parent/child
relations in the document fields and in your UI drill down by issuing new
faceted searches. Use the current facet (tree level) as the parent:
in the next query. Its much easier than other suggestions for this.

> Is there a better way?
Not in my opinion, there isn't. This is the simplest to implement and
understand.

> 
> By the way, Flamenco (another faceted browser) has built-in support for
> hierarchies, and it has worked well for my data in this aspect (but less
> well than Solr in others).  I'm looking for the same kind of
hierarchical
> UI feature in Solr.

Re: Hierarchical faceting in UI

2012-01-23 Thread Johannes Goll
another way is to store the original hierarchy in a sql database (in
the form: id, parent_id, name, level) and in the Lucene index store
the complete
hierarchy (from root to leave node) for each document in one field
using the ids of the sql database. In that way you can get documents
at any level of
the hierarchy. You can use the sql database to dynamically expand the
tree by building facet queries to fetch document collections of
child-nodes.

Johannes


 from the root level down to leave node in one field "1 13 32 42 23 12"

2012/1/23  :
>
> On Mon, 23 Jan 2012 14:33:00 -0800 (PST), Yuhao 
> wrote:
>> Programmatically, something like this might work: for each facet field,
>> add another hidden field that identifies its parent.  Then, program
>> additional logic in the UI to show only the facet terms at the currently
>> selected level.  For example, if one filters on "cat:electronics", the
> new
>> UI logic would apply the additional filter "cat_parent:electronics".
> Can
>> this be done?
>
> Yes. This is how I do it.
>
>> Would it be a lot of work?
> No. Its not a lot of work, simply represent your hierarchy as parent/child
> relations in the document fields and in your UI drill down by issuing new
> faceted searches. Use the current facet (tree level) as the parent:
> in the next query. Its much easier than other suggestions for this.
>
>> Is there a better way?
> Not in my opinion, there isn't. This is the simplest to implement and
> understand.
>
>>
>> By the way, Flamenco (another faceted browser) has built-in support for
>> hierarchies, and it has worked well for my data in this aspect (but less
>> well than Solr in others).  I'm looking for the same kind of
> hierarchical
>> UI feature in Solr.


Re: Hierarchical faceting in UI

2012-01-23 Thread darren

On Mon, 23 Jan 2012 14:33:00 -0800 (PST), Yuhao 
wrote:
> Programmatically, something like this might work: for each facet field,
> add another hidden field that identifies its parent.  Then, program
> additional logic in the UI to show only the facet terms at the currently
> selected level.  For example, if one filters on "cat:electronics", the
new
> UI logic would apply the additional filter "cat_parent:electronics". 
Can
> this be done?  

Yes. This is how I do it.

> Would it be a lot of work?  
No. Its not a lot of work, simply represent your hierarchy as parent/child
relations in the document fields and in your UI drill down by issuing new
faceted searches. Use the current facet (tree level) as the parent:
in the next query. Its much easier than other suggestions for this.

> Is there a better way?
Not in my opinion, there isn't. This is the simplest to implement and
understand.

> 
> By the way, Flamenco (another faceted browser) has built-in support for
> hierarchies, and it has worked well for my data in this aspect (but less
> well than Solr in others).  I'm looking for the same kind of
hierarchical
> UI feature in Solr.


Re: Hierarchical faceting with Date

2011-10-07 Thread Erik Hatcher
Ravi -

It's not a feature, currently, of pivot facets to do date ranges along with it. 
 Is that what you're after?  It should still "work" to facet on date fields and 
pivot those with other fields in a standard per-value sort of way.

Can you elaborate on the specific data and results you'd like to get?

Erik

On Oct 4, 2011, at 16:34 , Ravi Bulusu wrote:

> Hi,
> 
> I'm trying to perform a hierarchical (pivot) faceted search and it doesn't
> work with date (as one of the field).
> 
> My questions are
> 1. Is this a supported feature or just a bug that needs to be addressed?
> 2. If it is not intended to be supported, what is the complexity involved in
> implementing it.
> 
> FYI
> I'm using a SOLR 4.0 build from 09/30/2011.
> 
> Regards
> Ravi Bulusu



Re: Hierarchical faceting with Date

2011-10-05 Thread pravesh
You count index the date as a text field(or use a new text field to store
date as text) and then try it on this new field

Thanx
Pravesh

--
View this message in context: 
http://lucene.472066.n3.nabble.com/Hierarchical-faceting-with-Date-tp3394521p3395824.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: hierarchical faceting in Solr?

2011-08-24 Thread Alexei Martchenko
Cheers, very good, congratulations

2011/8/23 Naomi Dushay 

> Chris Beer just did a revamp of the wiki page at:
>
>  
> http://wiki.apache.org/solr/**HierarchicalFaceting
>
> Yay Chris!
>
> - Naomi
> (" ... and I helped!")
>
>
> On Aug 22, 2011, at 10:49 AM, Naomi Dushay wrote:
>
>  Chris,
>>
>> Is there a document somewhere on how to do this?  If not, might you create
>> one?   I could even imagine such a document living on the Solr wiki ...
>>  this one has mostly ancient content:
>>
>> http://wiki.apache.org/solr/**HierarchicalFaceting
>>
>> - Naomi
>>
>
>


-- 

*Alexei Martchenko* | *CEO* | Superdownloads
ale...@superdownloads.com.br | ale...@martchenko.com.br | (11)
5083.1018/5080.3535/5080.3533


Re: hierarchical faceting in Solr?

2011-08-23 Thread Naomi Dushay

Chris Beer just did a revamp of the wiki page at:

  http://wiki.apache.org/solr/HierarchicalFaceting

Yay Chris!

- Naomi
(" ... and I helped!")


On Aug 22, 2011, at 10:49 AM, Naomi Dushay wrote:


Chris,

Is there a document somewhere on how to do this?  If not, might you  
create one?   I could even imagine such a document living on the  
Solr wiki ...  this one has mostly ancient content:


http://wiki.apache.org/solr/HierarchicalFaceting

- Naomi




Re: hierarchical faceting in Solr?

2011-08-22 Thread Bill Bell
Naomi,

Just create a login and update it!!


On 8/22/11 12:27 PM, "Erick Erickson"  wrote:

>Try searching the Solr user's list for "hierarchical", this topic
>has been discussed numerous times.
>
>It would be great if you could collate the various solutions
>and update the wiki, all you have to do is create a
>login...
>
>Best
>Erick
>
>On Mon, Aug 22, 2011 at 1:49 PM, Naomi Dushay 
>wrote:
>> Chris,
>>
>> Is there a document somewhere on how to do this?  If not, might you
>>create
>> one?   I could even imagine such a document living on the Solr wiki ...
>>  this one has mostly ancient content:
>>
>> http://wiki.apache.org/solr/HierarchicalFaceting
>>
>> - Naomi
>>




Re: hierarchical faceting in Solr?

2011-08-22 Thread Erick Erickson
Try searching the Solr user's list for "hierarchical", this topic
has been discussed numerous times.

It would be great if you could collate the various solutions
and update the wiki, all you have to do is create a
login...

Best
Erick

On Mon, Aug 22, 2011 at 1:49 PM, Naomi Dushay  wrote:
> Chris,
>
> Is there a document somewhere on how to do this?  If not, might you create
> one?   I could even imagine such a document living on the Solr wiki ...
>  this one has mostly ancient content:
>
> http://wiki.apache.org/solr/HierarchicalFaceting
>
> - Naomi
>


Re: hierarchical faceting, SOLR-792 - confused on config

2011-03-17 Thread Erik Hatcher

On Mar 16, 2011, at 14:53 , Jonathan Rochkind wrote:

> Interesting, any documentation on the PathTokenizer anywhere? Or just have to 
> find and look at the source? That's something I hadn't known about, which may 
> be useful to some stuff I've been working on depending on how it works.

  


Sorry, I said "PathTokenizer" which is what SOLR-1057 called it for a bit 
before it got renamed.

Erik



Re: hierarchical faceting, SOLR-792 - confused on config

2011-03-17 Thread Erik Hatcher
Yes, pivot faceting is committed to trunk.  But is not part of upcoming 3.1 
release.

Erik

On Mar 16, 2011, at 15:00 , McGibbney, Lewis John wrote:

> Hi Erik,
> 
> I have been reading about the progression of SOLR-792 into pivot faceting, 
> however can you expand to comment on
> where it is committed. Are you referring to trunk?
> The reason I am asking is that I have been using 1.4.1 for some time now and 
> have been thinking of upgrading to trunk... or branch
> 
> Thank you Lewis
> 
> From: Erik Hatcher [erik.hatc...@gmail.com]
> Sent: 16 March 2011 17:36
> To: solr-user@lucene.apache.org
> Subject: Re: hierarchical faceting, SOLR-792 - confused on config
> 
> Sorry, I missed the original mail on this thread
> 
> I put together that hierarchical faceting wiki page a couple of years ago 
> when helping a customer evaluate SOLR-64 vs. SOLR-792 vs.other approaches.  
> Since then, SOLR-792 morphed and is committed as pivot faceting.  SOLR-64 
> spawned a PathTokenizer which is part of Solr now too.
> 
> Recently Toke updated that page with some additional info.  It's definitely 
> not a "how to" page, and perhaps should get renamed/moved/revamped?  Toke?
> 
>Erik
> 
> 
> Glasgow Caledonian University is a registered Scottish charity, number 
> SC021474
> 
> Winner: Times Higher Education’s Widening Participation Initiative of the 
> Year 2009 and Herald Society’s Education Initiative of the Year 2009.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html
> 
> Winner: Times Higher Education’s Outstanding Support for Early Career 
> Researchers of the Year 2010, GCU as a lead with Universities Scotland 
> partners.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html



Re: hierarchical faceting, SOLR-792 - confused on config

2011-03-17 Thread Toke Eskildsen
On Wed, 2011-03-16 at 18:36 +0100, Erik Hatcher wrote:
> Sorry, I missed the original mail on this thread
> 
> I put together that hierarchical faceting wiki page a couple
> of years ago when helping a customer evaluate SOLR-64 vs.
> SOLR-792 vs.other approaches.  Since then, SOLR-792 morphed
> and is committed as pivot faceting.  SOLR-64 spawned a
> PathTokenizer which is part of Solr now too.
> 
> Recently Toke updated that page with some additional info.
> It's definitely not a "how to" page, and perhaps should get
> renamed/moved/revamped?  Toke?

Unfortunately or luckily, depending on ones point of view, I am hit by a
child #3 and buying house combo. A lot of intentions, but no promises
for the next month or two. 


I think we need both an overview and a detailed how-to of the different
angles on extended faceting in Solr, seen from a user-perspective.

I am not sure I fully understand the different methods myself, so maybe
we could start by discussing them here? Below is a quick outline of how
I see them; please expand & correct. I plan to back up the claims about
scale later with a wiki-page with performance tests.


http://www.lucidimagination.com/solutions/webcasts/faceting @27-33 min:

- Requires the user to transform the paths to multiple special terms
- Step-by-step drill down: If a visual tree is needed, it requires one 
  call for each branch.
- Supports multiple paths/document
- Constraints on output works just as standard faceting
- Scales very well when a single branch is requested

Example use case:
Click-to-expand tree structure of categories for books.


PathHierarchyTokenizer (trunk):
Changes /A/B/C to /A, /A/B and /A/B/C.

I don't know how this can be used directly for hierarchical faceting.
The Lucid Imagination webcast uses the tokenization 0/A, 1/A/B and
2/A/B/C so they seem incompatible to me. The discussion on SOLR-1057
indicates that it can be used with SOLR-64, but SOLR-64 does its own
tokenization!?  Little help here?


SOLR-64 (not up to date with trunk?):

- Uses a custom tokenizer to handle delimited paths (A/B/C).
- Single-path hierarchical faceting
- Constraints can be given on the depth of the hierarchy but not on the 
  number of entries at a given level (huge result set when a wide 
  hierarchy is analyzed)
- Fine (speed & memory) for small taxonomies
- Does not scale well (speed) to large taxonomies

Example use case:
Tree structure of addresses for stores.


SOLR-792 aka pivot faceting (Solr 4.0):

- Uses multiple independent fields as input: Not suitable for taxonomies
- Multi-value but not multi-path
- Supports taxonomies by restraining to single-path/document(?)
- Constraints can be given on entry count, but sorting cannot be done 
  on recursive counting of entries (and it would be very CPU expensive
  to do so(?))
- Fine (speed & memory) for small taxonomies
- Scales well (speed & memory)to large taxonomies
- Scales poorly (speed)to large taxonomies and large result size

Example use case:
Tree structure with price, rating and stock


SOLR-2412 (trunk, highly experimental):

- Multi-path hierarchical faceting
- Uses a field with delimited paths as input (A/B/C)
- Constraints can be given on depth as well as entry count, but sorting
  cannot be done on recursive counting of entries (the number is there 
  though, so it would be fairly easy to add such a sorter)
- Fine (speed & memory) for small taxonomies
- Scales well (speed & memory)to large taxonomies & result size

Example use case:
Tree structure of categories for books.



Re: hierarchical faceting, SOLR-792 - confused on config

2011-03-16 Thread Koji Sekiguchi

(11/03/17 3:53), Jonathan Rochkind wrote:

Interesting, any documentation on the PathTokenizer anywhere?


It is PathHierarchyTokenizer:

https://hudson.apache.org/hudson/job/Solr-trunk/javadoc/org/apache/solr/analysis/PathHierarchyTokenizerFactory.html

Koji
--
http://www.rondhuit.com/en/


RE: hierarchical faceting, SOLR-792 - confused on config

2011-03-16 Thread McGibbney, Lewis John
Hi Erik,

I have been reading about the progression of SOLR-792 into pivot faceting, 
however can you expand to comment on
where it is committed. Are you referring to trunk?
The reason I am asking is that I have been using 1.4.1 for some time now and 
have been thinking of upgrading to trunk... or branch

Thank you Lewis

From: Erik Hatcher [erik.hatc...@gmail.com]
Sent: 16 March 2011 17:36
To: solr-user@lucene.apache.org
Subject: Re: hierarchical faceting, SOLR-792 - confused on config

Sorry, I missed the original mail on this thread

I put together that hierarchical faceting wiki page a couple of years ago when 
helping a customer evaluate SOLR-64 vs. SOLR-792 vs.other approaches.  Since 
then, SOLR-792 morphed and is committed as pivot faceting.  SOLR-64 spawned a 
PathTokenizer which is part of Solr now too.

Recently Toke updated that page with some additional info.  It's definitely not 
a "how to" page, and perhaps should get renamed/moved/revamped?  Toke?

Erik


Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 
2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career 
Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html


Re: hierarchical faceting, SOLR-792 - confused on config

2011-03-16 Thread Jonathan Rochkind
Interesting, any documentation on the PathTokenizer anywhere? Or just 
have to find and look at the source? That's something I hadn't known 
about, which may be useful to some stuff I've been working on depending 
on how it works.


If nothing else, in the meantime, I'm going to take that exact message 
from Erik and just add it to the top of the wiki page, to avoid other 
people getting confused (I've been confused by that page too) until 
someone spends the time to rewrite it to be more up to date and 
accurate, or clear about it's topicality.


On 3/16/2011 1:36 PM, Erik Hatcher wrote:

Sorry, I missed the original mail on this thread

I put together that hierarchical faceting wiki page a couple of years ago when 
helping a customer evaluate SOLR-64 vs. SOLR-792 vs.other approaches.  Since 
then, SOLR-792 morphed and is committed as pivot faceting.  SOLR-64 spawned a 
PathTokenizer which is part of Solr now too.

Recently Toke updated that page with some additional info.  It's definitely not a 
"how to" page, and perhaps should get renamed/moved/revamped?  Toke?

Erik

On Mar 16, 2011, at 12:39 , McGibbney, Lewis John wrote:


Hi,

This is also where I am having problems. I have not been able to understand 
very much on the wiki.
I do not understand how to configure the faceting we are referring to.
Although I know very little about this, I can't help but think that the wiki is 
quite clearly unaccurate by some way!

Any comments please
Lewis

From: kmf [kfole...@gmail.com]
Sent: 23 February 2011 17:10
To: solr-user@lucene.apache.org
Subject: Re: hierarchical faceting, SOLR-792 - confused on config

I'm really confused now.  Is this page completely out of date -
http://wiki.apache.org/solr/HierarchicalFaceting - as it seems to imply that
solr-792 is a form of hierarchical faceting. "There are currently two
similar, non-competing, approaches to generating tree/hierarchical facets
from Solr: SOLR-64 and SOLR-792"

To achieve hierarchical faceting, is the rule then that you form the
hierarchical facets using a transformer in the DIH and do nothing in
schema.xml or solrconfig.xml?   I seem to recall reading somewhere that
creating a copyField is needed.  Sorry for the entry level question but, I'm
still trying to understand how to configure solr to do hierarchical
faceting.

Thanks,
kmf
--
View this message in context: 
http://lucene.472066.n3.nabble.com/hierarchical-faceting-SOLR-792-confused-on-config-tp2556394p2561445.html
Sent from the Solr - User mailing list archive at Nabble.com.

Email has been scanned for viruses by Altman Technologies' email management 
service - www.altman.co.uk/emailsystems

Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 
2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career 
Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html




Re: hierarchical faceting, SOLR-792 - confused on config

2011-03-16 Thread Erik Hatcher
Sorry, I missed the original mail on this thread

I put together that hierarchical faceting wiki page a couple of years ago when 
helping a customer evaluate SOLR-64 vs. SOLR-792 vs.other approaches.  Since 
then, SOLR-792 morphed and is committed as pivot faceting.  SOLR-64 spawned a 
PathTokenizer which is part of Solr now too.

Recently Toke updated that page with some additional info.  It's definitely not 
a "how to" page, and perhaps should get renamed/moved/revamped?  Toke?

Erik

On Mar 16, 2011, at 12:39 , McGibbney, Lewis John wrote:

> Hi,
> 
> This is also where I am having problems. I have not been able to understand 
> very much on the wiki.
> I do not understand how to configure the faceting we are referring to.
> Although I know very little about this, I can't help but think that the wiki 
> is quite clearly unaccurate by some way!
> 
> Any comments please
> Lewis
> 
> From: kmf [kfole...@gmail.com]
> Sent: 23 February 2011 17:10
> To: solr-user@lucene.apache.org
> Subject: Re: hierarchical faceting, SOLR-792 - confused on config
> 
> I'm really confused now.  Is this page completely out of date -
> http://wiki.apache.org/solr/HierarchicalFaceting - as it seems to imply that
> solr-792 is a form of hierarchical faceting. "There are currently two
> similar, non-competing, approaches to generating tree/hierarchical facets
> from Solr: SOLR-64 and SOLR-792"
> 
> To achieve hierarchical faceting, is the rule then that you form the
> hierarchical facets using a transformer in the DIH and do nothing in
> schema.xml or solrconfig.xml?   I seem to recall reading somewhere that
> creating a copyField is needed.  Sorry for the entry level question but, I'm
> still trying to understand how to configure solr to do hierarchical
> faceting.
> 
> Thanks,
> kmf
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/hierarchical-faceting-SOLR-792-confused-on-config-tp2556394p2561445.html
> Sent from the Solr - User mailing list archive at Nabble.com.
> 
> Email has been scanned for viruses by Altman Technologies' email management 
> service - www.altman.co.uk/emailsystems
> 
> Glasgow Caledonian University is a registered Scottish charity, number 
> SC021474
> 
> Winner: Times Higher Education’s Widening Participation Initiative of the 
> Year 2009 and Herald Society’s Education Initiative of the Year 2009.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html
> 
> Winner: Times Higher Education’s Outstanding Support for Early Career 
> Researchers of the Year 2010, GCU as a lead with Universities Scotland 
> partners.
> http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html



RE: hierarchical faceting, SOLR-792 - confused on config

2011-03-16 Thread McGibbney, Lewis John
Hi,

This is also where I am having problems. I have not been able to understand 
very much on the wiki.
I do not understand how to configure the faceting we are referring to.
Although I know very little about this, I can't help but think that the wiki is 
quite clearly unaccurate by some way!

Any comments please
Lewis

From: kmf [kfole...@gmail.com]
Sent: 23 February 2011 17:10
To: solr-user@lucene.apache.org
Subject: Re: hierarchical faceting, SOLR-792 - confused on config

I'm really confused now.  Is this page completely out of date -
http://wiki.apache.org/solr/HierarchicalFaceting - as it seems to imply that
solr-792 is a form of hierarchical faceting. "There are currently two
similar, non-competing, approaches to generating tree/hierarchical facets
from Solr: SOLR-64 and SOLR-792"

To achieve hierarchical faceting, is the rule then that you form the
hierarchical facets using a transformer in the DIH and do nothing in
schema.xml or solrconfig.xml?   I seem to recall reading somewhere that
creating a copyField is needed.  Sorry for the entry level question but, I'm
still trying to understand how to configure solr to do hierarchical
faceting.

Thanks,
kmf
--
View this message in context: 
http://lucene.472066.n3.nabble.com/hierarchical-faceting-SOLR-792-confused-on-config-tp2556394p2561445.html
Sent from the Solr - User mailing list archive at Nabble.com.

Email has been scanned for viruses by Altman Technologies' email management 
service - www.altman.co.uk/emailsystems

Glasgow Caledonian University is a registered Scottish charity, number SC021474

Winner: Times Higher Education’s Widening Participation Initiative of the Year 
2009 and Herald Society’s Education Initiative of the Year 2009.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,6219,en.html

Winner: Times Higher Education’s Outstanding Support for Early Career 
Researchers of the Year 2010, GCU as a lead with Universities Scotland partners.
http://www.gcu.ac.uk/newsevents/news/bycategory/theuniversity/1/name,15691,en.html


Re: hierarchical faceting, SOLR-792 - confused on config

2011-02-23 Thread kmf

I'm really confused now.  Is this page completely out of date -
http://wiki.apache.org/solr/HierarchicalFaceting - as it seems to imply that
solr-792 is a form of hierarchical faceting. "There are currently two
similar, non-competing, approaches to generating tree/hierarchical facets
from Solr: SOLR-64 and SOLR-792"

To achieve hierarchical faceting, is the rule then that you form the
hierarchical facets using a transformer in the DIH and do nothing in
schema.xml or solrconfig.xml?   I seem to recall reading somewhere that
creating a copyField is needed.  Sorry for the entry level question but, I'm
still trying to understand how to configure solr to do hierarchical
faceting.

Thanks,
kmf
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/hierarchical-faceting-SOLR-792-confused-on-config-tp2556394p2561445.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: hierarchical faceting, SOLR-792 - confused on config

2011-02-22 Thread Koji Sekiguchi

(11/02/23 8:26), kmf wrote:


I'm using solr 4.0 and trying to implement a hierarchical faceting example.
The example I'm trying to implement is taken from the webcast "Mastering the
Power of Faceted Search."
(http://www.lucidimagination.com/solutions/webcasts/faceting)  Around minute
30, Chris Hostetter gives a very nice "tips&  tricks" example he described
as Taxonomy facets.  Where I'm confused is how to get the data
indexed/organized into the "taxonomy facets" (0/NonFic, 1/NonFic/Law,
0/NonFic, 1/NonFic/Sci, 0/NonFic, 1/NonFic/Hist, 1/NonFic/Sci,
2/NonFic/Sci/Phys).  Since I'm using DIH to import my data from a DB, do I
create a TemplateTransformer to produce the indexed data?  Do I have to do
something special within schema.xml and/or solrconfig.xml?

Once I figure out the correct config setup, I assume it's simply a matter of
creating the correct solr query like he describes in the video?

Thanks,
kmf


kmf,

disclaimer: I've never seen the webcast yet.

First, SOLR-792 is not for hierarchical faceting. Please see SOLR-64.
Second, please take a look at PathHierarchyTokenizer in trunk and 3x.
It cannot output the depth factor ("0/", "1/", ...), though.

Hmm, does everyone think that it has to be better if it outputs
the depth factors to type or payload or somewhere else?

Koji
--
http://www.rondhuit.com/en/


Re: Hierarchical faceting

2010-08-13 Thread John Wang
Check out project Bobo: http://sna-projects.com/bobo/

A lucene based faceted search library.

Now with solr plugin:
http://snaprojects.jira.com/wiki/display/BOBO/Bobo+Solr+Plugin

-John

On Fri, Aug 13, 2010 at 8:56 PM, Jayendra Patil <
jayendra.patil@gmail.com> wrote:

> Multiple values are probably same as Multiple Tokens with a high position
> increment gap.
> Would still prefer to go with the multivalued field approach, as it is
> inbuilt and easier to get back the individual facets with the count in the
> response.
>
> Regards,
> Jayendra
>
> On Fri, Aug 13, 2010 at 7:57 AM, Mats Bolstad  wrote:
>
> > Thank you for your answer. I sure will implement something in that
> > direction.
> >
> > But couldn't multiple tokens be used instead of multiple values?
> >
> > 
> >  
> >// some tokenizer and filters that generates "0//Europe",
> > "1//Europe//Norway", "2//Europe//Norway//Oslo"
> >   
> > 
> >
> > 
> >
> > Wouldn't that work in just the same way? Or is it some difference
> > between multiple tokens and multiple values that I'm missing?
> >
> > --
> > Regards,
> > Mats Bolstad
> >
> >
> >
> > On Fri, Aug 13, 2010 at 2:21 AM, Jayendra Patil
> >  wrote:
> > > We were able to get the hierarchy faceting working with a work around
> > > approach.
> > >
> > > e.g. if you have Europe//Norway//Oslo as an entry
> > >
> > > 1. Create a new multivalued field with string type
> > >
> > >  > > multiValued="true"/>
> > >
> > > 2. Index the field for "Europe//Norway//Oslo" with values
> > >
> > > 0//Europe
> > > 1//Europe//Norway
> > > 2//Europe//Norway//Oslo
> > >
> > > 3. The Facet can now be used in the Queries :-
> > >
> > > 1st Level - Would return all entries @ 1st level e.g. 0//USA, 0//Europe
> > >
> > > fq=
> > >
> > > f.country_facet.facet.prefix=0//
> > >
> > > facet.field=country_facet
> > >
> > >
> > > 2nd Level - Would return all entries @ second level in Europe
> > > 1//Europe//Norway, 1//Europe//Sweden
> > >
> > > fq=country_facet:0//Europe
> > >
> > > f.country_facet.facet.prefix=1//Europe
> > >
> > > facet.field=country_facet
> > >
> > >
> > >
> > > 3rd Level - Would return 1//Europe//Norway entries
> > >
> > > fq=country_facet:1//Europe//Norway
> > >
> > > f.country_facet.facet.prefix=2//Europe//Norway
> > >
> > > facet.field=country_facet
> > >
> > > Increment the facet.prefix by 1 so that you limit the facet results to
> to
> > > that prefix.
> > > Also works for any depth.
> > >
> > > Regards,
> > > Jayendra
> > >
> > >
> > > On Thu, Aug 12, 2010 at 6:01 PM, Mats Bolstad 
> > wrote:
> > >
> > >> Hey all,
> > >>
> > >> I am doing a search on hierarchical data, and I have a hard time
> > >> getting my head around the following problem.
> > >>
> > >> I want a result as follows, in one single query only:
> > >>
> > >> USA (3)
> > >> > California (2)
> > >> > Arizona (1)
> > >> Europe (4)
> > >> > Norway (3)
> > >> >> Oslo (3)
> > >> > Sweden (1)
> > >>
> > >> How it looks in the XML/JSON response is not really important, this is
> > >> more a presentation issue. I guess I could store the values "USA",
> > >> "USA/California", "Europe/Norway/Oslo" as strings for each document,
> > >> and do some JavaScript-ing to show the hierarchies appropriately. When
> > >> a specific item in the facet is selected, for example "Norway", Solr
> > >> could be queries with a filter query on "Europe/Norway*"?
> > >>
> > >> Do anyone have some experiences they could please share with me?
> > >>
> > >> I have tried out SOLR-64, and it gives me the results I look for.
> > >> However, I do not have the opportunity to use a patch in the
> > >> production environment ...
> > >>
> > >> --
> > >> Thanks,
> > >> Mats Bolstad
> > >>
> > >
> >
>


Re: Hierarchical faceting

2010-08-13 Thread Jayendra Patil
Multiple values are probably same as Multiple Tokens with a high position
increment gap.
Would still prefer to go with the multivalued field approach, as it is
inbuilt and easier to get back the individual facets with the count in the
response.

Regards,
Jayendra

On Fri, Aug 13, 2010 at 7:57 AM, Mats Bolstad  wrote:

> Thank you for your answer. I sure will implement something in that
> direction.
>
> But couldn't multiple tokens be used instead of multiple values?
>
> 
>  
>// some tokenizer and filters that generates "0//Europe",
> "1//Europe//Norway", "2//Europe//Norway//Oslo"
>   
> 
>
> 
>
> Wouldn't that work in just the same way? Or is it some difference
> between multiple tokens and multiple values that I'm missing?
>
> --
> Regards,
> Mats Bolstad
>
>
>
> On Fri, Aug 13, 2010 at 2:21 AM, Jayendra Patil
>  wrote:
> > We were able to get the hierarchy faceting working with a work around
> > approach.
> >
> > e.g. if you have Europe//Norway//Oslo as an entry
> >
> > 1. Create a new multivalued field with string type
> >
> >  > multiValued="true"/>
> >
> > 2. Index the field for "Europe//Norway//Oslo" with values
> >
> > 0//Europe
> > 1//Europe//Norway
> > 2//Europe//Norway//Oslo
> >
> > 3. The Facet can now be used in the Queries :-
> >
> > 1st Level - Would return all entries @ 1st level e.g. 0//USA, 0//Europe
> >
> > fq=
> >
> > f.country_facet.facet.prefix=0//
> >
> > facet.field=country_facet
> >
> >
> > 2nd Level - Would return all entries @ second level in Europe
> > 1//Europe//Norway, 1//Europe//Sweden
> >
> > fq=country_facet:0//Europe
> >
> > f.country_facet.facet.prefix=1//Europe
> >
> > facet.field=country_facet
> >
> >
> >
> > 3rd Level - Would return 1//Europe//Norway entries
> >
> > fq=country_facet:1//Europe//Norway
> >
> > f.country_facet.facet.prefix=2//Europe//Norway
> >
> > facet.field=country_facet
> >
> > Increment the facet.prefix by 1 so that you limit the facet results to to
> > that prefix.
> > Also works for any depth.
> >
> > Regards,
> > Jayendra
> >
> >
> > On Thu, Aug 12, 2010 at 6:01 PM, Mats Bolstad 
> wrote:
> >
> >> Hey all,
> >>
> >> I am doing a search on hierarchical data, and I have a hard time
> >> getting my head around the following problem.
> >>
> >> I want a result as follows, in one single query only:
> >>
> >> USA (3)
> >> > California (2)
> >> > Arizona (1)
> >> Europe (4)
> >> > Norway (3)
> >> >> Oslo (3)
> >> > Sweden (1)
> >>
> >> How it looks in the XML/JSON response is not really important, this is
> >> more a presentation issue. I guess I could store the values "USA",
> >> "USA/California", "Europe/Norway/Oslo" as strings for each document,
> >> and do some JavaScript-ing to show the hierarchies appropriately. When
> >> a specific item in the facet is selected, for example "Norway", Solr
> >> could be queries with a filter query on "Europe/Norway*"?
> >>
> >> Do anyone have some experiences they could please share with me?
> >>
> >> I have tried out SOLR-64, and it gives me the results I look for.
> >> However, I do not have the opportunity to use a patch in the
> >> production environment ...
> >>
> >> --
> >> Thanks,
> >> Mats Bolstad
> >>
> >
>


Re: Hierarchical faceting

2010-08-13 Thread Mats Bolstad
Thank you for your answer. I sure will implement something in that direction.

But couldn't multiple tokens be used instead of multiple values?


  
// some tokenizer and filters that generates "0//Europe",
"1//Europe//Norway", "2//Europe//Norway//Oslo"
  




Wouldn't that work in just the same way? Or is it some difference
between multiple tokens and multiple values that I'm missing?

--
Regards,
Mats Bolstad



On Fri, Aug 13, 2010 at 2:21 AM, Jayendra Patil
 wrote:
> We were able to get the hierarchy faceting working with a work around
> approach.
>
> e.g. if you have Europe//Norway//Oslo as an entry
>
> 1. Create a new multivalued field with string type
>
>  multiValued="true"/>
>
> 2. Index the field for "Europe//Norway//Oslo" with values
>
> 0//Europe
> 1//Europe//Norway
> 2//Europe//Norway//Oslo
>
> 3. The Facet can now be used in the Queries :-
>
> 1st Level - Would return all entries @ 1st level e.g. 0//USA, 0//Europe
>
> fq=
>
> f.country_facet.facet.prefix=0//
>
> facet.field=country_facet
>
>
> 2nd Level - Would return all entries @ second level in Europe
> 1//Europe//Norway, 1//Europe//Sweden
>
> fq=country_facet:0//Europe
>
> f.country_facet.facet.prefix=1//Europe
>
> facet.field=country_facet
>
>
>
> 3rd Level - Would return 1//Europe//Norway entries
>
> fq=country_facet:1//Europe//Norway
>
> f.country_facet.facet.prefix=2//Europe//Norway
>
> facet.field=country_facet
>
> Increment the facet.prefix by 1 so that you limit the facet results to to
> that prefix.
> Also works for any depth.
>
> Regards,
> Jayendra
>
>
> On Thu, Aug 12, 2010 at 6:01 PM, Mats Bolstad  wrote:
>
>> Hey all,
>>
>> I am doing a search on hierarchical data, and I have a hard time
>> getting my head around the following problem.
>>
>> I want a result as follows, in one single query only:
>>
>> USA (3)
>> > California (2)
>> > Arizona (1)
>> Europe (4)
>> > Norway (3)
>> >> Oslo (3)
>> > Sweden (1)
>>
>> How it looks in the XML/JSON response is not really important, this is
>> more a presentation issue. I guess I could store the values "USA",
>> "USA/California", "Europe/Norway/Oslo" as strings for each document,
>> and do some JavaScript-ing to show the hierarchies appropriately. When
>> a specific item in the facet is selected, for example "Norway", Solr
>> could be queries with a filter query on "Europe/Norway*"?
>>
>> Do anyone have some experiences they could please share with me?
>>
>> I have tried out SOLR-64, and it gives me the results I look for.
>> However, I do not have the opportunity to use a patch in the
>> production environment ...
>>
>> --
>> Thanks,
>> Mats Bolstad
>>
>


Re: Hierarchical faceting

2010-08-12 Thread Jayendra Patil
We were able to get the hierarchy faceting working with a work around
approach.

e.g. if you have Europe//Norway//Oslo as an entry

1. Create a new multivalued field with string type



2. Index the field for "Europe//Norway//Oslo" with values

0//Europe
1//Europe//Norway
2//Europe//Norway//Oslo

3. The Facet can now be used in the Queries :-

1st Level - Would return all entries @ 1st level e.g. 0//USA, 0//Europe

fq=

f.country_facet.facet.prefix=0//

facet.field=country_facet


2nd Level - Would return all entries @ second level in Europe
1//Europe//Norway, 1//Europe//Sweden

fq=country_facet:0//Europe

f.country_facet.facet.prefix=1//Europe

facet.field=country_facet



3rd Level - Would return 1//Europe//Norway entries

fq=country_facet:1//Europe//Norway

f.country_facet.facet.prefix=2//Europe//Norway

facet.field=country_facet

Increment the facet.prefix by 1 so that you limit the facet results to to
that prefix.
Also works for any depth.

Regards,
Jayendra


On Thu, Aug 12, 2010 at 6:01 PM, Mats Bolstad  wrote:

> Hey all,
>
> I am doing a search on hierarchical data, and I have a hard time
> getting my head around the following problem.
>
> I want a result as follows, in one single query only:
>
> USA (3)
> > California (2)
> > Arizona (1)
> Europe (4)
> > Norway (3)
> >> Oslo (3)
> > Sweden (1)
>
> How it looks in the XML/JSON response is not really important, this is
> more a presentation issue. I guess I could store the values "USA",
> "USA/California", "Europe/Norway/Oslo" as strings for each document,
> and do some JavaScript-ing to show the hierarchies appropriately. When
> a specific item in the facet is selected, for example "Norway", Solr
> could be queries with a filter query on "Europe/Norway*"?
>
> Do anyone have some experiences they could please share with me?
>
> I have tried out SOLR-64, and it gives me the results I look for.
> However, I do not have the opportunity to use a patch in the
> production environment ...
>
> --
> Thanks,
> Mats Bolstad
>


Re: hierarchical faceting discussion

2009-07-20 Thread Erik Hatcher
I was particularly surprised by the SOLR-64 numbers.  What makes it's  
response so huge (and thus slow) to return the entire tree of facet  
counts?


Erik


On Jul 19, 2009, at 5:35 PM, Erik Hatcher wrote:

I've posted the details of some experiments I just did comparing/ 
contrasting two approaches for faceting on documents within  
hierarchical structures: http://wiki.apache.org/solr/HierarchicalFaceting


I'm sure I'm only scratching the service with the currently  
implementations of both SOLR-64 and SOLR-792.  Alternative  
approaches are welcome!   As I said on the wiki page, there won't be  
any single method that works in all cases - it will depend on how  
the hierarchical counts are needed - as an entire tree?  (not likely  
in large taxonomic cases!)  How are level pruned counts needed?   
Implementation-wise, seems like payloads could be be useful for some  
use cases.


What are the use cases?

What types and sizes of hierarchies are folks dealing with out there  
in the real world?


Erik





RE: Hierarchical Faceting

2008-10-26 Thread Sachit P. Menon
Thanks Hoss,

I was mainly looking for an explanation of such an answer only coz in the forum 
there were such replies posted for Hierarchical faceting.
I'll try out the method.

Thanks.
Sachit


-Original Message-
From: Chris Hostetter [mailto:[EMAIL PROTECTED]
Sent: Sunday, October 26, 2008 11:43 PM
To: solr-user@lucene.apache.org
Subject: Re: Hierarchical Faceting


: Suppose, I have 3 categories like politics, science and sports. In the
: schema, I am defining a field type called 'Category'. I don't have a sub
: category field type (and don't want to have one). Now, Cricket and
: Football are some categories which can be considered to be under sports.
: When I search for something and if it is present in the 'sports'
: category, then it should show me the facets of cricket and football too.

: My question is: Do I need to specify cricket, football also as
: categories or sub categories of sports (for which I don't want to make a
: separate field)? And if I make these as categories only, then how will I
: achieve the drilling down of the data to cricket or football.

there are lots of solutions to problems like this, but picking the best
one tends to depend on what exactly you wnat the search experience to be
like.  based on your description of your problem, an approach where you
index all of the "ancestor breadcrumbs" for hte categories a document is
in along with the "depth" of each ancestor in the tree, and then facet on
those with a prefix restriction would probably work well. ie:

 docA:  cat = sport/cricket
 docB:  cat = sport/shateboarding
 docC:  cat = sport/skateboarding/vert
 docD:  cat = sport/skateboarding/street
 docE:  cat = finance
tokens indexed

 docA:  cat = 0/sport, 1/sport/cricket
 docB:  cat = 0/sport, 1/sport/shateboarding
 docC:  cat = 0/sport, 1/sport/skateboarding, 2/sport/skateboarding/vert
 docD:  cat = 0/sport, 1/sport/skateboarding, 2/sport/skateboarding/street
 docE:  cat = 0/finance

so now your first request you use something like...
   q=foobar&facet=true&facet.field=cat&f.cat.facet.prefix=0/
..and you'll get facet counds for sport and finance.  if they pick "sport"
your next request is something like...
q=foobarfq=cat:0/sport&facet=true&facet.field=cat&f.cat.facet.prefix=1/sport/
...and you'll get facet counds for all the subcats of sport ... etc.


-Hoss


This message (including attachment if any) is confidential and may be 
privileged. If you have received this message by mistake please notify the 
sender by return e-mail and delete this message from your system. Any 
unauthorized use or dissemination of this message in whole or in part is 
strictly prohibited. E-mail may contain viruses. Before opening attachments 
please check them for viruses and defects. While MindTree Limited (MindTree) 
has put in place checks to minimize the risks, MindTree will not be responsible 
for any viruses or defects or any forwarded attachments emanating either from 
within MindTree or outside.

Please note that e-mails are susceptible to change and MindTree shall not be 
liable for any improper, untimely or incomplete transmission.

MindTree reserves the right to monitor and review the content of all messages 
sent to or from MindTree e-mail address. Messages sent to or from this e-mail 
address may be stored on the MindTree e-mail system or else where.


Re: Hierarchical Faceting

2008-10-26 Thread Chris Hostetter

: Suppose, I have 3 categories like politics, science and sports. In the 
: schema, I am defining a field type called 'Category'. I don't have a sub 
: category field type (and don't want to have one). Now, Cricket and 
: Football are some categories which can be considered to be under sports. 
: When I search for something and if it is present in the 'sports' 
: category, then it should show me the facets of cricket and football too.

: My question is: Do I need to specify cricket, football also as 
: categories or sub categories of sports (for which I don't want to make a 
: separate field)? And if I make these as categories only, then how will I 
: achieve the drilling down of the data to cricket or football.

there are lots of solutions to problems like this, but picking the best 
one tends to depend on what exactly you wnat the search experience to be 
like.  based on your description of your problem, an approach where you 
index all of the "ancestor breadcrumbs" for hte categories a document is 
in along with the "depth" of each ancestor in the tree, and then facet on 
those with a prefix restriction would probably work well. ie:

 docA:  cat = sport/cricket
 docB:  cat = sport/shateboarding
 docC:  cat = sport/skateboarding/vert
 docD:  cat = sport/skateboarding/street
 docE:  cat = finance
tokens indexed

 docA:  cat = 0/sport, 1/sport/cricket
 docB:  cat = 0/sport, 1/sport/shateboarding
 docC:  cat = 0/sport, 1/sport/skateboarding, 2/sport/skateboarding/vert
 docD:  cat = 0/sport, 1/sport/skateboarding, 2/sport/skateboarding/street
 docE:  cat = 0/finance

so now your first request you use something like...
   q=foobar&facet=true&facet.field=cat&f.cat.facet.prefix=0/
..and you'll get facet counds for sport and finance.  if they pick "sport" 
your next request is something like...
q=foobarfq=cat:0/sport&facet=true&facet.field=cat&f.cat.facet.prefix=1/sport/
...and you'll get facet counds for all the subcats of sport ... etc.


-Hoss



Re: Hierarchical Faceting

2008-10-22 Thread Marian Steinbach
On Tue, Oct 21, 2008 at 3:59 PM, Sachit P. Menon
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have gone through the archive in search of Hierarchical Faceting but was 
> not clear as what should I exactly do to achieve that.
>
> Suppose, I have 3 categories like politics, science and sports. In the 
> schema, I am defining a field type called 'Category'. I don't have a sub 
> category field type (and don't want to have one).
> Now, Cricket and Football are some categories which can be considered to be 
> under sports.
> When I search for something and if it is present in the 'sports' category, 
> then it should show me the facets of cricket and football too.
>
> My question is:
> Do I need to specify cricket, football also as categories or sub categories 
> of sports (for which I don't want to make a separate field)?
> And if I make these as categories only, then how will I achieve the drilling 
> down of the data to cricket or football.
>


Hi Sachit!

I've had the same problem with a search for whine. The origin of whine
can consist of up to three hierarchical values country (e.g.
"France"), region (e.g. "Bordeaux") and sub-region (e.g. "St.
Emilion").

I have three facet fields country, region, sub-region for that. But I
only display the "region" facet under the following conditions:

- the user has selected a specific country, e.g. France, as filter
- or only one country is left (due to other filtering or fulltext search)

Don't know if this suits you. Just the way I handle it. It's not yet
publicly available though.

Marian