solr找不到用blanko分隔的两个特殊标志(例如:!!)



solr找不到用blanko分隔的两个特殊符号(例如:!!)我有这个索引:

http://localhost:8983/solr/koolcha/get?id=547deb3649dbae548b0f0100

{
  "doc": {
    "status": "xxxxxx",
    "updated": "2014-12-05T09:47:27Z",
    "ns": "foo3.bags",
    "created": "2014-12-02T16:39:18Z",
    "_ts": 6.2177735253447e+18,
    "label": "_DSC0571.tif",
    "project": "xxxxx",
    "assignee": "xxxxx",
    "folderid": "! !",
    "_version_": 1.5180111153642e+18,
    "_id": "547deb3649dbae548b0f0100",
    "bagid": "xxxxx"
  }
}

当我尝试按"folderid"搜索时http://localhost:8983/solr/koolcha/select?q=folderid:\!%20\!solr没有找到任何

<response>
    <lst name="responseHeader">
        <int name="status">0</int>
        <int name="QTime">0</int>
        <lst name="params">
            <str name="q">folderid:! !</str>
        </lst>
    </lst>
    <result name="response" numFound="0" start="0"/>
</response>

如果我加上其他值,它也会起作用,即使有特殊的标志,例如"!!"将起作用。只有特殊符号和空格的组合才不会返回任何内容。这是Solr中的一个bug吗?或者我做错了什么?

除了转义,我认为您还必须引用过滤器查询:

 http://localhost:8983/solr/koolcha/select?q=folderid:"! !"  

并使用Lucene查询解析器(您可能已经这样做了)。

最新更新