Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2010-07-30 15:18:41

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,621
Website

Re: smd_fuzzy_find: making search results less precise

whocarez wrote:

is this plugin able to work with non latin character sets?? For example Cyrillic?

Short answer is I have absolutely no idea, sorry. The engine it uses is a complete mystery to me: it was written by someone else.

I would guess not — and your findings appear to mirror this. You could try using the refine and tolerance attributes but, in the case of refine, it uses two PHP functions called metaphone and soundex, both of which cite the fact they work with English language. People have posted alternative language versions of both functions, but nothing (as far as I can tell) that targets Cyrillic.

Last edited by Bloke (2010-07-30 15:19:03)


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

#32 2010-07-30 15:33:23

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 250
Website

Re: smd_fuzzy_find: making search results less precise

@ Bloke: Wow, you are very fast!

At the moment I think the problem is more related to MLP, because it is not the only language. In debug mode I get the following error:

Ошибка тега: <txp:smd_fuzzy_find form="search_results"  /> ->  Textpattern Warning: Unknown column 'textpattern.Posted' in 'field list'
select *, unix_timestamp(textpattern.Posted) AS uPosted, unix_timestamp(textpattern.LastMod) AS uLastMod, unix_timestamp(textpattern.Expires) AS uExpires from l10n_txp_ru_ru where 1=1 AND Status IN ('4','5')
textpattern/lib/txplib_db.php:258 startRows()  on line 113

textpattern/lib/txplib_db.php:113 trigger_error()
textpattern/lib/txplib_db.php:323 safe_query()
textpattern/lib/txplib_db.php:258 startRows()
textpattern/lib/txplib_misc.php(594) : eval()'d code:213 safe_rows_start()
textpattern/publish.php:1106 smd_fuzzy_find()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:2993 parse()
textpattern/publish.php:1106 if_search_results()
textpattern/publish.php:1041 processTags()
textpattern/lib/txplib_misc.php:1621 parse()

Ошибка тега: <txp:smd_fuzzy_find form="search_results"  /> ->  Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource  on line 329

textpattern/lib/txplib_db.php:329 mysql_fetch_assoc()
textpattern/lib/txplib_misc.php(594) : eval()'d code:222 nextRow()
textpattern/publish.php:1106 smd_fuzzy_find()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:2993 parse()
textpattern/publish.php:1106 if_search_results()
textpattern/publish.php:1041 processTags()
textpattern/lib/txplib_misc.php:1621 parse()
textpattern/publish/taghandlers.php:266 parse_form()
textpattern/publish.php:1106 output_form()

Ошибка тега: <txp:smd_fuzzy_find form="search_results"  /> ->  Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource  on line 331

textpattern/lib/txplib_db.php:331 mysql_free_result()
textpattern/lib/txplib_misc.php(594) : eval()'d code:222 nextRow()
textpattern/publish.php:1106 smd_fuzzy_find()
textpattern/publish.php:1028 processTags()
textpattern/publish/taghandlers.php:2993 parse()
textpattern/publish.php:1106 if_search_results()
textpattern/publish.php:1041 processTags()
textpattern/lib/txplib_misc.php:1621 parse()
textpattern/publish/taghandlers.php:266 parse_form()
textpattern/publish.php:1106 output_form()

the same for the German language installation. Maybe it is a effect of wet_haystack, which I tried …
Normal textpattern search is working and I already played around with parameters.
Textpattern 4.2.0, latest fuzzy_find and mlp. MySQl 5.1.43 and PHP 5.2 in use.

Offline

#33 2010-07-30 15:41:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,621
Website

Re: smd_fuzzy_find: making search results less precise

whocarez wrote:

@ Bloke: Wow, you are very fast!

Faster than a speeding electron :-)

At the moment I think the problem is more related to MLP, because it is not the only language

Could be but, umm, you might have uncovered a bug. Are you using a prefix on your database tables?


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

#34 2010-07-30 15:54:30

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 250
Website

Re: smd_fuzzy_find: making search results less precise

Bloke wrote:

Could be but, umm, you might have uncovered a bug. Are you using a prefix on your database tables?

No, I don´t use a prefix.

Offline

#35 2010-07-30 16:01:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,621
Website

Re: smd_fuzzy_find: making search results less precise

whocarez wrote:

No, I don´t use a prefix.

OK, so it’s not that. It could be an incompatibility with MLP but I thought I’d tested it. Hmm. If I get a chance to set up an environment like yours I’ll see what I can do. Probably won’t be very soon though — got a lot of other stuff stacked up in my TODO pile unfortunately.


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

#36 2010-09-22 01:10:13

JanDW
Plugin Author
From: Providence, RI, USA
Registered: 2008-07-18
Posts: 327
Website

Re: smd_fuzzy_find: making search results less precise

Hi Stef, this could be an issue related to my problems with wet_haystack

What happens when I search for the category “commercial design” is this

When I search for “commercial-design” all goes well and I get 4 results, the number of articles in that category…

edit: ps if you want a login to the site, let me know

Last edited by JanDW (2010-09-22 01:53:52)


TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX

Offline

#37 2011-08-12 13:14:08

towndock
Member
From: Oriental, NC USA
Registered: 2007-04-06
Posts: 263
Website

Re: smd_fuzzy_find: making search results less precise

I have smd_fuzzy_find doing its thing – all is well in terms of it finding near misspellings.

One part of Textpattern search I need to tweak is finding the exact phrase vs something close.

Example – an article titled:

Cape Hatteras To Ocracoke Inlet Marine Weather Forecast

If one searches for:

Cape Hatteras Weather

… the search result is 0 articles found. I’d like it to find the above based on the word matches. I could solve this with keyword entries, but in the site I am working on that would involve multiple entries for literally thousands of articles. A smarter search function would be preferable.

Ideas?

Offline

#38 2011-08-14 18:14:00

towndock
Member
From: Oriental, NC USA
Registered: 2007-04-06
Posts: 263
Website

Re: smd_fuzzy_find: making search results less precise

Bump. The above is a significant problem – and not limited to fuzzy_find. Any Txp search is limited by this issue. I listed an example on my site above. Here is an example on Txp poster Kjeld’s fine Japan news site:

http://ikjeld.com/en/

The first headline is “East Japan Earthquake and Tsunami 2011”. Try searching with a search that a site visitor could likely do:

Japan Tsunami

0 articles found. Both words are in the title and article, but because they are not together the search result is ZERO.

There must be a way to make Txp search results smarter than this.

Offline

#39 2011-08-16 09:34:30

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,621
Website

Re: smd_fuzzy_find: making search results less precise

towndock wrote:

…and not limited to fuzzy_find.

Since smd_fuzzy_find is just working within the bounds of Txp’s search mechanism, I think it’ll continue to exhibit this behaviour until the core is changed.

In the meantime, have you tried the new match attribute in <txp:search_input /> to search ‘any’ words? You can perhaps use some clever scripting to allow people to choose the ‘mode’ it uses. Don’t know if that’ll help fuzzy find because it pre-dates the match attribute. I should probably look into adding that to the plugin at some point.

Last edited by Bloke (2011-08-16 09:35:08)


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

#40 2011-08-21 18:44:01

towndock
Member
From: Oriental, NC USA
Registered: 2007-04-06
Posts: 263
Website

Re: smd_fuzzy_find: making search results less precise

Thank you Bloke. Adding:

match=“all”

…into <txp:search_input /> fixed it. It works fine along with your smd_fuzzy_find plugin also.

Problem solved. I owe you more beer.

Keith

Offline

Board footer

Powered by FluxBB