How to write Filters with conditions as NOT LIKE '%abc%' in app search

There is a field like allergyconflict in app search documents that has a list of allergies for the product. This is stored as a comma separated string.
Eg - A product of milk has allergyconflicts as - "corn,lactose,milk" and another product of milk has allergyconflicts as -"corn".
I need to implement a filter such that I get milk products which do not have "corn" as allergy conflict.

For that if I write the below query, it will not eliminate the product which has "corn,lactose,milk" in the value.

{
	"query": "milk",
	"filters": {
		"none": [
			{ "allergyconflicts":  ["corn"]  }
		]
	}
}

Basically I need to implement a filter with Not Like '%corn%' condition.
Is there any way I can do that?

Filtering perform exact matches so I think you instead could store the data in the allergyconflicts field as an array of strings and not a single string with comma separated values.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.