<private> new SearchQuery()
A query that yields results suitable for a simple result list.
- Source:
Extends
- sap.bc.ina.api.sina.sinabase.SearchQuery
- sap.bc.ina.api.sina.impl.inav2.sina_impl.Query
Methods
-
addFilterCondition(attribute, operator, value) → {sap.bc.ina.api.sina.sinabase.Query}
-
Adds a filter condition for this query. In the standard setting, the filter uses the AND operator for filter conditions on different attributes and the OR operator for filter conditions on the same attribute.
Parameters:
Name Type Description attribute
String The attribute that the filter condition is applied to. operator
String The operator used to filter the value. value
String The value of the attribute to be filtered in conjunction with the operator. - Inherited From:
- Source:
Returns:
thisExample
var query = sap.bc.ina.api.sina.createChartQuery(); query.addFilterCondition("CATEGORY", "=", "Notebooks") .addFilterCondition("PRICE","<","1000") .addFilterCondition("CURRENCY_CODE", "=", "EUR");
-
addResponseAttribute(attribute)
-
Adds a response attribute to the search query. The content of this attribute is returned if the search term was found in one of the response attributes.
Parameters:
Name Type Description attribute
String | Object If the argument is a string, it is the name of an attribute of the database view. If it is an object, it can contain the name of the attribute and additional server-side functions, like snippet or highlighting. See sap.bc.ina.api.sina.sinabase.Sina#createSearchQuery for examples. - Source:
-
dataSource(newDataSource) → {sap.bc.ina.api.sina.sinabase.filter.DataSource|sap.bc.ina.api.sina.sinabase.Query}
-
Returns or sets a new data source for this query. If no parameters are given, the current data source is returned. Otherwise, the data source is set.
Parameters:
Name Type Description newDataSource
sap.bc.ina.api.sina.sinabase.filter.DataSource | Object The current data source of this query. This can be an instance of sap.bc.ina.api.sina.sinabase.filter.DataSource or it can be a plain object, like { "schemaName" : "SYSTEM", "objectName" : "J_EPM_PRODUCT" }; that the system uses to create an instance of sap.bc.ina.api.sina.sinabase.filter.DataSource. - Inherited From:
- Source:
Returns:
The current data source of this query if no parameter is supplied, sap.bc.ina.api.sina.sinabase.Query otherwise to allow method chaining.- Type
- sap.bc.ina.api.sina.sinabase.filter.DataSource | sap.bc.ina.api.sina.sinabase.Query
-
getDataSource() → {sap.bc.ina.api.sina.sinabase.filter.DataSource}
-
Gets the data source object for this query.
- Inherited From:
- Source:
Returns:
The data source for this query.- Type
- sap.bc.ina.api.sina.sinabase.filter.DataSource
-
getFilter() → {sap.bc.api.sina.sinabase.filter.Filter}
-
Returns the filter instance for this query.
- Inherited From:
- Source:
Returns:
The filter instance for this query object.- Type
- sap.bc.api.sina.sinabase.filter.Filter
-
getResultSet(onSuccess, onError) → {Object}
-
Returns the result set of the query asynchronously.
Parameters:
Name Type Description onSuccess
function This function is called once the result has been retrieved from the server. The first parameter of this function is the result set. The result set has the function getElements() . This contains all result set elements. onError
function This function is called if the result set of the query could not be retrieved from the server. The first argument is an error object. - Inherited From:
- Source:
Returns:
returns a jQuery Promise Object, see http://api.jquery.com/Types/#Promise for more informations.- Type
- Object
-
getResultSetSync() → {Object}
-
Returns the result set of the query synchronously. This function blocks the JS thread until the server call is made. Use getResultSet() for an asynchronous version of this function that does not block the thread.
- Inherited From:
- Source:
Returns:
The result set of this query. Call getElements() on this object to get the result set elements.- Type
- Object
-
getSearchTerms() → {String}
-
Returns the search terms currently set.
- Inherited From:
- Source:
Returns:
The search terms.- Type
- String
-
getSkip() → {int}
-
Returns the skip value of this query.
- Inherited From:
- Source:
Returns:
The current skip value of this query.- Type
- int
-
getTop() → {int}
-
Returns the top value of this query.
- Inherited From:
- Source:
Returns:
The current top value of this query.- Type
- int
-
removeFilterCondition(attribute, operator, value) → {sap.bc.ina.api.sina.sinabase.Query}
-
Removes a previously added filter condition.
Parameters:
Name Type Description attribute
String The attribute that the filter condition was applied to. operator
String The operator that was used to filter the value. value
String The value of the attribute that was filtered in conjunction with the operator. - Inherited From:
- Source:
Returns:
thisExample
query.removeFilterCondition("CATEGORY", "=", "Notebooks") .removeFilterCondition("PRICE","<","1000") .removeFilterCondition("CURRENCY_CODE", "=", "EUR");
-
setDataSource(dataSource)
-
Sets the data source for this query object. Results already retrieved by this query are deleted.
Parameters:
Name Type Description dataSource
sap.bc.ina.api.sina.sinabase.filter.DataSource | Object The current data source of this query. This can be an instance of sap.bc.ina.api.sina.sinabase.filter.DataSource or it can be a plain object, like { "schemaName" : "SYSTEM", "objectName" : "J_EPM_PRODUCT" }; that the system uses to create an instance of sap.bc.ina.api.sina.sinabase.filter.DataSource - Inherited From:
- Source:
-
setFilter(filterInstance)
-
Sets the new filter instance for this query. Results already retrieved by this query are deleted.
Parameters:
Name Type Description filterInstance
sap.bc.api.sina.sinabase.filter.Filter The filter instance to be used by this query. - Inherited From:
- Source:
-
setOrderBy(orderBy)
-
Sets how the result will be ordered.
Parameters:
Name Type Description orderBy
Object | Array If orderBy is an object, it must have the properties 'orderBy' (string) and 'sortOrder' (string). The orderBy property can either be the name of a database attribute that the result will be sorted alphabetically for, or it can be the special '$$score$$' string. The result will then be ordered according to the SAP HANA Score function. This function can also receive an array of these objects for multiple order-by values, for example to order by $$score$$ and then alphabetically for an attribute. The result will then be ordered after the first entry. If two results have the same rank however, they will be ordered after the second order-by value, and so on. - Default Value:
- {orderBy:'$$score$$', sortOrder:'DESC'} See sap.bc.ina.api.sina.sinabase.Sina#createSearchQuery for examples.
- Source:
-
setSearchTerms(terms)
-
Sets the search terms for this query. Results already retrieved by this query are deleted.
Parameters:
Name Type Description terms
String The search terms to searched for by this query. - Inherited From:
- Source:
-
setSkip(skip)
-
Sets the skip value for this query. To use the new skip value, call getResultSet again.
Parameters:
Name Type Description skip
int The skip value for this query. - Inherited From:
- Source:
-
setTop(top)
-
Sets the top value for this query. To use the new top value, call getResultSet of this query again.
Parameters:
Name Type Description top
int The new top value of this query. - Inherited From:
- Source:
-
skip(newSkip) → {int|sap.bc.ina.api.sina.sinabase.Query}
-
Returns or sets a new skip value for this query. If no parameter is given, the current skip value is returned. Otherwise, the skip value is set.
Parameters:
Name Type Description newSkip
int The new skip value for this query. - Inherited From:
- Source:
Returns:
The current skip value of this query if no parameter was supplied, sap.bc.ina.api.sina.sinabase.Query otherwise to allow method chaining.- Type
- int | sap.bc.ina.api.sina.sinabase.Query
-
top(newTop) → {int|sap.bc.ina.api.sina.sinabase.Query}
-
Returns or sets a new top value for this query. If no parameter is given, the current top value is returned. Otherwise, the top value is set.
Parameters:
Name Type Description newTop
int The new top value for this query. - Inherited From:
- Source:
Returns:
The current top value of this query if no parameter was supplied, sap.bc.ina.api.sina.sinabase.Query otherwise to allow method chaining.- Type
- int | sap.bc.ina.api.sina.sinabase.Query