473,406 Members | 2,954 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,406 software developers and data experts.

Text search...

Best groupmembers,

I'm new to MySQL and I'm not quite sure what I'm doing wrong. I have a
table "general" that contains some columns. I want to do a search thru
it and find posts that have a specific word in the title and text
column.

This is the query that I use that creates an error.

$Query = "SELECT * FROM general WHERE MATCH(title,text)
AGAINST('$searchstring')";

This is just modified SQL from the manual on www.mysql.com

Any hints?

Cheers, Peter
Jul 19 '05 #1
2 1780
Peter the Swede wrote:
Best groupmembers,

I'm new to MySQL and I'm not quite sure what I'm doing wrong. I have a
table "general" that contains some columns. I want to do a search thru
it and find posts that have a specific word in the title and text
column.

This is the query that I use that creates an error.

$Query = "SELECT * FROM general WHERE MATCH(title,text)
AGAINST('$searchstring')";

This is just modified SQL from the manual on www.mysql.com


Hello Peter,
I'm not very familiar with the MATCH AGAIN clause (I know it but have
not used it), but I did find the following on page 129 of the MySQL manual:

To use MATCH ... AGAINST (... IN BOOLEAN MODE) with your tables, you
need to rebuild them with REPAIR TABLE table_name USE_FRM.

I know you can use the following instead:

$Query = "SELECT * FROM general WHERE title LIKE '%$searchstring%' OR
text LIKE '%$searchstring%'"

Of course, the above won't give scores. It will either find something or
it won't.

You might find some configuration insight in section 13.7 of the manual,
as well (page 613).

--
- Michael J. Astrauskas

Jul 19 '05 #2
Peter the Swede wrote:
Best groupmembers,

I'm new to MySQL and I'm not quite sure what I'm doing wrong. I have a
table "general" that contains some columns. I want to do a search thru
it and find posts that have a specific word in the title and text
column.

This is the query that I use that creates an error.

$Query = "SELECT * FROM general WHERE MATCH(title,text)
AGAINST('$searchstring')";

This is just modified SQL from the manual on www.mysql.com


Hello Peter,
I'm not very familiar with the MATCH AGAIN clause (I know it but have
not used it), but I did find the following on page 129 of the MySQL manual:

To use MATCH ... AGAINST (... IN BOOLEAN MODE) with your tables, you
need to rebuild them with REPAIR TABLE table_name USE_FRM.

I know you can use the following instead:

$Query = "SELECT * FROM general WHERE title LIKE '%$searchstring%' OR
text LIKE '%$searchstring%'"

Of course, the above won't give scores. It will either find something or
it won't.

You might find some configuration insight in section 13.7 of the manual,
as well (page 613).

--
- Michael J. Astrauskas

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SK | last post by:
Is there a way to store HTML into a MySQL TEXT column, yet be able to search over textual content only? For example, if I store the following HTML snippet: <p>A very <em>small</em>...
12
by: ljungers | last post by:
I'm on the home streach of my project and found that my "Reset for New Search" command button not working as desired. What should happen is that when the button is clicked a Event Procedure is run....
6
by: shantanu | last post by:
Hi All, I have a requirement to develop a search engine based on some search criteria that will search for the string or statement in all the documents uploaded in the website. The search result...
13
by: Robertf987 | last post by:
Hi, Yet another thing I need help with I'm affraid. I'll first explain what I want, then I'll try to explain what I have. I'm using Microsoft Access 2000. What I want is to be able to do a...
3
by: =?Utf-8?B?UGVycmlud29sZg==?= | last post by:
Not sure where to post this... Found some interesting behavior in Windows Search (Start =Search =All files and folders =search for "A word or phrase in the file:"). This applies to XP and maybe...
0
by: a | last post by:
Dear friends I have this code but not work What I want I want to design search form to search by (customerid and customername) This is the code that I want you repair it for me
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
4
by: vitaminz | last post by:
Hi it's me again, I've pretty much finished a program I'm making, which does the following: The program is for a garage, and it does the following functions: Adds a new car Display cars Amend...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.