我有这样的数据:Solr的查询 - 不能正确文本匹配
{
"id": "maxtor",
"compName_s": "Maxtor Corporation",
"address_s": "920 Disc Drive Scotts Valley, CA 95066",
"_version_": 1526862455621288000
}
当我写这篇文章:
的Solr /核心/选择Q = compName_s%3A *迈拓* &?重量= XML &缩进=真& HL =真& hl.fl = compName_s & hl.simple.pre = & hl.simple.post = <%2Fem>
返回此:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1</int>
<lst name="params">
<str name="q">compName_s:*Maxtor*</str>
<str name="hl">true</str>
<str name="hl.simple.post"></em></str>
<str name="indent">true</str>
<str name="hl.fl">compName_s</str>
<str name="wt">xml</str>
<str name="hl.simple.pre"><em></str>
</lst>
</lst>
<result name="response" numFound="1" start="0">
<doc>
<str name="id">maxtor</str>
<str name="compName_s">Maxtor Corporation</str>
<str name="address_s">920 Disc Drive Scotts Valley, CA 95066</str>
<long name="_version_">1526862455621287937</long>
</doc>
</result>
<lst name="highlighting">
<lst name="maxtor">
<arr name="compName_s">
<str><em>Maxtor Corporation</em></str>
</arr>
</lst>
</lst>
</response>
所有它的确定,但是,当我将尝试这个办法:?
的Solr /核心/选择Q = compName_s%3AMaxtor &重量= XML & indent = true & hl = true & hl.fl = compName_s & hl.simple.pre = & hl.simple.post = <%2Fem>
(compName_s:*迈拓*到compName_s:迈拓)
返回此:
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
<lst name="params">
<str name="q">compName_s:Maxtor</str>
<str name="hl">true</str>
<str name="hl.simple.post"></em></str>
<str name="indent">true</str>
<str name="hl.fl">compName_s</str>
<str name="wt">xml</str>
<str name="hl.simple.pre"><em></str>
</lst>
</lst>
<result name="response" numFound="0" start="0"></result>
<lst name="highlighting"/>
</response>
我想回到这个:
<lst name="highlighting">
<lst name="maxtor">
<arr name="compName_s">
<str><em>Maxtor</em> Corporation</str>
</arr>
</lst>
</lst>
(我想只获得“迈拓”)
确切的问题是什么?请问你请详细说明一下吗? –
我想这个 迈拓公司 –
bushpop
但也有没有结果那么查询如何才能得到上述格式......当您找到结果或匹配数据时会有所不同,而对于不匹配的数据则会有所不同。 –