Solr 用查询字符串搜索@returns所有记录

Solr search with query string @ returns all the records

我在搜索“@”时遇到了 solr 搜索问题 returns 所有记录。如何解决这种情况,如果没有带 @ 符号的记录也会 returns 所有记录。

下面一个是我的url

http://localhost:8983/solr/oneteam/select?q=caption:/.@./ OR description:/.@./

谁能帮我解决这个问题。

致谢

附加到字段类型默认定义的分析器和过滤器序列text_general uses the StandardTokenizer:

The "@" character is among the set of token-splitting punctuation, so email addresses are not preserved as single tokens.

这意味着 @ 符号不会保留,因为它们用于拆分文本。如果您需要保留 @ 来搜索它,请改用 string 字段类型(如果这是一个经常执行的搜索,您可能希望将其压缩为一个字段如果文档匹配搜索(即字段包含 @),则仅包含 1,以避免必须针对索引中字段的所有值执行正则表达式。