I am rebuilding a website, which uses 0.9.6.1 and AjaxSearch 1.5.1, with the latest versions of AjaxSearch and Modx. The search function is installed "out of the box", and called as [!Ajaxsearch!] (snippet) in a chunk in a template. I have <base href="[(site_url)]" /> in the <head> tag.
The "old" pairing works fine, the new one doesn’t:
A search makes two images appear - the cross and the whirling indicator, but no results are returned.
The go button also greys out, and no alternative search term can be entered, and to make the search form refresh itself, I have to close and reload the browser. A refresh doesn’t work. I get the same result in Firefox and IE7.
Old site is
http://www.boyde.com. New site is
http://mdx.stormforcemarine.com in case you want to admire the whirling indicator. As far as I can tell, the configurations of the two sites are identical, all pages cacheable and searchable etc.
I’ve searched the forums, and found only one reference to this symtom before - apparently solved by inserting the <base href...> field. Which isn’t apparently my problem.
Any ideas anyone?
MODX Revolution 2.6.5-pl (traditional)
Hosted on MODX Cloud
Skype: nicbaldeagle
Same for me too after migrating a site to a new server. All my other sites work including one I cloned this from. Its a mystery and 1.8 does not solve it although changing to standard search (non ajax) does. Will report if I find it. Whats this base href have to do with it?
Julian
Thank you for your reply.
We progress: the missing index-ajax.php file has been found and installed: I can’t understand why the file wasn’t ftp’d with the rest - but ftp is dodgy at best. It’s there now. I wonder what else didn’t install... For the record, the .htaccess file
wasn’t re-directing/re-writing, and I was using the correct [!AjaxSearch!] snippet call. And to respond to tazzydemon: the hrefbaseurl issue related to a previous post on a similar topic, buried at the end of 40 pages of posts, and I wanted to make clear that this wasn’t my particular problem...
Anyway, having put the index-ajax.php file into the root and repeating the test, the search engine responded with:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ’( DISTINCT CAST(ntv.id AS CHAR) SEPARATOR "," ) AS tv_id, GROUP »
SQL: SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext, sc.menutitle, sc.content, sc.publishedon, GROUP_CONCAT( DISTINCT CAST(ntv.id AS CHAR) SEPARATOR "," ) AS tv_id, GROUP_CONCAT( DISTINCT ntv.value SEPARATOR ", " ) AS tv_value FROM `site_content` sc LEFT JOIN( SELECT DISTINCT tv.id, tv.value, tv.contentid FROM `site_tmplvar_contentvalues` tv WHERE (((tv.value LIKE ’%lights%’))) ) AS ntv ON sc.id = ntv.contentid WHERE ((sc.published=1) AND (sc.searchable=1) AND (sc.deleted=0) AND (sc.type=’document’) AND (sc.privateweb=0)) GROUP BY sc.id HAVING (((sc.pagetitle LIKE ’%lights%’) OR (sc.longtitle LIKE ’%lights%’) OR (sc.description LIKE ’%lights%’) OR (sc.alias LIKE ’%lights%’) OR (sc.introtext LIKE ’%lights%’) OR (sc.menutitle LIKE ’%lights%’) OR (sc.content LIKE ’%lights%’) OR (tv_value LIKE ’%lights%’))) ORDER BY sc.publishedon,sc.pagetitle
Which is another problem entirely.
Unless you’ve already seen this kind of response, and can instantly put your finger on the issue, let me do some research before bothering further. If I can’t fix it, I’ll raise the matter in the appropriate forum, if this isn’t it.
Thanks again.
MODX Revolution 2.6.5-pl (traditional)
Hosted on MODX Cloud
Skype: nicbaldeagle
I’m using MySQL 4.0.26a on this particular server.
Following your advice I went to the snippet code, under Resources/Manage Resources/Snippets and edited out the |tv at the end of the line:
$cfg[’whereSearch’] = isset($whereSearch) ? $whereSearch : (isset($__whereSearch) ? $__whereSearch : ’content|tv’);, so it reads ...’content’);
And it works. Voila!
Can I suggest that the distribution be changed so that this is the default? I would imagine that most users of MODx websites (as opposed to developers) don’t want to search TVs - and if the site developers do decide to populate TVs with content (why?), the developers can add it back in.
Any way - this is something I leave to you. Thanks and merci again.
MODX Revolution 2.6.5-pl (traditional)
Hosted on MODX Cloud
Skype: nicbaldeagle
-
MODX Staff
- 12,272 Posts
For pretty much any site I’ve built, not being able to search in TVs is a huge limitation. Searching in TVs *should* be the default behavior.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me