Hi together
i am experiencing a problem while indexing a List (Text) field, if the key of the option is "0".
So the allowed values for the field are
"0": "available"
"1-3": "available in maximum 3 days"
"4-7" "available within a week"
While indexing a product that is "available", the field is not getting indexed.
I found an issue, that looks related, but since I am using the latest version, the patch in there is already attached.
https://www.drupal.org/project/search_api_solr/issues/3000123
In my opinion the condition in the \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::addIndexField for strings is not correct, since it will not index if the string is "0".
// No break, now we have a string.
case 'string':
default:
// Keep $value as it is.
if (!$value) {
continue 2;
}
If i change the condition for example to
if (!$value && strlen($value) == 0) {
i am getting the result indexed as i would expect it.
What do you think? Am i missing something?
Thank you for your feedback
Issue fork search_api_solr-3283086
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
megadesk3000 CreditAttribution: megadesk3000 at Unic commentedComment #6
mkalkbrenner