I've got a large set of food dishes. I'd like to tag each dish with things like 'vegetarian', 'vegan', 'gluten free', etc. and be able to search by these tags. I.e., if a user wants to search 'pasta' as their query but also filter by 'vegetarian and gluten free'.
As there are an indefinite number of tags it isn't feasible to give each tag its own field. I'd much prefer to put them all in one 'tags' field, comma separated.
However, app-search seems to only filter/boost by exact match. I would like instead to do something like "If my tags field does not contain the term 'vegetarian', do not return this result."
But where "vegetarian", instead of matching on just the "vegetarian" tag would match any tag that contains the term "vegetarian". So it would match on both the "vegetarian" tag and the "vegetarian friendly" tag.
While that does sound like something I'd have to address, it's not the issue I was referring to.
I am hoping to have a tags field like you said, but since app-search doesn't have an array/enum type I believe i'm forced to have the field as a text type looking something like "vegetarian, vegetarian-friendly, vegan, gluten-free".
When using a Value filter, I must provide a field value to match the filter on:
because "The value must be an exact match", whereas this is only a partial match. (i.e., my tags field contains the term vegetarian but is not exactly equal to vegetarian.
I hope I'm overlooking something here. Thanks again for taking the time!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.