I'd like to know how to perform a faceted search using lucene.facet. I'll explain exactly what I want to do: I've got a taxonomy of htmlfiles (similar to ODP) and I want that, given a query, display results by categories and number of hits per category. Is there any example describing that with lucene?
Edit: I already get results as categories by adding a category field in each document. What i want is that results appear as:
Cat1 N1
Cat2 N2
...
Instead of:
Cat1
Cat1
... xN1 times
Cat1
Cat2
... xN2 times
Cat2
...
Also, this category field only refers to a level of the taxonomy tree and I want to exploit the taxonomy structure by, for example, being able to select the depth of the search in the taxonomy (I don't know if this is clear..).
Thank you!
Since solr and lucene are merged together since 3.0 anyway, I would strongly recommend to use solr instead of plain lucene to do facetted search.
You do not have to use the whole solr with a http server.
Try an EmbeddedSolrServer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With