Fix Highlighting when searching with multiple words

Not a big deal, but a little annoying. When you search with multiple words, example: “Darkness world”, the search results and highlighting don’t seem to match up. The search results include entries where the words “Darkness” and “world” appear anywhere in the entry, however the highlighting being applied requires them to be single spaced apart, and as a result highlights don’t appear in many (all?) of the results.

This seems due to the way the highlighting is being handled. Right now, it appends “?highlight=darkness+world” to the URL. I’ve been manually fixing this by switching it to “?highlight=darkness&highlight=world” and the highlights seem to work as I would expect.

Would be nice if this is how it was handled by default.

1 Like

That’s a fair point. I think the difficulty is in things like “Lord Saladin”… do you want it to highlight every instance of the word “Lord”? Even if it is in front of “Felwinter”? That seems a bit excessive.

But I accept your point, it could definitely be better. Thanks for your feedback, I will give this some thought.

If it is in quotes, it would all be in the one highlight so that only instances of “Lord Saladin” would be highlighted. If it is not in quotes, that’s when you’d want to highlight instances of “Lord” and “Saladin” separately.

These are just my thoughts / opinions though.

Could it function off of an on/off switch? That way you can choose to either search for the entire text or each word individually. Would that work?

The biggest problem to me is the disconnect between the search results and the highlighting… The search results don’t care that the separate words aren’t next to each other, while the highlighting requires it. It would just be nice if they matched.

This isn’t really intended to change anything with the search, if you wanted to search for the entire text you just put it in quotes, searching for things without quotes just pulls up results where all the words occur in the text somewhere. That all seems fine to me.