Webmastersite.net
Register Log In

Search Highlighting
Only applies to one field

Comments on Search Highlighting

mrowton
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan

Total Topics: 57
Total Comments: 185
mrowton
Posted Mar 29, 2006 - 12:27 PM:

If the description and title of a link both contain the search word, then only the search word in the descrition gets highlighted.

Can we change this so that the title gets highlighted first, or better yet, can we highlight each instance of the search word regardless of the field?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 30, 2006 - 6:32 AM:

It does. You're probably getting confused by the fact that the highlighting only considers something a word if it's bordered by spaces, so if the title it "All Experts HTML: Questions and Answers" the HTML there won't get highlighted in a search for it, and if a description is "Questions and answers about HTML." it won't there either.

I see no simple way around the problem at the moment. The current situation is actually a fix of when it was highlighting too much by not requiring spaces.

Edit: Nevermind, found a simple solution to include for 3.3.12.
mrowton
Forum Regular

Usergroup: Customer
Joined: Feb 19, 2004
Location: Michigan

Total Topics: 57
Total Comments: 185
mrowton
Posted Mar 30, 2006 - 7:06 AM:

Ok, I see that now.

If the user searches for "Word" could it also highlight "Words" and "Word's"?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 30, 2006 - 8:25 AM:

That would get too complicated for my lack of regex skills. My simple solution involves borrowing a regular expression from the php manual comments.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.