Umbraco Examine for checkbox options
# help-with-umbraco
b
Hi, I am using umbraco 12. I would like to know whether there is a way to search for checked options using partial keywords. An examine query example would be helpful. This is what I have been using, which does retrieve the results: var results = qry.Field("tickBoxesOfFruits", "pears").Execute(); but I want to get the results for something like the following: var results = qry.Field("tickBoxesOfFruits", "pear").Execute(); So the content items with "pears" checked should return but it doesn't. If anyone has any ideas that would help.
d
Hi there! It sounds as though you want to either use a "multicharacter wildcard" or a "fuzzy" search. You use the former if you want a match to start with your term and the latter if you want a match to look like your term. Both are very easy to implement: you just replace
"pear"
with
"pear".MultiCharacterWildcard()
or with
"pear".Fuzzy()
For clarity, multicharacter wildcard would match: ✅️ pear ✅️ pears ✅️ pearjuice Multicharacter wildcard does not match: ❌️ conferencepear ❌️ peer On the other hand, fuzzy matches: ✅️ pear ✅️ peer ✅️ pears ✅️ pea But fuzzy does not match: ❌️ pearjuice ❌️ conferencepear
b
Many thanks, I'll give that a go
2 Views