EE4.38, LS6.2 Entries in search results with Matrix fields are being shown base64 encoded excerpts
(Maybe not base64, but it's some sort of encoding appears in the excerpt)
Other entries/fields work fine.
Screenshot:
https://www.dropbox.com/s/v03ju47nh4o...
Relevant code:
[code]
{exp:low_search:results
query="{segment_3}"
collection="1|2|3|4|5|6|7|8"
keywords:lang="en"
keywords:inflect="yes"
limit="10"
}
{if low_search_keywords_missing}Keywords are required
{if:else}
{if count == 1}
Your search for {low_search_keywords} received {absolute_results} results.
{/if}
{if website_product_name}{website_product_name}{if:else}{title}{/if}
{low_search_excerpt}
Found in {low_search_collection_label}
{paginate}
Page {current_page} of {total_pages} pages {pagination_links}
{/paginate}
{if count == total_results}{/if}
{/if}
[/code]
Replies
Low 4 May 2019 09:44
What's the excerpt field you have selected for that collection? Also, can you see if that string is the same as the one in the URI?
Paul Larson 4 May 2019 20:13
Low,
The excerpt field is the 'Tabs' field, which is a Matrix.
Here are a few screenshots:
Excerpt selection: https://www.dropbox.com/s/egwpeq8od0z...
Field overview: https://www.dropbox.com/s/mbxthk9su4e...
{tabs} field detail:
https://www.dropbox.com/s/mbxthk9su4e...
Here's an example entry screenshot:
https://www.dropbox.com/s/iu9abncha63...
To answer your question, the string doesn't match the URI.
The excerpt that appears in the LowSearch results is:
YTo0OntzOjk6InJvd19vcmRlciI7YToyOntpOjA7czo4OiJyb3dfaWRfMyI7aToxO3M6ODoicm93X2lkXzQiO31zOjg6InJvd19pZF8zIjthOjM6e3M6ODoiY29sX2lkXzEiO3M6MTE6IkRlc2NyaXB0aW9uIjtzOjg6ImNvbF9pZF8yIjtzOjExMzA6IjxwPlRoZSBJbmR1c3RyaWFsIFJldm9sdXRpb24gYnJvdWdodCBhYm91dCBhIHZhcmlldHkgb2YgaW5ub3ZhdGl2ZSBpZGVhczombmJzcDsgZmFjdG9yaWVzLCBtYXNzIHByb2R1Y3Rpb24sIHBvd2VyZWQgbWFjaGluZXJ5IGZvciBzcGVjaWZpYyB1c2VzLCBhbmQgZXhvdGljIGRlc2lnbnMgYW5kIG1hdGVyaWFscy4mbmJzcDsgQnkgdGhlIGxhdGUgMTl0aCBDZW5...
The URI is:
/search/results/eyJyZXN1bHRfcGFnZSI6InNlYXJjaFwvcmVzdWx0cyIsImtleXdvcmRzIjoiYmFieSBncmFuZCJ9
Low 5 May 2019 11:25
Okay, so, this is more complicated than it seems.
For the excerpt, Low Search takes the value of the selected field, applies its associated formatting, then strips html tags, and tries to highlight the keywords in it. This works for most fields, specifically textarea fields.
This field however, is a Matrix field.
Matrix used to save its searchable data in the DB in a place where also the native search module would use it. That data would be used for the excerpt, too. Its actual data is stored in its own table. Apparently, Matrix now stores a serialized and base64-encoded string in there, containing data for the matrix instance. LS does not take that into account (and shouldn't).
I'd recommend either using a different field for the excerpt, or output the matrix field itself with its actual vars and optionally truncate that using a plugin...