Solr 通配符搜索问题

发布于 2024-12-05 14:15:32 字数 2154 浏览 1 评论 0原文

我在 solr 搜索中遇到问题...通配符搜索似乎工作正常,但当我尝试在另一个单词中查找术语时出现问题...例如:“rtebiggestBug”,当我搜索 Maximum ,它不会给出任何结果。我在 schema.xml 文件中添加了以下条目

 <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
     <!--   <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>-->
        <filter class="solr.LowerCaseFilterFactory"/>
     <!--   <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> -->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="50" preserveOriginal="1"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
    <!-- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>-->
        <filter class="solr.LowerCaseFilterFactory"/>
      <!--  <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>-->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

另一个问题是,它在单词末尾找不到字符串。示例:我搜索“bug”,发现了 bug,而不是“samplebug”一词。

如果您能在这个问题上帮助我,那将非常有帮助。

提前致谢。

I am facing an issue in the solr search....The wild card search seems to be working fine but there are issues when i am trying to find terms within another word.....For example: "rtebiggestBug", when i search for biggest , it doesn't give any results.I have the following entries made in the schema.xml file

 <fieldType name="text" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <!-- in this example, we will only use synonyms at query time
        <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" ignoreCase="true" expand="false"/>
        -->
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
     <!--   <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>-->
        <filter class="solr.LowerCaseFilterFactory"/>
     <!--   <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/> -->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
        <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="50" preserveOriginal="1"/>
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.WhitespaceTokenizerFactory"/>
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt"/>
    <!-- <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>-->
        <filter class="solr.LowerCaseFilterFactory"/>
      <!--  <filter class="solr.EnglishPorterFilterFactory" protected="protwords.txt"/>-->
        <filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
      </analyzer>
    </fieldType>

Another issue is,it does not find strings at the end of the word. Example: I searched on “bug” and found bugs and not the word "samplebug".

It would be really helpful if you could help me on this issue..

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泪冰清 2024-12-12 14:15:32

默认情况下,Solr 不支持左截断,例如搜索 *bug 来查找 samplebug

使用 solr.ReversedWildcardFilterFactory 来反转术语并以受人尊敬的方式索引热值,例如 gubelpmas 。 solr.ReversedWildcardFilterFactory

这是一个教程:http://solr.pl/en/2010/12/20/wildcard-queries-and-how-solr-handles-them/

By default Solr does not support left truncation, like searches for *bug to find samplebug.

Use the solr.ReversedWildcardFilterFactory in order to reverse the term and index the therm in an revered way, like gubelpmas. solr.ReversedWildcardFilterFactory

Here is an tutorial: http://solr.pl/en/2010/12/20/wildcard-queries-and-how-solr-handles-them/

半岛未凉 2024-12-12 14:15:32

您的查询解析器似乎无法处理前导通配符搜索。

您使用什么查询解析器?

扩展 dismax 查询解析器支持使用前导通配符进行搜索。你想检查一下。

It seems your query parser is not able to handle leading wildcard searches.

What query parser are you using ?

The Extended dismax query parser supports searches with leading wildcards. you want to check for it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文