Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-21 19:54:28

makason
Member
From: Hilo, Hawaii
Registered: 2005-01-23
Posts: 34
Website

[request] better / advanced search

Looking for a solutiont take advantage of search with MySQL 4.1. The current TXP search does not work well when searching phrases or multiple words.

There was a old plugin ob_search but this plugin seems to be dead.

Offline

#2 2007-02-21 22:48:08

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [request] better / advanced search

Can you give specific examples of things not working as they should?

This may be more of a bug report or troubleshooting than a feature idea.

Offline

#3 2007-02-22 22:19:15

makason
Member
From: Hilo, Hawaii
Registered: 2005-01-23
Posts: 34
Website

Re: [request] better / advanced search

Hi Jeremie,

I have a article containing the phrase “Kona Beach Hotel”.

Search for “Kona Beach Hotel” returns the article as a result but not a search for “Kona Hotel”

Seems like when searching for multiple words or phrases like moset users do, the matching words have to be in order (next to each other)

There is also a old thread here:
http://forum.textpattern.com/viewtopic.php?id=12138&p=1

Offline

#4 2007-02-22 22:25:30

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: [request] better / advanced search

Indeed you’re right.

I’m still unsure if this is a bug, an issue, or a feature.

Mary, Alex?

Offline

#5 2007-02-22 22:55:28

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [request] better / advanced search

IIRC, they tried switching from RLIKE search (Kona.*Hotel will give results) to using the newer search features of MySQL somewhere late in the 4.0.4 development cycle but that was reverted before release. Not sure if that was due to some compatibility issues on older MySQL versions or due to a needed rewrite for the code that shows a relevant excerpt containing keywords in the search results.

Last edited by ruud (2007-02-22 22:56:43)

Offline

#6 2007-02-24 01:19:27

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: [request] better / advanced search

Neither. It has to do with the fact that you have to have a certain amount of articles before FULLTEXT will work properly. We need a better search, but changing it the way we wanted caused problems, so we reverted until we can sit down and work out a solution.

Offline

#7 2007-05-29 15:09:59

execov
New Member
From: Belgium
Registered: 2007-05-29
Posts: 5

Re: [request] better / advanced search

Does anyone already have a working plugin or some advice on how I can manage to do this? I think it’s a major issue, lot’s of people search for 2 words, but they don’t necessarily match with the order in a sentence.. I only get result when entering 2 words that appear in that same order (or just 1 word) , but if for exemple i have this sentence in an article :

“ the bravia is the newest product of sony”

i have no results when entering “sony bravia”, only when i enter sony , or bravia, or “the newest product”..

i found a site where someone proposes a hack into the search.php but this doesn’t seem to be working :s

(site here : http://rise.lewander.com/textpattern/80/textpattern-search-hack-volume-ii )

Offline

#8 2007-05-29 16:17:58

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [request] better / advanced search

You can try patching publish.php according to changeset 1885

That was an attempt to improve search behaviour in 4.0.4 (but was reverted before release). It’s not perfect, but could be a nice starting point if you don’t mind changing TXP files.

Offline

#9 2007-05-29 17:59:14

execov
New Member
From: Belgium
Registered: 2007-05-29
Posts: 5

Re: [request] better / advanced search

Thanks!! it works now, only prob, when i have the search results he doesn’t show an excerpt anymore? just the title ,date and everything, but no excerpt

Offline

#10 2007-05-29 19:48:38

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [request] better / advanced search

That’s correct. The code that shows the excerpt for the search result is still based on the old exact string match search method.

Offline

#11 2007-05-29 20:12:48

execov
New Member
From: Belgium
Registered: 2007-05-29
Posts: 5

Re: [request] better / advanced search

hmmm… a pity, any way to solve this or not possible at all?

thx for the quick replies

edit: is it possible to make the search like this ?

==> when typing for example “sony bravia” he only shows articles containing sony AND bravia? because now he shows articles with only “sony” in it too

Last edited by execov (2007-05-29 20:46:07)

Offline

#12 2007-05-29 21:34:25

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: [request] better / advanced search

It’s possible. But the articles matching both should appear at the top anyway (they score higher), so in the end the article that you want is at the top, you just get more results, which is nice if you entered one wrong keyword

Offline

Board footer

Powered by FluxBB