开发者

Solr highlighting : extract complete sentence

开发者 https://www.devze.com 2023-03-08 05:01 出处:网络
As I\'m sayin开发者_运维问答g in title, i want to get a complete sentence when i search with highlighting.

As I'm sayin开发者_运维问答g in title, i want to get a complete sentence when i search with highlighting.

Actually, i get a result which is cut in middle of a word.

For example, if I'm searching for the word "complete", I get ying in title, i want to get a complete sentence wh but I want the complete sentence As I'm saying in title, i want to get a complete sentence when i search with highlighting.

I've already tried to use "fragmenter" but I haven't any result.

Can anyone help me ?

Thanks and sorry for my english.


Also check if your request handler or query parameter has hl.useFastVectorHighlighter set to true. If the field that it generates summaries on are not set up with the correct term settings as mentioned in the wiki, the words could cut as you describe.


I think you find your answer here: http://wiki.apache.org/solr/HighlightingParameters

Take a look at the parameter hl.snippets and hl.fragsize, wehere you can define the length of the returned fragment - so you could set the value to the fieldsize (if the field isn't so large).

An other interesting parameter in your case is hl.fragmenter


got almost the same problem cutting words. As I just mentioned over here you could use another BoundaryScanner. This gave me perfect results.

0

精彩评论

暂无评论...
验证码 换一张
取 消