-
☆ A M B ☆
- 211 Posts
Hi all, I did a search on modx forums and could not find any relevant answer.
I would like to have a snippet call that extract either the latest searches made to the database or the most popular searches, or something similar. Is this doable?
Thanks,
Jose R. Lopez
-
MODX Staff
- 12,272 Posts
Not in it’s current form. You’d need to log all searches in order to do that.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Although I guess it wouldn’t be that hard to add this. Just create a new table for the log (with query and timestamp fields) and add a line to insert that info whenever a search is made. Once the data is saved to a table, it’s just a matter of deciding how you want to display it later.
-
☆ A M B ☆
- 211 Posts
Thanks for the tip. I will play with that this weekend.
Thanks.
Jose R. Lopez
Quote from: cino at Dec 26, 2006, 05:49 PM
Another issue I had was that if someone make a search with an apostrophe character (’) it generates an error. I corrected this adding the following line just after line 46 always of AjaxSearch.php file:
$searchString = str_replace("'", "\\'", $searchString);
I had this problem with version 1.0 also, and I hacked AjaxSearch.inc.php to work around it by using double quotes for the query and removing them from the search string (which allowed me to search for words with apostrophes).
Hi all.
I am using modx for product documentation. There will be two products, split from the top level parent. Is there a way to customised this snippet to only return results of one document branch or the other? Perhaps identifiable from the branch ultimate parent currently browsing.
I am using different templates for both branches, so I am happy to run different snippets if this is the easiest way to progress.
The other option is to include a breadcrumb path in the returned global search results.
Either way, I’m looking for the best method of the search being directed to one branch or the other, or the results being more intutive as to which branch it relates to.
I love this search snippet for the highlighting feature, so I’d like to use it if I can.
Any suggestions welcome. Thanks.
If you are using modx ver > 0.9.5 it is included with modx
Ah right. So the 1.6 update does not need a newer version of the file? I’ve upgraded to 1.6 from the shipped version for modx 0.9.5 (following instructions of course), and it doesn’t seem to want to work. I’ll PM you the URL if I may as I don’t want to add it to the post.