This plugin has been updated to version 1.0.3.
Changelog: - Fixed - Fixed a problem where certain parameter values could have no effect. - Fixed - Shouldn’t interfere with other code utilising the cache. - Fixed - Chunk creation should be a little faster. - Fixed - Fixed an issue where some wrapping tags could break the return string. - Added - Now checks are made against some safe ‘wrapping’ tags for parameter input. - Added - Added some default variables as class properties (nearer the top) for easier editing should it be required - Fixed - Fixed a localisation problem causing no return output. - Fixed - Fixed an issue where paginated search result would return the complete unparsed input.
This seems to only be working correctly with single word searches. If I try doing a search with multiple words, even if I choose exact phrase, I get oodles of unrelated chunks. Is that because the plugin doesn’t realize I want the exact phrase so it’s just putting chunks that contain any of the words? I can’t very well depend on my users to only search for a single word.
Also, when I do search for a single word, some of the results come back displaying no chunks, whereas some are just fine.
Hi Fitzage,
The plugin is only set up to search for single words, so supplying a multiple word search will highlight whether exact phrase or not. The reason is because there is no way to tell what type of search was made. Because EE will return only relevant search results though it seemed reasonable for this behaviour.
As for no matches that could be because the search has found your search term in a custom field that isn’t between the plugin tags?
Well, the no results thing is weird because I checked the articles in question and they had oodles of results.
As far as the rest goes, I can’t really use the plugin if it’s going to search individually for every word in a phrase, because you can’t prevent people from typing phrases that include very small and common words.
Hi Fitzage, The plugin is only set up to search for single words, so supplying a multiple word search will highlight whether exact phrase or not. The reason is because there is no way to tell what type of search was made. Because EE will return only relevant search results though it seemed reasonable for this behaviour. As for no matches that could be because the search has found your search term in a custom field that isn’t between the plugin tags?
Hi Daniel,
I was going to ask the same question that fitzage asked. When searching for a single word, the plugin works great. When searching for a phrase with multiple words, I still get relevant results but nothing is highlighted in the search results. I would expect that the whole phrase would be highlighted (if it matches of course) or if nothing else, any word matching any of those in the search query would be highlighted?
In your response above you said:
so supplying a multiple word search will highlight whether exact phrase or not
Am I understanding that correctly in that a multiple word search should still highlight the exact phrase (if found) or single words from the search?
Really great plug in, having problems with the following tag:
{exp:zm_excerpt chunk_wrap="none" pre_chars="5" post_chars="5" chunk_prepend="..." chunks="1"}
Gives me “Notice: Array to string conversion in /usr/local/pem/vhosts/103582/webspace/httpdocs/tru-vue_system/plugins/pi.zm_excerpt.php on line 281 Notice: Array to string conversion in /usr/local/pem/vhosts/103582/webspace/httpdocs/tru-vue_system/plugins/pi.zm_excerpt.php on line 289” for each search result…
Removing the pre and post chars fixes the error, (I tried numbers besides 5, including 50 and 100)
Also, still get a span tag despite the “none” even when using
{exp:zm_excerpt chunk_wrap="none" chunks="1"}
though it causes no problems so I don’t really worry about it…
Thanks for your time…
Excerpt is an excellent plugin, thanks. Just wondering: I’m finding that if the search terms don’t appear in my designated custom field, then it seems nothing at all is returned. Is that correct? I’d like that if the search terms don’t appear then at least the excerpt of the field would be displayed as per the default behaviour of exp:search_results.
Does anyone know if that’s correct and if so how can I avoid having no results returned in this case?
Many thanks.
Just to be sure, do you mean simply place every custom field I want to include in the search result, one after the other, like this?
{exp:zm_excerpt output_wrap="p"}{custom_field_1}{custom_field_2}{custom_field_3}{custom_field_4}{custom_field_5}..{/exp:zm_excerpt}
Just so I’m not missing a trick.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.