Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

towndock
Member
From: Oriental, NC USA
Registered: 2007-04-06
Posts: 329
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: 329
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: 11,271
Website GitHub

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: 329
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

#41 2019-03-09 10:57:28

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: smd_fuzzy_find: making search results less precise

Hi Stef,
smd_fuzzy_find and also smd_lib use a deprecated method in php 7.x.

smd_fuzzy_find -> 8192: Methods with the same name as their class will not be constructors in a future version of PHP;
smd_lib -> 8192: Methods with the same name as their class will not be constructors in a future version of PHP; smd_MLP has a deprecated constructor on line 4

For smd_fuzzy_find I could resolve this problem by changing class smd_FuzzyFind { to class __construct {. For the library it isn’t possible to do that in this manner. smd_lib is also used in smd_gallery. Is there any “quick” solution?

Offline

#42 2019-03-09 15:48:25

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

Re: smd_fuzzy_find: making search results less precise

whocarez wrote #316926:

smd_fuzzy_find and also smd_lib use a deprecated method in php 7.x.

Thanks for catching these. I’ve fixed both in the GitHub repos:

If you’re comfortable copying the code blocks from those files as-is over your existing plugin code, great. If not, I’ll be bundling up official .txt file packages later today, with luck.


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

#43 2019-03-09 16:05:17

whocarez
Plugin Author
From: Germany/Ukraine
Registered: 2007-10-08
Posts: 305
Website GitHub Twitter

Re: smd_fuzzy_find: making search results less precise

Thanks! It works. The notice disappeared and smd_gallery and smd_fuzzy_find doing there job!

Offline

Board footer

Powered by FluxBB