0
我在Solr中设置了一个全新的代码,并没有更改任何默认设置。我索引两个下列文件:查询Solr时出现奇怪的行为
<add>
<doc>
<field name="id">weight loss</field>
<field name="text_en">weight loss</field>
</doc>
</add>
和
<add>
<doc>
<field name="id">weight loss2</field>
<field name="text_en">I strongly suspect that weight loss .</field>
</doc>
</add>
我执行一个简单的一句简单的话查询:
select?hl.fl=text_en&hl=on&indent=on&q="weight loss"&wt=json
我得到这两个文件的结果,但没有高亮!
"response":{"numFound":2,"start":0,"docs":[
{
"id":"weight loss",
"text_en":["weight loss"],
"_version_":1545688757336801280},
{
"id":"weight loss2",
"text_en":["I strongly suspect that weight loss ."],
"_version_":1545688757344141312}]
},
"highlighting":{
"weight loss":{},
"weight loss2":{}}}
当我添加参数DF = text_en查询前面提到的,我得到凸显,但结果只有一个!
"response":{"numFound":1,"start":0,"docs":[
{
"id":"weight loss",
"text_en":["weight loss"],
"_version_":1545688757336801280}]
},
"highlighting":{
"weight loss":{
"text_en":["<em>weight loss</em>"]}}}
此外,当我包括DF = text_en参数,但请从短语项报价:
http://localhost:8983/solr/test2/select?df=text_en&hl.fl=text_en&hl=on&indent=on&q=weight loss&wt=json
我不明白这种行为在所有。为什么我没有在第一个案件中突出显示?为什么在第二和第三种情况下分别匹配和不匹配?
您需要更改** ** text_en向** ** text_general类型的管理模式,以获得亮点为第二case.' <字段名=“text_en” TYPE =“text_general “indexed =”true“stored =”true“/>' –