MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Tkil Date:October 17 1999 6:39pm
Subject:Re: text search with mysql
View as plain text  
>>>>> "Andreas" == Andreas Gietl <gietl@stripped> writes:

Andreas> hi i'am having a little problem making mysql search for a
Andreas> string that does not completly match the searched field, but
Andreas> does just CONTAIN the search string.

Andreas> Is it possible to realize this withing Mysql or do i have to
Andreas> do this within my programm?

take a look at the mysql info docs, node "String comparison
functions".  you should be able to use either "LIKE" or "REGEXP",
depending on how fancy your search criteria are.  if you just want to
see whether a field contains a given string, you could use:

| WHERE Field LIKE "%string%"

as your search clause.  as an example, to find all tracks that have
the word "rain" in their titles, i can do the following query on my
personal cd database:

| select Artist.name, Album.name, Track.track_num, Track.name
|   from Artist, Album, Track 
|   where Track.album_id = Album.id 
|         and Album.artist_id = Artist.id 
|         and Track.name like "%rain%" 
|   order by Artist.sort_key;

note the 'Track.name like "%rain%"' line.  a copy of this schema is at 

   http://slinky.scrye.com/~tkil/create-tables.sql

good luck,
t.
Thread
text search with mysqlAndreas Gietl17 Oct
  • Re: text search with mysqlAndrian17 Oct
  • Re: text search with mysqlBob Kline17 Oct
  • Re: text search with mysqlTkil17 Oct
  • Re: text search with mysqlJim Faucette18 Oct
  • Re: text search with mysqlx x xu19 Oct