如何使用Lucene.Net创建构面 [英] How to create facets with Lucene.Net

查看:70
本文介绍了如何使用Lucene.Net创建构面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个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?

编辑,这是到目前为止我的项目的链接 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.这是一个全方面的搜索引擎,不仅可以计算方面数,还可以选择方面,并通过内置的排序和分页功能检索匹配项列表.还有很多内置的方面类型,例如范围和地理位置.

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.

  • 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客户端-( 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆