【问题标题】:What does it mean to say "Solr will not analyze queries"?说“Solr 不会分析查询”是什么意思?
【发布时间】:2016-12-05 17:32:14
【问题描述】:

遇到了这个声明“Solr 不分析通配符查询”here

当 * 或 ?被检测到,则分析器 type="query" 序列中的任何内容都不会运行。这也适用于标记器吗?

【问题讨论】:

  • 已编辑删除分析器 type=query 周围的尖括号。

标签: solr lucene


【解决方案1】:

说应用通配符查询时不进行分析是一个很好的规则(我自己也说过很多次),但有点错误。

确切的解释是 any tokenizer or filter that isn't MultiTermAware will be excluded,所以 Solr 试图在没有它们的情况下“做正确的事”。您可以在 type="multiterm" 键下定义自己的分析链(仅使用 MultiTermAware 组件),为多术语查询(例如通配符)定义自定义链。

唯一的tokenizer that is multitermaware as of 6.3 is LowerCaseTokenizer。此外,KeywordTokenizer 也可以工作,因为它会生成单个令牌。

你可以看到whole list of MultitermAware components in the 'implemented by' list of the API doc

【讨论】:

    猜你喜欢
    • 2014-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-14
    • 2011-05-26
    • 2021-07-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多