Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Huiying
Partner - Creator III
Partner - Creator III

How to get the exact match result from the searchResults method

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?

Labels (2)
1 Solution

Accepted Solutions
rankassovitz
Employee
Employee

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.

 

 

View solution in original post

5 Replies
alex_colombo
Employee
Employee

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.

Huiying
Partner - Creator III
Partner - Creator III
Author

Hei Alex, 
thank you for answering!
We use this method. Not sure whether this is the same as the smart search.

alex_colombo
Employee
Employee

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.

rankassovitz
Employee
Employee

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.

 

 

Huiying
Partner - Creator III
Partner - Creator III
Author

Thank you! 🙂
I'll let let our developer know your suggestion @rankassovitz