我正在使用 scorched 将我的 Django 代码与我的 Solr 实例连接:
response = si.query(DismaxString(querydict.get('q')).execute()
在我正在搜索的数据中,我有冒号(例如 Col: Mackay's Reel),我不希望 Solr 将该冒号解释为“字段”查询:
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"undefined field Col"
如何转义用户在查询中输入的所有冒号?
即使直接在 Solr 查询界面上,我也会收到错误消息。