search

open fun search(expression: SearchExpression): DataQuery

Set {@link com.sap.cloud.mobile.kotlin.odata.DataQuery#searchExpression DataQuery.searchExpression} for free-text searching.

Example using proxy classes:
open fun searchExample(): kotlin.Unit
{
    val service = this.service;
    val query = DataQuery().search(SearchTerm.word("Juice"));
    val products = service.getProducts(query);
    this.showProducts(products);
}
Example using dynamic API:
open fun searchExample(): kotlin.Unit
{
    val service = this.service;
    val productsEntitySet = service.getEntitySet("Products");
    val query = DataQuery().from(productsEntitySet)
        .search(SearchTerm.word("Juice"));
    val products = service.executeQuery(query).getEntityList();
    this.showProducts(products);
}

Return

This query.

Parameters

expression

The search expression.