Jump to content

Recommended Posts

select * from artist where artistName = '$name' OR LIKE '%{$name} ' OR artistName LIKE ' {$name}%'

 

Something like that may work.

 

 

 

Actually I tried that exact query...only I changed the $name to es, and I added the artistname before the second OR (you forgot to put it in) and I got zero results.

 

this is what I put:

select * from artist where artistName = 'es' OR artistName LIKE '%{es} ' OR artistName LIKE ' {es}%'

Dont use {} around es.

 

OK...I tried it.  Unfortunately it returned no results.

 

select * from artist where artistName = 'es' OR artistName LIKE '%es ' OR artistName LIKE ' es%'

 

Here's the problem:

 

= 'es'  only returns artistName that literally equals es.....no other words or spaces can be present.

 

LIKE '%es ' only returns artistName that has a space (and only one space) after es.

 

LIKE ' es%' only returns artistName that has a space (and only one space) before es.

 

So, none of those conditions returned my entries of "ES Buzz" or "Through ES"

 

LIKE doesn't seem like it can do matching, only LIKE.

 

But I think the only way you can use Match xxx AGAINST xxx is if you use full index (which I'm not even sure what that is).

 

I don't understand why MATCH would tax the system so much more than LIKE.

 

I can't believe there is not a query that can return a result that contains the EXACT word or contains the EXACT word plus other words.

You are asking for one search to do many things.

 

You are asking for a Actual search "Watercolors" as well as asking for a Word match "ES" at the start or at the end.

 

You can have 3 search screens if you want, Exact, Starts with, Ends with.

 

Dont use {} around es.

 

OK...I tried it.  Unfortunately it returned no results.

 

select * from artist where artistName = 'es' OR artistName LIKE '%es ' OR artistName LIKE ' es%'

 

Here's the problem:

 

= 'es'  only returns artistName that literally equals es.....no other words or spaces can be present.

 

LIKE '%es ' only returns artistName that has a space (and only one space) after es.

 

LIKE ' es%' only returns artistName that has a space (and only one space) before es.

 

So, none of those conditions returned my entries of "ES Buzz" or "Through ES"

 

LIKE doesn't seem like it can do matching, only LIKE.

 

But I think the only way you can use Match xxx AGAINST xxx is if you use full index (which I'm not even sure what that is).

 

I don't understand why MATCH would tax the system so much more than LIKE.

 

I can't believe there is not a query that can return a result that contains the EXACT word or contains the EXACT word plus other words.

You are asking for one search to do many things.

 

You are asking for a Actual search "Watercolors" as well as asking for a Word match "ES" at the start or at the end.

 

You can have 3 search screens if you want, Exact, Starts with, Ends with.

 

 

 

Perhaps. 

 

I would assume most search engines operate this way.

For instance...if a teacher were to search for "ESL", they don't want results that have ESL within a word....that would give them WAY TOO MANY irrelevant results.

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.