Skip to main content

searchSuggest method

ON THIS PAGE

searchSuggest method

Note: STABLE.

This API is reliable and breaking changes are unlikely.

qlik.app.searchSuggest(qTerms, qOptions, callback)

Returns suggestions of words from the values entered in the search. Acts as a helper for the searchResults method.

Version history

Introduced 1.1

Parameters

qTerms

Type: Array

Terms to search for.

qOptions

Type: Object

Optional.

Search options.

Properties:

Name Type Description
qSearchFields Array List of search fields.

callback

Type: Function

Optional.

Callback method. Registers a callback that is executed every time data is returned.

Returns

A promise of a Qlik associative engine reply.

Tip: For more information regarding a promise, see https://code.angularjs.org/1.7.0/docs/api/ng/service/$q#the-promise-api.

Example

app.searchSuggest(["se"], {}, function(reply) {
	var str = "";
		reply.qResult.qSuggestions.forEach(function(sugg){
			str += sugg.qValue + ' ';
		});
		alert(str);
	});