使用Lucene.net 2.0突出显示精确的单词组合 [英] Highlighting exact word combination using Lucene.net 2.0

查看:101
本文介绍了使用Lucene.net 2.0突出显示精确的单词组合的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用Lucene.NET 2.0.我试图在三个字段中搜索确切的单词组合,我的搜索查询如下:

Hi all,

I''m using Lucene.NET 2.0. I''m trying to search for an exact word combination into three fields, my search query is as follow:

+(title:"overgang bromfiets" figure:"overgang bromfiets" contenttext:"overgang bromfiets")



我发现的搜索结果必须突出显示,但是单词 overgang bromfiets 分别突出显示.

有没有人知道如何对整个搜索命令" overgang bromfiets "进行分类?

感谢您提供所有答案.

问候,
Wouter Splinter



The search result which I found has to be highlighted, but the words overgang and bromfiets are highlighted seperately.

Has anyone an idea how to higihlighted on the whole search command "overgang bromfiets"?

Thanks for all answers.

Regards,
Wouter Splinter

推荐答案

Lucene中的hithighlighter仅对简单的无短语查询有效.当查询短语时,hithighlighter只会突出显示该短语中出现的所有搜索词.对不起!另请参阅此处有关此主题的内容: http://stackoverflow.com/questions/653229/using -highlighter-for-highlighting-phrase-query [ ^ ].

—MRB
The hithighlighter in Lucene only works correctly for simple non-phrase queries. When a phrase is queried the hithighlighter just highlights all the search terms that occurr in that phrase. Sorry! See also here on this topic: http://stackoverflow.com/questions/653229/using-highlighter-for-highlighting-phrase-query[^].

—MRB


感谢曼弗雷德,

我将自己写突出显示.

Wouter
Thanks Manfred,

I''ll going to write the highlighting myself.

Wouter


这篇关于使用Lucene.net 2.0突出显示精确的单词组合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆