我在Apache Solr中索引了客户数据,包括姓名、地址、联系电话、出生日期等详细信息。
我尝试使用以下查询搜索索引,但无法获得任何结果。
http://locahost:8983/solr/customer/select?q=address:ATA-1234
这里,特殊字符“-”用于搜索联系号码字段。
- 根据文档(https://solr.apache.org/guide/7_3/the-standard-query-parser.html#escaping-special-characters)对转义反斜杠感到厌倦,但没有结果
http://locahost:8983/solr/customer/select?q=address:ATA\-1234
http://locahost:8983/solr/customer/select?q=address:"ATA\-1234"
http://locahost:8983/solr/customer/select?q=address:"ATA-1234"
- 已尝试使用关键字令牌化器工厂和空白空间令牌化器工厂(https://solr.apache.org/guide/7_2/tokenizers.html#keyword-tokenizer),但没有结果
- 是否会对通配符和模糊搜索执行文本分析?下面的查询是否有效?
http://locahost:8983/solr/customer/select?q=contact:*01\-1234*
有人能澄清一下上述疑问吗?
1条答案
按热度按时间7uzetpgm1#
下面的查询可以很好地使用正斜杠(/)。
示例:输入值:“三星SpinPoint P120 SP2514 N-硬盘驱动器- 250 GB - ATA-133”
使用StandardTokenizer时,值被拆分为如下标记
使用ClassicTokenizer,值被拆分为如下标记。