[1.x, 2.0] Search with quoted phrases

Started by MrPhil, June 25, 2012, 12:17:30 PM

Previous topic - Next topic

MrPhil

(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.

Arantor

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.

MrPhil

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?

Arantor


emanuele

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.

Arantor


emanuele



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.

Arantor

Awesome :)

Which means this is less a bug in core SMF and more a bug in Sphinx/API...?

Advertisement: