Jump to content

Recommended Posts

Greetings!

 

I am trying to build a very basic fulltext search app in php. I have found an example here http://tips4php.net/2010/03/create-your-own-fulltext-searchengine-with-php-and-mysql so I used it to build my own.

 

This is my table/data (field types are text)

 

    name 	                                                        site result
    RRR1 COS COSMETICS P R15-500 000847719903 20110607 094742.VER 	RRR1 P
    RRR3 BIST MIDDLEWARE P R22-200 029051946829 20110607 101331.VER 	RRR3 P
    RRR2 PRE PREHEAT F R16-500 000897546214 20110607 085111.VER 	RRR2 F
    RRR1 COS COSMETICS P R16-300 000899331425 20110607 091337.VER 	RRR1 P

 

This is my index

 

ALTER TABLE automation_search_test ADD FULLTEXT search_idx (name ,site)

 

This is my query

 

SELECT * FROM automation_search_test WHERE MATCH (name,site) AGAINST ('RRR1' with query expansion);

 

I have however a few problems:

 

1. If I remove `with query expansion`, the query returns an empty set

2. If I add the RESULT column to my fulltext index,  the query returns an

    empty set after I change my SQL to this

 

SELECT * FROM automation_search_test WHERE MATCH (name,site,result) AGAINST ('RRR1' with query expansion);

 

Is my index incorrectly setup? Is there an issue with the data?

 

I welcome any input you have. Thanks.

 

 

 

Al.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.