KQL wildcard operator problem in Sharepoint 2016 search web part
-
09-10-2020 - |
Question
In my Sharepoint 2013 on-premise environment, I have a page that contain a Content Search WebPart.
When I pass some parameters like the firstname or lastname using the wildcard * character in the URL of that page like this :
http://My_SP_2013_URL/.../Pages/search.aspx?k=firstname:"John*" AND lastname:"*"
The Content Search Webpart shows all the persons with a name beginning with John.
I upgrade the same site collection with the same page containing the same Content Search Webpart to SP 2016.
Now when I go to the same kind of URL I got no results.
http://My_SP_2016_URL/.../Pages/search.aspx?k=firstname:"John*" AND lastname:"*"
It's strange because it works well if I remove the parameter lastname like this :
http://My_SP_2016_URL/.../Pages/search.aspx?k=firstname:"John*"
It also work correctly if I insert some charaters before the wildcard in the lastname parameter like this :
http://My_SP_2016_URL/.../Pages/search.aspx?k=firstname:"John*" AND lastname:"Smi*"
I try with other parameters and it seems that the search result is always empty when I use the wildcard alone as the value of a parameter in the querystring.
Any idea ?
La solution
I just noticed you question as I've come across the same thing. Have you tried your query without the quotes e.g. lastname:Smi* rather than lastname:"Smi*"? In our case we've found a query which used to be lastname:"*" in SP2013, comes back empty in SP2016, but if we drop the quotes it comes back correctly.
Regards