问题描述
我正在构建一个搜索数据库并显示结果的 C# Windows 窗体应用程序.我正在尝试找到有关如何使用 Lucene 创建构面的指南,但似乎我做不到.我正在创建索引,并且可以搜索数据库,但我想为结果创建方面.是否有任何指南或项目可用作示例?
I am building a C# windows form application that searches a database and displaying the results. I am trying to find a guide on how to create facets with Lucene but it seems that I can't. I am creating the index and I am able to search a database but I want to create facets for the results. Is there any guide or a project to use as example?
EDIT这是到目前为止我的项目的链接https://github.com/assignment128A-adopse/Assignment
EDIT here's the link to my project so far https://github.com/assignment128A-adopse/Assignment
任何帮助/建议都会有所帮助
any help/suggestion would be helpful
推荐答案
有几个选项.
在 Lucene.Net 4.8.0 中,您可以使用 Lucene.Net.Facet 模块来设置分面搜索.请参阅 Lucene API 文档.
In Lucene.Net 4.8.0, you can use the Lucene.Net.Facet module to setup faceted search. See the Lucene API documentation.
您可以使用 Simple Faceted Search contrib 项目,但据我所知,它只会为您分组并获取它们的计数.我相信,如果您需要实际列出与所选方面匹配的内容,您必须自己构建它.
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/简单+分面+搜索
https://github.com/apache/lucenenet/tree/812e1c541f1a00392391c5761fd3dcb7b0aedd88/src/contrib/SimpleFacetedSearch
https://github.com/apache/lucenenet/blob/3.0.3/test/contrib/SimpleFacetedSearch/TestSimpleFacetedSearch.cs
使用 BoboBrowse.Net.它是一个全面的搜索引擎,不仅可以计算方面的数量,还允许选择方面以及检索具有内置排序和分页的匹配列表.还有很多内置的 facet 类型,例如范围和地理位置.
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.
- 对于 Lucene.Net 3.0.3 - (NuGet 页面, 演示 1,演示 2)
- 对于 Lucene.Net 2.9.4
- For Lucene.Net 3.0.3 - (NuGet page, Demo 1, Demo 2)
- For Lucene.Net 2.9.4
注意,虽然演示在MVC中完成,但在Windows表单中将其设置为类似(实际上更容易,因为您无需使用AJAX在选择更改时重新加载结果).
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).
使用 SOLR.这是一个在 Java 上运行的基于服务器的解决方案,可以设置为分面搜索.
Use SOLR. It is a server-based solution that runs on Java that can be set up to do faceted search.
还有一个 SOLR 的 .NET 客户端 - (faceting 文档)
这篇关于如何使用 Lucene.Net 创建构面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!