I'm a bit confused about how to get proper wildcard searches working.
When building my query like below Examine removes the asteriks (*). And if you for example add MultipleCharacterWildcard it always appends it. I want the user to be able to choose what kind of search to do. How can I accomplish that?
you can use value.MultipleCharacterWildcard() extension tol escape the *, however I have never been able to get it to work if * is the first character lucene just complains.
so "test" will work, but not "test" very frustrating, have tried pretty much everything but it just errors with
'*' or '?' not allowed as first character in WildcardQuery
Thanks for answering. The problem is that MultipleCharacterWildcard always appends the asterisk. What I wanted to accomplish is that if the users search is "test" it should not be a wildcard search, but if they type "test*" or "te*st" it should.
After digging into this I ended up with a native query instead.
Here is the code to solve your problem with an asterisk as first letter
Examine wildcard search
I'm a bit confused about how to get proper wildcard searches working.
When building my query like below Examine removes the asteriks (*). And if you for example add MultipleCharacterWildcard it always appends it. I want the user to be able to choose what kind of search to do. How can I accomplish that?
you can use value.MultipleCharacterWildcard() extension tol escape the *, however I have never been able to get it to work if * is the first character lucene just complains.
so "test" will work, but not "test" very frustrating, have tried pretty much everything but it just errors with
'*' or '?' not allowed as first character in WildcardQuery
Thanks for answering. The problem is that MultipleCharacterWildcard always appends the asterisk. What I wanted to accomplish is that if the users search is "test" it should not be a wildcard search, but if they type "test*" or "te*st" it should.
After digging into this I ended up with a native query instead.
Here is the code to solve your problem with an asterisk as first letter
Hi
Any solution or code snippet to get results with wild card in Umbraco 8 Examine.
My expectation would be as per below: search keyword =Net*, which should search for Netapp or Network.
Thanks In advance.
Gurumurthy J V
is working on a reply...