Advertisement:

Author Topic: [1.x, 2.0] Search with quoted phrases  (Read 7789 times)

MrPhil

  • Guest
[1.x, 2.0] Search with quoted phrases
« on: June 25, 2012, 12:17:30 PM »
(see http://www.simplemachines.org/community/index.php?topic=479967.msg3360137#msg3360137)

SMF search is not working as would rationally be expected, when "quoted phrases" are used. For example, Google will search "a brown kitten" and match only that phrase (punctuation is dropped, so a brown-kitten would be matched). SMF will split up the phrase into three words and search for them individually, returning far too many results. It will even search for the word 'a', which would be excluded as too short if given without quotes: a brown kitten. I admit that this may only be affecting the "teaser" for the found post, and not which posts are found in the first place, but to have every 'a' in the post highlighted is annoying at the least. I would expect to see only the sequence of words a brown kitten highlighted in the results.

To match what Google does and produce the logical expected result, SMF could still split up a quoted phrase into its individual words and search for them. However, it should highlight only sequences where the words are all present and in order. So, text "a brown-kitten" would be matched by pattern "a brown kitten". The letter 'a' would be highlighted only if part of a brown kitten.

I'm not sure if SMF is consistently handling which posts are searched and returned. When I tested this in the Feature Request (link above), it appeared to return every post in that topic with a brown kitten appearing (even though it highlighted all the 'a's). However, when I searched Community from this new topic entry, it only returned the post I had just made in that topic. It seems inconsistent.

P.S. If I search for "q brown kitten", all quotation marks " get turned into " and are displayed thusly, with the 'q' highlighted. A separate bug.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,631
    • StoryBB/StoryBB on GitHub
Re: [1.x, 2.0] Search with quoted phrases
« Reply #1 on: June 25, 2012, 12:20:36 PM »
Again, as per the referenced thread, how exactly are you testing these?

What search backend are you using? Do you know this occurs on 1.1.x or is that hypothetical (given how search was *totally* rewritten for 2.0, I'd be surprised it has the same bug)?

Again, if you tested it here, all bets are off.
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.

MrPhil

  • Guest
Re: [1.x, 2.0] Search with quoted phrases
« Reply #2 on: June 25, 2012, 12:29:41 PM »
It does this on this very forum, as well as a 1.1.14 forum I'm on. Give it a try -- do you get different results than I do?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,631
    • StoryBB/StoryBB on GitHub
Re: [1.x, 2.0] Search with quoted phrases
« Reply #3 on: June 25, 2012, 12:34:16 PM »
What search index are you using?
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 emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: [1.x, 2.0] Search with quoted phrases
« Reply #4 on: June 25, 2012, 12:51:38 PM »
Cannot reproduce it on a clean install (with a 50k posts).


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,631
    • StoryBB/StoryBB on GitHub
Re: [1.x, 2.0] Search with quoted phrases
« Reply #5 on: June 25, 2012, 12:55:17 PM »
And which search index are you using?
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 emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: [1.x, 2.0] Search with quoted phrases
« Reply #6 on: June 25, 2012, 12:57:35 PM »
Tested with:
* none
* fulltext
* custom


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 69,631
    • StoryBB/StoryBB on GitHub
Re: [1.x, 2.0] Search with quoted phrases
« Reply #7 on: June 25, 2012, 01:04:09 PM »
Awesome :)

Which means this is less a bug in core SMF and more a bug in Sphinx/API...?
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.