Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
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")


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
Posted
Updated 4-Jul-11 1:19am
v4

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
 
Share this answer
 
Thanks Manfred,

I'll going to write the highlighting myself.

Wouter
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900