Advertisement:

Author Topic: Is SMF search behaving like it should?  (Read 1649 times)

Offline Biology Forums

  • SMF Hero
  • ******
  • Posts: 3,746
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Is SMF search behaving like it should?
« on: April 27, 2019, 12:21:43 PM »
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,600
    • StoryBB/StoryBB on GitHub
Re: Is SMF search behaving like it should?
« Reply #1 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)
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Biology Forums

  • SMF Hero
  • ******
  • Posts: 3,746
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: Is SMF search behaving like it should?
« Reply #2 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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,600
    • StoryBB/StoryBB on GitHub
Re: Is SMF search behaving like it should?
« Reply #3 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Biology Forums

  • SMF Hero
  • ******
  • Posts: 3,746
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: Is SMF search behaving like it should?
« Reply #4 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?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,600
    • StoryBB/StoryBB on GitHub
Re: Is SMF search behaving like it should?
« Reply #5 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Biology Forums

  • SMF Hero
  • ******
  • Posts: 3,746
    • StudyForcePS on Facebook
    • @studyforceps on Twitter
Re: Is SMF search behaving like it should?
« Reply #6 on: April 27, 2019, 04:38:05 PM »
That sounds extremely complicated, I'll try to think of an alternative