Maian Script World on Facebook Maian Script World on Twitter Maian Script World - Latest News Maian Script World on YouTube Maian Script World on LinkedIn


Please Read

You are required to register before you can post. This is via a custom verification system. Please post any problems you are encountering here and I`ll do my best to respond as soon as I can. Please note that a reply WILL be posted to all queries, so do not double post. There are no guarantees when a reply will appear but I do my best to answer all within 3/4 days max. Bumping topics won`t make the slightest difference.

IMPORTANT: Posts in English ONLY please, thank you! Any other languages will be ignored and your message deleted.
SEARCH: Use the search option to see if your question has been answered on the forum before. Or check the relevant script docs.
CUSTOMER: If you have purchased a commercial version of any of my software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
PRIVATE MESSAGES: Private messages are currently disabled.
LINKS: Any links posted are 'NOFOLLOW' and will not be picked up by search engines.

You are not logged in.

#1 14-09-2011 03:58:08

bigsky52
Members
Registered: 14-09-2011
Posts: 3

+apple +juice Full Text Search Not Working

I wanted to search for only those recipes that were the martin family's comfort food based on the metaKeys so I entered this in the search box:

+martin +comfort

the results were more like a union of both terms.

Inserting a:

file_put_contents("BOB.log", print_r($sql, true));

into /recipes/classes/recipes.php I found the "+" aren't in the sql query that is built but instead:

AND MATCH(name,instructions,ingredients,submitted_by,metaDesc,metaKeys) AGAINST(' martin  comfort' IN BOOLEAN MODE).

I've just started learning PHP a couple days ago and have loaded my 350+ recipes directly into the database from my PC based Mastercook XML file that I exported and transformed into INSERT statements. I must say I think you've done a bangup job on this software, some of the best I've ever installed. All this is to say it could be an issue with me but I think something is going on with constructing this query. Thanks for any help.

Offline

#2 14-09-2011 06:27:40

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,065

Re: +apple +juice Full Text Search Not Working

bigsky52 wrote:

I must say I think you've done a bangup job on this software, some of the best I've ever installed. All this is to say it could be an issue with me but I think something is going on with constructing this query. Thanks for any help.

Thanks for your kind words. The fulltext search functions aren`t particularly reliable anyway. I just experimented with them in maian recipe. I`ll just stick with standard 'like' queries in the next version.

Looks like an error anyway with the + symbols, might be the mysql_real_escape_string function stripping them out. Feel free to have a play around with the code.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#3 14-09-2011 19:02:47

bigsky52
Members
Registered: 14-09-2011
Posts: 3

Re: +apple +juice Full Text Search Not Working

OK I tracked this down into /recipes/index.php. The urldecode removes "+" and replaces them with spaces. Using the rawurldecode does not do this, I hope it doesn't cause other problems. Your thoughts? The search now works as expected.


# original     $searchKeys = urldecode(cleanData($_GET['keys']));
     $searchKeys = rawurldecode(cleanData($_GET['keys']));  # my change

Offline

#4 15-09-2011 06:58:30

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,065

Re: +apple +juice Full Text Search Not Working

Yep, looks good, thanks for that.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

Board footer

2Checkout.com is an authorized reseller of goods and services provided by Maian Script World.© 2003-2013 David Ian Bennett. All Rights Reserved | Forum: FluxBB

Privacy Policy | Refund Policy