How to create facets with Lucene.Net

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 14:38:40

There are a few options.

Option #1

In Lucene.Net 4.8.0, you can use the Lucene.Net.Facet module to setup faceted search. See the Lucene API documentation.

Option #2

You could use the Simple Faceted Search contrib project, but as far as I can tell, it only groups the facets for you and gets their count. I believe that if you need to actually list what matches the selected facets you have to build it yourself.

https://cwiki.apache.org/confluence/display/LUCENENET/Simple+Faceted+Search

https://github.com/apache/lucenenet/tree/812e1c541f1a00392391c5761fd3dcb7b0aedd88/src/contrib/SimpleFacetedSearch

https://github.com/apache/lucenenet/blob/3.0.3/test/contrib/SimpleFacetedSearch/TestSimpleFacetedSearch.cs

Option #3

Use BoboBrowse.Net. It is a full faceted search engine that not only works out the facet counts, but allows facets to be selected as well as retrieving the list of matches with built in sorting and paging. There are also lots of built-in facet types such as ranges and geo-location.

Note that although the demos are done in MVC, setting it up in Windows Forms is similar (easier actually because you don't need to use AJAX to reload the results when the selections change).

Option #4

Use SOLR. It is a server-based solution that runs on Java that can be set up to do faceted search.

There is also a .NET client for SOLR - (faceting documentation)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!