PrefixQuery

PrefixQuery根据前缀条件查询表中的数据。对于分词字符串类型(TEXT),只要分词后的词条中有词条满足前缀条件即可。

示例
$request = array(
    'table_name' => 'php_sdk_test',
    'index_name' => 'php_sdk_test_search_index',
    'search_query' => array(
        'offset' => 0,
        'limit' => 2,
        'get_total_count' => true,
        'query' => array(
            'query_type' => QueryTypeConst::PREFIX_QUERY,
            'query' => array(
                'field_name' => 'keyword',
                'prefix' => 'key'
            )
        ),
        'sort' => array(
            array(
                'field_sort' => array(
                    'field_name' => 'keyword',
                    'order' => SortOrderConst::SORT_ORDER_ASC
                )
            ),
        )
    ),
    'columns_to_get' => array(
        'return_type' => ColumnReturnTypeConst::RETURN_ALL,
        'return_names' => array('keyword')
    )
);
$response = $otsClient->search($request);