Hi Some of my users are very "conservative" as it seems :) The complained about "not finding anything useful", because the highlighted sample was wrongly colored when doing phrase search, e.g. "some word". So they refused to use web search at all and keep telephoning around. Not the found phrase was highlighted in one color, but all locations of these words within the sample in different colors. "This result is wrong" was their complaint when looking at the sample. So I had to disable phrase highlighting at all like this: query: <!-- highlight only if Query does not contain PHRASE --> $if{$eq{$substr{$query,0,1},"},$field{sample},$highlight{$field{sample},$terms}}$if{$field{sample},...} (works only if the phrase is the first term, but that 99.9% the case) If time permits please adjust omega highlighting for phrases. My time is currently very limited unfortunately. -- Reini Urban http://phpwiki.org/? ? ? ? ?? http://murbreak.at/
On Thu, Mar 10, 2011 at 01:36:40PM +0100, Reini Urban wrote:> So I had to disable phrase highlighting at all like this: > > query: > <!-- highlight only if Query does not contain PHRASE --> > $if{$eq{$substr{$query,0,1},"},$field{sample},$highlight{$field{sample},$terms}}$if{$field{sample},...}You really want $html{$field{sample}} for the first occurrence there, so that characters get escaped properly ($highlight does this as well as highlighting). This (untested) approach should spot any phrase (including ones from hyphenation, etc): $if{$find{$list{$querydescription},PHRASE},$html{$field{sample}},$highlight{$field{sample},$terms}}$if{$field{sample},...}> If time permits please adjust omega highlighting for phrases. My time > is currently very limited unfortunately.Yes, it would be good to handle this. Can you open a ticket please? Cheers, Olly