Hi Tony, I put together a demo for faceting using `KeywordField` [1]. Hopefully that answers some of your questions.
A path would be a sequence of hierarchical labels that a document belongs to. For example, a book could be published on a certain day, of a certain month, of a certain year, making for a path like `Publish Date/2023/11/16`. When faceting, you could get counts with respect to each of the labels in the path (e.g. counts per year or counts per month of given year). Stefan [1] https://github.com/apache/lucene/pull/12817 On Wed, 15 Nov 2023 at 01:01, Tony Schwartz <t...@xfire.io.invalid> wrote: > I have a lot of questions. For example, the javadocs for the > "KeywordField" class says: "... doc values for sorting and faceting" > > Yet, I don't see a way with 9.8.x Lucene to perform faceting on fields > that haven't been specifically indexed for faceting. I clearly need a > lesson or two on faceting in Lucene. I don't understand what a "path" is > for example. Of course I have tried to work with the examples, but unless > I completely rework my indexes, I'm stuck. I thought you could use > DocValues somehow to facilitate faceting queries. Anyway, I suppose I'll > need to use the source code as my guide and spend a lot of time working > with it. I was hoping to find some really good documentation to help me > cut to the chase. I appreciate you offering to help answer any questions, > seems like I could use an interactive session 😊 > > Thanks! > > Tony > > > -----Original Message----- > From: Stefan Vodita <stefan.vod...@gmail.com> > Sent: Tuesday, November 14, 2023 19:14 > To: t...@xfire.io.invalid > Cc: java-user@lucene.apache.org > Subject: Re: Faceting Queries NON-Taxonomy-based > > Hi Tony, > > Have you looked at the faceting demo package [1]? > > The faceting documentation that lives there [2] was updated last year > (thanks > @epotyom!) and there haven't been major API changes since. > > The `SimpleSortedSetFacetsExample` [3] might be a good starting point for > what you're trying to do. > > If you've already checked these resources, is there a specific question > they didn't help answer? > > > Stefan > > > [1] > > https://github.com/apache/lucene/tree/main/lucene/demo/src/java/org/apache/lucene/demo/facet > [2] > > https://github.com/apache/lucene/blob/main/lucene/demo/src/java/org/apache/lucene/demo/facet/package-info.java > [3] > > https://github.com/apache/lucene/blob/main/lucene/demo/src/java/org/apache/lucene/demo/facet/SimpleSortedSetFacetsExample.java > > On Tue, 14 Nov 2023 at 18:51, Tony Schwartz <t...@xfire.io.invalid> wrote: > > > Hello, > > > > > > > > Is there a definitive (or at least very good) documentation or video > > on Lucene faceting? I find the existing docs and samples out-dated > > and inaccurate. As such, I'm having trouble getting my mind around > > how it works to ensure I index my documents in such a way as to allow > > faceting. I'm trying to avoid the "taxonomy-based" approach. > > > > > > > > Tony > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > >