News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Is SMF search behaving like it should?

Started by Biology Forums, April 27, 2019, 12:21:43 PM

Previous topic - Next topic

Biology Forums

Search query: Link

Why are words like 'at' being highlighted within other words like "aggregate" or "relationship"? Is that normal?

I'm use a full index and the settings:

✓ Force the use of a search index
✓ Match whole words only

... are checked.

Arantor

Because highlighting and matching are entirely disconnected (it just highlights the results that have been found, it shouldn't be matching on them as well)

Biology Forums

What can I do to prevent these tiny words from from being highlighted, I find it distracting.

Arantor

Rewrite how the highlighting works, I guess? It was made closer in 2.0 to what you want but it cannot match exactly because SMF has no access to exactly what or how MySQL matched it.

Biology Forums

So possibly an argument within the highlight function stating not to highlight words less than 4 letters, for example? Otherwise, how would you approach it?

Arantor

How I'd do it is well out of scope for SMF to tackle; I'd rewrite it to use ElasticSearch which has better tokenisers and stemming, and then make ElasticSearch do the highlighting since it knows what it used to actually do matching - right now, what SMF does is hand it to MySQL and try to make sense of it afterwards, which it doesn't know enough to do that.

Biology Forums

That sounds extremely complicated, I'll try to think of an alternative

Advertisement: