Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-03-09 15:46:57

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

How to perform an accent independent search with textpattern?

Hi

I noticed that the search in txp is accent sensitive (é and e are différent) when i googled that i found that the interclassement of mysql table can solve that but when i looked to phpmyadmin i only have things like *_ci that means case incensitive!

After googling more i found that code that convert the search to accent insensitive:

SELECT * FROM `table` WHERE `texte` LIKE CONVERT(_utf8 '%cinema%' USING utf8) COLLATE utf8_general_ci ;

Can someone tel me how to change the publish.php to reflect that? or if someone have a better solution?

Thanks

Offline

#2 2010-03-10 13:44:32

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: How to perform an accent independent search with textpattern?

Hi again

no one have an idea or a suggestion?

Offline

#3 2010-03-16 10:28:38

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: How to perform an accent independent search with textpattern?

After some trying with dbmanager i find that the request that feet my need is

Select * from textpattern where Title like "%thesearch%";

But looking into txp code (a doArticle function that’s not easy to inderstund the internal logic for me) i found that it use rlike function, changing it to like and putting % around $q havent worked!!

Haven’t been able to find a solution with internal search turn me to look to another solution using smd_query, if i succeed i will post the resulte!

Cheers

Offline

#4 2010-03-16 10:40:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,942
Website GitHub

Re: How to perform an accent independent search with textpattern?

Does it work with the latest SVN version of TXP? Sam revamped the search and converted it from rlike to like in the process.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2010-03-16 11:49:15

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,549
Website GitHub Twitter

Re: How to perform an accent independent search with textpattern?

Yeaaah Thanks man you are a chief

Even if using a development version with a production site is not recommended, but that solve my problem and it works like a charm!!

I can handle now others stuff

Thanks again Stef.

Offline

#6 2010-03-16 11:58:33

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,942
Website GitHub

Re: How to perform an accent independent search with textpattern?

Dragondz wrote:

Yeaaah Thanks man you are a chief

No probs. Sam’s the genius here :-)

Incidentally, I’m in the process of trying to convert the admin-side article search over to like as well. Ironing out some stumbling blocks with wildcards and foreign character searches so we can (perhaps) issue the fix soon. Watch that space.

Last edited by Bloke (2010-03-16 12:00:25)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB