Closed astowell-adk closed 3 years ago
Have you tried the string "NULL" in the value field?
I did, but that did not give me the results I wanted (field being null). It appeared to just search for the string "NULL" in the field.
@astowell-adk, Can you please give me an example of when a field is indexed as 'null'? Just so I can replicate and test your suggestion.
Or do you mean fields that are not actually indexed, for example, field_category empty on an article is not added to the index document?
@carolpettirossi here's the specific scenario:
Thanks for the quick reply @astowell-adk. I could reproduce what you mean and the change on ConditionInput does fix the issue. I'll add that to the code and release a new graphql_search_api soon.
@carolpettirossi thank you so much!
I'm trying to query for any items in an index that do not have a null string field. I have found that because the value field is required for the ConditionInput I cannot accomplish this. I have tested making the value field in the ConditionInput optional and that does allow me to query for items where a given field is null.
Below is a working example after I modified the Drupal\graphql_search_api\Plugin\GraphQL\InputTypes\ConditionInput.php file
I edited the ConditionInput.php file to look like
Is there a different way I can query for an item without a null field value, or is this a bug?