I have search index for taxonomy terms and I am indexing the description field. When I crud entity(and it will get indexed) I will get error in \Drupal\search_api\Plugin\search_api\processor\HtmlFilter::processFieldValue from strip_tags because the provided value is an array and not a string. I have looked at the value and the issue is that provided value is an array with "value" and "format". So in order to make the index work I have to specifically select the "processed" "subfield" of the description field and it will be called "processed" so when I want to query the index I cannot use "description" condition but "processed" which is very confusing for someone who does not know the reason for this(ie. why should I query "processed" if I want to search in the description).
I think the handling of this field is not working correctly because fields like node body which is a text with summary and holds three values in db is working just fine on its own.
Comments
Comment #1
Anonymous (not verified) commentedivanjaros created an issue. See original summary.
Comment #2
Anonymous (not verified) commentedLooks like there is a way around this by editing the inde config and changing the property path of the description field into description:processed but that's messing with configs and if someone drops the fields ,attaches it again and reexports the config the "fix" will be lost and code depending on the exact field name will be broken(ie. no results).
Comment #3
drunken monkeyThanks for reporting this issue! When you are able to add a field, it should definitely not lead to errors while indexing, that much is clear. So, it's definitely a bug, one way or another.
However, if indexing
description:processedinstead ofdescription: you can also just add that directly instead of changing it manually in the saved config object. Just click the "(+)" on the left side of "Description" and the two sub-properties should become available to be added.Comment #4
drunken monkeyHave you tried with the latest dev version? I did, and couldn't reproduce your problem. For me, this works fine.
If the problem still occurs, could you post the relevant part (that field's settings) of the index config export?
Comment #5
Anonymous (not verified) commentedI haven't got time to test it yet, will update the issue when I will.
Comment #6
jespermb commentedI just tested the issue and coulden't reproduce the issue. Using the latest version of search api.