Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fulltext query only works "with query expansion"

Status
Not open for further replies.

kristo5747

Programmer
Mar 16, 2011
41
US
Greetings!

I am trying to build a very basic fulltext search app in php. I have found an example here [] so I used it to build my own.

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

Code:
    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

Code:
ALTER TABLE automation_search_test ADD FULLTEXT search_idx (name ,site)

This is my query

Code:
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

Code:
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.
 
fulltext indexing, as the manual will tell you, is unreliable for tables which have only a small number of rows

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top