search tool for search IN a website

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

search tool for search IN a website

Post by C_Calav »

hey guys,

can anyone give me some links or some keywords to help me find info on how to build my own search tool for searching around my website?

i cannot seem to find anything on this 8O

thanx heaps!

PS: am using a MySql database for the backend.

pickle mentioned in my previous thread about using "full text search" in mysql is this the right way to get the resulrts for the search?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

full text searching is the way to do it through the database.. but if you have "other" data sources that need searching, you'll need additional functionality, of course.

Hopefully, all your data is stored in the database. :)
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

thanx feyd,

all my data i want people to search for is in my db yes.

just been reading mysql manual

so i took there example and changed it to suit my db

there example was this
SELECT * FROM articles
WHERE MATCH (title,body) AGAINST ('database');
what is this saying?

select all from table articles where feilds title and body are in ..... ?

what does that AGAINST mean..

and when i created my tables etc should i have indexed them or made them so they could be searched?

any help about any of this would be great!

thanx
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

ok so i got their example to work inb my DB looks like this:
SELECT * FROM planes
WHERE MATCH (P_Stock) AGAINST ('models');
but what is it accually doing? or returing?

all i got was this
SQL-query:
SELECT *
FROM planes
WHERE MATCH (
P_Stock
)
AGAINST (
'models'
)
LIMIT 0 , 30
doesnt tell me much :? or does it.... ?

so if i want feilds to be search on i have to enable FULLTEXT on that feild is that correct?
User avatar
C_Calav
Forum Contributor
Posts: 395
Joined: Wed Jun 02, 2004 10:55 pm
Location: New Zealand

Post by C_Calav »

anyone help me with my questions or are they to vauge?

thanx
dardsemail
Forum Contributor
Posts: 136
Joined: Thu Jun 03, 2004 9:02 pm

Post by dardsemail »

Was looking for some info and came across your post - you've probably figured it out by now, but for those who haven't:

Code: Select all

SELECT * FROM table_name 
WHERE MATCH (field_name1,field_name2) AGAINST ('keyword');
Hope that helps anyone who might have come across this and been confused.
Post Reply