Solr query in a pdf file, is not returning highlighting content

会有一股神秘感。 提交于 2019-12-07 02:35:30

It is a very common and simple mistake :

"stored":"false" should be "stored":"true" for the 'content' field.

Currently all the highlighters require the field to be stored to be used [1] .

[1] https://cwiki.apache.org/confluence/display/solr/Highlighting

SOLVED: the solution that worked for me finally, was to replace the _text_ field in schema with this curl command:

curl -X POST -H 'Content-type:application/json' --data-binary '{
 "replace-field" : {
 "name":"_text_",
 "type":"text_general",
 "indexed":"true",
 "stored":"true",
 "multiValued":"true"
 }
}' http://localhost:8983/solr/ex/schema

This is because the _text_ field comes with "stored":"false" by default.

NOTE: Remember to indexing all files again to your core if you did it prior to this schema field replace

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!