Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-24 16:20:57

coopersita
Member
Registered: 2005-09-28
Posts: 68
Website

search is not looking at keywords

Hi,

I must be doing something wrong, because my search is not looking in the keyword field.

For example, I have many wallpaper images in my site. They all are in the “Free Desktop Wallpaper” category, and they all have the word “wallpaper” in the keyword field, but when I search for the word “wallpaper” I get no results.

I’ve been looking at the textbook, FAQ and forums, but can’t seem to find an answer. Is there a preference I didn’t set correctly?

Thanks

Offline

#2 2006-05-24 18:00:14

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: search is not looking at keywords

can we see the site?
( want to watch the search )

Offline

#3 2006-05-24 18:57:29

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: search is not looking at keywords

hmmmm….

there’s got to be an easy way to fix line on search.php (publish dir).
<code> $rs = safe_rows( “*, ID as thisid, unix_timestamp(Posted) as posted, Title as title, match (Title,Body,Keywords) against (‘$q’) as score”, “textpattern”, “(Title rlike ‘$q’ or Body rlike ‘$q’ or Keywords rlike ‘$q’) $s_filter and Status = 4 and Posted <=now() order by score desc limit 40”);
</code>
I modified it to look like this (added “Keywords” and “or Keywords rlike ‘$q’”). But that doesn’t seem to make it search the keywords field at all.

Offline

#4 2006-05-24 19:09:12

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: search is not looking at keywords

You will also have to add additional fields to MySQL’s full text index. See here for details (english version is in the bottom half of the page).

Last edited by wet (2006-05-24 19:09:33)

Offline

#5 2006-05-24 19:36:54

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: search is not looking at keywords

That didn’t work so hot for me. I altered the publish/search.php file with the same changes you mentioned. So I also offered publish.php. Still no workee.

This interests me though. I would like to see it work, so I can use keywords for searching (like knowledgebase sites, e.g.)

Offline

#6 2006-05-24 20:42:20

coopersita
Member
Registered: 2005-09-28
Posts: 68
Website

Re: search is not looking at keywords

The site in question is my own site (see signature)

Last edited by coopersita (2006-05-24 20:42:37)

Offline

#7 2006-05-24 21:35:26

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: search is not looking at keywords

gotcha. I was thinking “wallpaper” as in ecommerce selling paper for walls, not wallpaper as in desktop backgrounds.

:)

Offline

#8 2006-05-24 21:46:15

coopersita
Member
Registered: 2005-09-28
Posts: 68
Website

Re: search is not looking at keywords

What I don’t understand is what is the function of the keywords if they have no effect on the search?

I’m using them with a technoarti plug in, so I’ll keep using them.

Offline

#9 2006-05-24 21:53:32

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: search is not looking at keywords

The search is only executed on the title and body fields in the database. So you can either add the word wallpaper to one of those, or apply the hack wet pointed out.

Offline

#10 2006-05-24 21:56:26

Walker
Plugin Author
From: Boston, MA
Registered: 2004-02-24
Posts: 592
Website

Re: search is not looking at keywords

Read my reply to wet’s “hack”. Tried it. Failed.

Offline

#11 2006-05-24 23:44:39

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

Re: search is not looking at keywords

What I don’t understand is what is the function of the keywords if they have no effect on the search?

An oversight when search was built.

Offline

#12 2006-05-25 04:47:58

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: search is not looking at keywords

Walker wrote:

That didn’t work so hot for me. I altered the publish/search.php file with the same changes you mentioned. So I also offered publish.php. Still no workee.

What else did you do? Have you altered the database, as mentioned in Beate Paland’s article?

Offline

Board footer

Powered by FluxBB