【发布时间】:2011-06-27 13:56:59
【问题描述】:
我是 Apache Solr 的新手,并尝试使用搜索词对名为“normalizedContents”且类型为“text”的字段进行查询。
所有搜索词必须存在于该字段中。问题是,我得到的结果不一致。
例如,solr 索引只有一个文档,其 normalizedContents 字段的值 = "EDOUARD SERGE WILFRID EDOS0004 UNE MENTION COMPLEMENTAIRE"
我在 solr 的网页界面中尝试了这些查询:
- normalizedContents:(edouard AND une) 返回结果
- normalizedContents:(edouar* AND une) 返回结果
- normalizedContents:(EDOUAR* AND une) 不返回任何内容
- normalizedContents:(edouar AND une) 不返回任何内容
- normalizedContents:(edouar* AND un) 返回结果(虽然没有“un”字)
- normalizedContents:(edouar* AND uned) 返回结果(虽然没有“uned”字样)
这是 schema.xml 中 normalizedContents 的声明:
<field name="normalizedContents" type="text" indexed="true" stored="true" multiValued="false"/>
因此,通配符和 AND 运算符不符合预期的行为。我做错了什么?
谢谢。
【问题讨论】:
-
您是否对 normalizedContents 应用了任何令牌过滤器?第三行可以用小写过滤器解决,最后两行用 WS 过滤器(空白)。