Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello guys,
I use this module for a search on my site in conjunction with Search API DB as a server for custom entities and a custom view. In my Drupal logs there are messages like the following:
Notice: Array to string conversion in SearchApiHighlight->postprocessSearchResults() (Line 132 of /sites/all/modules/search_api/includes/processor_highlight.inc).
The view listing the search results does not include excerpts - just the entity's fields. I had no time yet to go through the code so does anyone has an idea what could cause this messages to appear?
Best,
Tobias
Comment | File | Size | Author |
---|---|---|---|
#5 | search_api-excerpt-notices-2216345-5.patch | 2.35 KB | fabianderijk |
#3 | array_to_string_conversion.patch | 2.05 KB | bacardi55 |
Comments
Comment #1
drunken monkeyHave you tried the latest dev release as well? Some highlighting processor issues were fixed since 1.11.
Comment #2
tobiberlinThank you for your reply... no I did not try the latest dev version - I simply deactivated the highlighting processor for my indexes as I do not really need it
Comment #3
bacardi55 CreditAttribution: bacardi55 commentedHi,
I still have the issue after upgrading to the search_api-7.x-1.x-dev version.
I'm using search_api_elasticsearch, not sure if the issue come from a difference between search_api_elasticsearch and search_api_solr.
In any case, I wrote that patch that fix the issue (at least in my use case).
Please let me know if you have comment/remarks or idea to improve the patch
Comment #4
drunken monkeyThanks for providing a patch!
Might be that the Elastic Search module you're using returns the field values in a weird format – i.e., a multi-dimensional array (instead of, at most, a normal array of strings). Please investigate whether that might not be the issue.
But otherwise, I guess this patch could also make sense. Looks good, thanks!
Comment #5
fabianderijkI've just updated this patch to also fix the
Warning: preg_split() expects parameter 2 to be string, array given in SearchApiHighlight->highlightField()
warning.Comment #7
drunken monkeyLooks good, thanks!
Committed.