I'm with Umbraco 12, I'm trying really hard to search for content with a specific value with wildcard. All the documentation / posts I stumble upon are outdated.
What I need : Find any "recipe" document that has either nodeName or shortDesc field containing the filter text in parameter.
It works but only as a wildcard at the end ot the beginning (example: for the word "ceiling", searching for "ceil" would find it, searching for "ling" would not)
Anyone could give me a working example on how to do this? Or point me to the right up to date documentation?
Searching for content with wildcard with Examine
I'm with Umbraco 12, I'm trying really hard to search for content with a specific value with wildcard. All the documentation / posts I stumble upon are outdated.
What I need : Find any "recipe" document that has either nodeName or shortDesc field containing the filter text in parameter.
Here's my code :
that seems to work but only IF the filter value matches exactly the document value.
I then tried that :
It works but only as a wildcard at the end ot the beginning (example: for the word "ceiling", searching for "ceil" would find it, searching for "ling" would not)
Anyone could give me a working example on how to do this? Or point me to the right up to date documentation?
Thanks
This looks likely to be the problem of leading wildcards. I’ve not had a chance to test this on 12 but the principle should be the same as what’s been written here: https://our.umbraco.com/forum/umbraco-8/97707-examine-leading-wildcard#comment-309422
Hello Richard, thanks for your reply.
I already stumbled on the link you provided. I'm just wondering how to set the AllowLeadingWildcard flag.
In the example you provided it is set by setting
query.QueryParser.AllowLeadingWildcard = true
.In v12, the QueryParser property does not seem to exist on the IQuery interface.
Thanks
is working on a reply...