Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Biology Forums on April 27, 2019, 12:21:43 PM

Title: Is SMF search behaving like it should?
Post by: Biology Forums on April 27, 2019, 12:21:43 PM
Search query: Link (https://biology-forums.com/index.php?action=search2;search=MPC%20is%20constant,%20at%20an%20aggregate%20income%20level%20of;searchtype=0;show_complete=0;subject_only=0;minage=0;maxage=9999)

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.
Title: Re: Is SMF search behaving like it should?
Post by: Arantor on April 27, 2019, 12:49:29 PM
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)
Title: Re: Is SMF search behaving like it should?
Post by: Biology Forums on April 27, 2019, 02:09:11 PM
What can I do to prevent these tiny words from from being highlighted, I find it distracting.
Title: Re: Is SMF search behaving like it should?
Post by: Arantor on April 27, 2019, 02:15:51 PM
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.
Title: Re: Is SMF search behaving like it should?
Post by: Biology Forums on April 27, 2019, 02:32:02 PM
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?
Title: Re: Is SMF search behaving like it should?
Post by: Arantor on April 27, 2019, 02:33:52 PM
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.
Title: Re: Is SMF search behaving like it should?
Post by: Biology Forums on April 27, 2019, 04:38:05 PM
That sounds extremely complicated, I'll try to think of an alternative