473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

FULLTEXT Search troubles

nathj
938 Expert 512MB
Hi,

I am just trying to develop a search system for my website. The PHP side of things is no trouble at all. I have also set up what I think are appropriate FULLTEXT indices on the tables I will need to search.

I was just trying things out and have got a bit confused. What I think should be happening, based on what I've read, is not happening.

I have a table - tbl_resource, on this table there is FULLTEXT index on three fields - display, title and synopsis.

Display and title are varchar fields and synopsis is a mediumtext field

The table contains 7 rows at present (there will be lots more as the site goes live), three of these rows contain the phrase 'Hope08', of these three only one of them contains the word 'first'.

Expand|Select|Wrap|Line Numbers
  1. select 
  2. ID, display, title, synopsis,
  3. MATCH(display,title,synopsis) AGAINST('Hope08 first') as Relevance
  4. FROM tbl_resource 
  5. where MATCH(display,title,synopsis) AGAINST ('+Hope08 +first' IN BOOLEAN MODE) ORDER BY Relevance DESC
That's my SQL code and I would expect this to give me one row in the results.

However I get three rows where they all contain Hope08. I have even tried using -first in the query but that still gives me three rows and not the expected 2.

I have tried using the + operator in the SELECT part of the statement and even adding IN BOOLEAN MODE there. the results don't vary.

Clearly I am doing something wrong but I have been unable to figure out what on my own. I'd really appreciate some help with this.

Many thanks
nathj
Jul 23 '08 #1
3 1385
Atli
5,058 Expert 4TB
The word "first" is a stopword, so it would be excluded from a boolean search.
Jul 24 '08 #2
nathj
938 Expert 512MB
The word "first" is a stopword, so it would be excluded from a boolean search.
Atli,

That would explain it. this leads to a new question.

There are rather a lot of stopwords, how do you use them in a search and actually search for them?

Cheers
nathj
Jul 24 '08 #3
nathj
938 Expert 512MB
Actually scratch that. I've done some more reading and I now understand what stopwords are. I guess there are ways around this but they are fairly complex and the end results is not really worth the hassle.

Thanks for your help
Jul 24 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Phil Powell | last post by:
Relevancy scores are normally defined by a MySQL query on a table that has a fulltext index. The rules for relevancy scoring will exclude certain words due to their being too short (minimum...
0
by: Phil Powell | last post by:
The table already has a fulltext index and from there I can use the MySQL fulltext search query to get results as well as the relevancy score. The problem I have is that MySQL has a default...
0
by: Matt W | last post by:
Hi all, I'm planning to use MySQL's full-text search for my forum system (possibly 5+ million posts). I've been playing with it a lot lately to see the performance and functionality and have...
8
by: Radim B | last post by:
Hi, can anyone help me if it is possible to make indexing for fulltext from formats in: 1) *.doc 2) *.xls 3) *.html 4) *.pdf Many thanx for your help
0
by: Phil Powell | last post by:
Retracing my problem leads me to believe I never successfully created fulltext indexes for MySQL 3.23.58 MyISAM tables. I went to the MySQL manual and was able - or so I thought - to create them,...
0
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
1
by: Robert Oschler | last post by:
I read a while back that MySQL will only use one index per query. (If this is not so, please tell me and point me to a doc that gives a good explanation of MySQL's current index usage policy). ...
0
by: pcosway | last post by:
(originally posted in database.myodbc by mistake) I'm trying to speed up a fulltext search (MySQL 5.0.21, table has 670,000 records, about 900MBytes, machine has 1GB memory). Fulltext search...
2
by: John Kotuby | last post by:
Hi all, Maybe this belongs in the Full Text group but I am writing an ASP.NET application with a SQL Server 2005 backend, so I am posing the question here. I have been using fulltext search...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.