Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: etc_search: when the default search is not enough
Thank you, Keith, your (and others) support incites me to spend more time on etc_search. All suggestions are welcome.
Offline
Offline
Re: etc_search: when the default search is not enough
The “live” attribute still produces “true” results even when set to “false”. Why is that?
Offline
Re: etc_search: when the default search is not enough
wordgasm wrote:
The “live” attribute still produces “true” results even when set to “false”. Why is that?
Hi,
“false” is a string, not a Boolean. You should assign live attribute some “empty” php value: live="0"
, for example.
Offline
Re: etc_search: when the default search is not enough
Beta 0.9 is released. It is not directly compatible with 0.8.9, so please test it before upgrade. Main news:
- sensible attributes have migrated to the admin side, mainly for security reasons;
- pagination should work now, including
etc_pagination
and other plugins; - easier to configure for searching files, images and links.
It is already on duty, though the description still corresponds to the official 0.8.9 version. The plugin help may be a bit outdated too, please complain if so.
Download and feed me back.
Last edited by etc (2013-11-29 14:04:28)
Offline
Re: etc_search: when the default search is not enough
Version 0.9 is released. Both plugin and javascript files must be upgraded. It is not directly compatible with 0.8.9, be careful when upgrading.
More secure and more configurable than the previous version. One can customize search queries, search input form, search results output, animation effects and so on. Accidentally, it can be used as <txp:article_custom />
tag enhanced with powerful where
attribute.
The demo is here. But I am still bad at help writing, sorry! :)
Offline
Re: etc_search: when the default search is not enough
Hi Oleg, can you give me an example of how you might implement faceted search using this plug in? I’m just contemplating a potential project and want to know how easy it’s going to be!
Offline
Re: etc_search: when the default search is not enough
Hi Doug,
if you go to plugins homepage, the search in the left sidebar is faceted, accepting term, #keyword or @category
. If you search for pag @tips
, it will bring you all tips containing “pag”. It’s done with the following etc_search
form:
{Title,Body::/^[^@#]/;Title,Keywords::/^#([\w\-]+)$/::{*} LIKE '%$1%';Category1,Category2::/^@([\w\-]+)$/::{*} LIKE '%$1%'}
It contains 3 ;
-separated search patterns:
Title,Body::/^[^
#]/@ means “search for the search string in Title or Body if the string doesn’t start with @ or #”;Title,Keywords::/^#([\w\-]+)$/::{*} LIKE '%$1%'
: if the search string starts with#
, search for the term that follows#
in Title or Keywords;- and so on
The patterns are of the form
field1,field2,...::regexp_that_triggers_the_pattern::mysql_comparison_operator
Don’t hesitate if you need some help
Offline
Re: etc_search: when the default search is not enough
Thanks for the quick reply. I take it you could accomplish something a little more traditional with multiple select fields?
Looks like I’ve got something else to have a play around with!
Offline
Re: etc_search: when the default search is not enough
douglgm wrote #278165:
Thanks for the quick reply. I take it you could accomplish something a little more traditional with multiple select fields?
Combining multiple select fields into one search query is possible, but it would help me a lot to see an example of what you are looking for.
Offline
Re: etc_search: when the default search is not enough
Hi
Is this plugin is working under txp 4.5.5? i tried to install it but failed with error
Parse error: syntax error, unexpected T_FUNCTION in /htdocs/textpattern/lib/txplib_misc.php(812) : eval()'d code on line 392
Les erreurs ci-dessus ont été causées par le plugin :etc_search
Offline
Re: etc_search: when the default search is not enough
Hi Rabah, sorry for the delayed reply (was offline).
Yes, etc_search
works with txp 4.5.5 on its homepage (php 5.4). I have also tried a fresh install from the download link that went well. The only reason I can see is that your php version does not support anonymous functions in preg_replace_callback
(line 392 in the plugins code). If so, try to declare this function separately:
function etc_search_workaround ($matches) {
global $etc_search_match;
@list($res, $sep) = explode('&', $matches[1], 2) + array(null, ',');
if(!$etc_search_match || !isset($_REQUEST[$res])) {$etc_search_match = false; return '';}
return urldecode(is_array($res = gps($res)) ? implode($sep, $res) : $res);
}
and replace lines 392—397 with
$params['q'] = trim(!$etc_format ? gps('q') : preg_replace_callback("/\{(.+)\}/Us", 'etc_search_workaround', htmlspecialchars_decode($etc_format)));
Hope that helps.
Offline