Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hei
In our mashup, we have a search box using the searchResults method.
The function returns everything that contains the search string.
Some of our customers wants to get the exact match result.
Is there a way to fulfill their wish?
I would try format the search value into a Qlik search expression logic that fits your requirements before making the API call.
But or exact match I believe you'll need to wrap with parenthesis (not found in docs but on a separate community thread). But the trick is that values with spaces in them (like full name) should be wrapped with double quote to be viewed as one search term. So likely better to always wrap them since you don't know what user will input.
So, in your mashup, wrap the user input Lisa Taylor with ("Lisa Taylor") before passing it in the method.
Consideration/Caveats: Qlik search expressions work differently for different field types. The above suggestion should work for text. Not at all sure about Date or Numeric fields, let alone calculated dimensions.
I would also suggest trying the method "searchListObjectFor" instead of the searchResults.
Hey @Huiying , according to how this method works, you cannot have exact match as result. This is something you can do with your web app code using search results.
Hei Alex,
thank you for answering!
We use this method. Not sure whether this is the same as the smart search.
Yes it is the same method used by Smart Search in a Qlik app. As mention above, you cannot get exact result from method, you have to do it on your web app / code.
I would try format the search value into a Qlik search expression logic that fits your requirements before making the API call.
But or exact match I believe you'll need to wrap with parenthesis (not found in docs but on a separate community thread). But the trick is that values with spaces in them (like full name) should be wrapped with double quote to be viewed as one search term. So likely better to always wrap them since you don't know what user will input.
So, in your mashup, wrap the user input Lisa Taylor with ("Lisa Taylor") before passing it in the method.
Consideration/Caveats: Qlik search expressions work differently for different field types. The above suggestion should work for text. Not at all sure about Date or Numeric fields, let alone calculated dimensions.
I would also suggest trying the method "searchListObjectFor" instead of the searchResults.
Thank you! 🙂
I'll let let our developer know your suggestion @rankassovitz