设置solr搜索项所需的字符 [英] Set solr search term required characters

查看:77
本文介绍了设置solr搜索项所需的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们可以在Solr中的哪里设置Solr搜索项中必需字符的限制?

Where in Solr can we set the limit for required characters in Solr search terms?

例如,我想将搜索词的字符数限制设置为无,这将返回所有结果

For example, I want to set the search term characters limit to nothing which should return all the results

另一个例子-

假设,我想将搜索词的字符数限制设置为5.因此,当我搜索"apple"(5个字符)或"orange"(5个字符或更多)时,应该返回结果.在这种情况下,如果我搜索"cat",则它不应返回任何结果,因为所需的最小字符为5.

Suppose, I want to set the search term characters limit to 5. So when I search for "apple" (5 characters) or "orange" (5 characters or more) should return results. In this case, if I search for "cat", it should not return any results as the minimum required characters is 5.

我们在哪里为Solr中的搜索词设置所需的字符限制?

推荐答案

如果您不想索引和/或搜索带有预定义字符间隔的字词,则可以通过在分析器中配置LengthFilter来实现(在索引处和/或查询时间取决于您的特定需求)

If you don't want to index and / or search terms with a predefined interval of characters you can do that by configuring a LengthFilter in your analyzer (at index and / or query time depending on your specific needs)

在这里看到:

http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.LengthFilterFactory

这篇关于设置solr搜索项所需的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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