full-text-search - Lucene 检查的搜索条件

标签 full-text-search lucene.net umbraco

我正在尝试为包含文本文章中存储的信息的网站构建合理的搜索机制。我正在 umbraco lucene 的检查中进行搜索。

所以,假设我正在搜索的字段是“bodyText”和“titleText”,

我为过滤器想出的是这样的:

var filter = criteria
           .GroupedOr(new string[] { "bodyText","titleText"}, SearchTerm)
           .Compile();

更好的搜索的示例是什么,例如,其中包括包含 SearchTerm 的结果(“literate”将是“iter”搜索的结果),或该搜索的任何其他改进?

最佳答案

你尝试过Fuzzy()吗?

来自http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine.aspx

Sometimes users will query your site looking for a term that they could have misspelled or is very close. Fuzzy gives you the ability to get Lucene to look for terms that look like your term. Eg mound could actually be sound.

var query = searchCriteria.Fields("nodeName","hello".Fuzzy(0.8)).Compile();

The optional value you pass into Fuzzy between 0 and 1 specifies how Fuzzy or how close the match is to the original. For instance a match of 0.5 will not return when a threshold of 0.8 is specified.

我不太确定语法是否正确,但可以尝试一下。它实际上可能不会进行部分单词搜索,但可能会提供更接近您要查找的结果。

关于full-text-search - Lucene 检查的搜索条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8273044/

相关文章:

ruby-on-rails - 在 Ruby On Rails 中搜索

elasticsearch - 如何优化Elasticsearch的全文搜索以匹配 'C++'之类的字符串

lucene - 如何在 Lucene.Net 4.8 中使用 HIGH_COMPRESSION

azure - Azure VHD 初始化非常慢 (Lucene.Net)

Umbraco Contour 多步表单 - 根据用户输入决定下一步

php - 使用 php 对大型词典执行搜索

java - 使用 Lucene 将整个数据库索引到单个文档中

javascript - 使下拉菜单可见的javascript

c# - 在 Umbraco 中调用 node.NiceUrl 给我 #