That would work in the facet query, but it implies using truncation in
the facet.field too, doesn't it? (Assuming you want to group the
higher-level facets like "Dir1" rather than getting all the possible
paths beginning with "Dir1"). 

I had assumed I'd have to do something like this:

<level1>Dir1</level1>
<level2>Dir1/Subdir1</level2>
<level3>Dir1/Subdir1/SubSubDir1</level3>

Then set up the application to take note of the current level:

Top level: facet.field=level1
Level 1: fq=level1:Dir1&facet.field=level2
Level 2: fq=level2:Dir1/Subdir1&facet.field=level3

And so on. But if I don't need to duplicate the info in multiple fields
like that, I'd be happier.

Peter


-----Original Message-----
From: Chris Hostetter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 07, 2007 10:47 AM
To: solr-user@lucene.apache.org
Subject: Re: Hierarchical Facets


Assuming I'm understanding your question correctly, something like that
would probably work just fine -- just do prefix searches on your
directories when you want to find all files in that directory or any
decendent directory, and use facet counds to see the list of decendent
directories and the number of files under each that match.



: Date: Wed, 07 Mar 2007 10:11:54 -0500
: From: Andrew Nagy <[EMAIL PROTECTED]>
: Reply-To: solr-user@lucene.apache.org
: To: Andrew Nagy <[EMAIL PROTECTED]>
: Cc: solr-user@lucene.apache.org
: Subject: Re: Hierarchical Facets
:
: Hmm ... I had a brain storm.
:
: Could I do something like this:
: <collection>Dir1/Subdir1/SubSubDir1</collection>
:
: Then query collection:"Dir1/Subdir1" and get the facets on collection
at
: that point to see all of the subsubdirectories?
:
: Is their any better method?
:
: Andrew
:
: Andrew Nagy wrote:
: > I am running into a stumbling block and can only find a way to solve
: > the problem with some sort of hierarchical faceting system.  I am in
: > the process of moving my records from eXist (http://exist.sf.net) to
: > Solr, but the problem is with the lack of a "directory structure"
that
: > exist has.  I figure I could easily solve this problem by setting a
: > field called "collection" and then faceting on that field to get my
: > list of "directories" however this will not allow me to do
: > subdirectories.
: >
: > Any ideas on how to implement such a thing in solr?
: >
: > Thanks!
: > Andrew
: >
:



-Hoss

Reply via email to