Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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
Re: search is not looking at keywords
can we see the site?
( want to watch the search )
Offline
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
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
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
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
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
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
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
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
Pages: 1