Couchbase C Client  2.9.4
Asynchronous C Client for Couchbase
Full Text Search

Detailed Description

Search for strings in documents and more.


lcb_error_t lcb_fts_query (lcb_t instance, const void *cookie, const lcb_CMDFTS *cmd)
void lcb_fts_cancel (lcb_t, lcb_FTSHANDLE)


typedef void(* lcb_FTSCALLBACK) (lcb_t, int, const lcb_RESPFTS *)
typedef struct lcb_FTSREQ * lcb_FTSHANDLE
 Pointer for request instance.

Function Documentation

◆ lcb_fts_query()

lcb_error_t lcb_fts_query ( lcb_t  instance,
const void *  cookie,
const lcb_CMDFTS cmd 

Issue a full-text query. The callback (lcb_CMDFTS::callback) will be invoked for each hit. It will then be invoked one last time with the result metadata (including any facets) and the lcb_RESPFTS::rflags field having the LCB_RESP_F_FINAL bit set
instancethe instance
cookieopaque user cookie to be set in the response object
cmdcommand containing the query and callback

◆ lcb_fts_cancel()

void lcb_fts_cancel ( lcb_t  ,

Cancel a full-text query in progress. The handle is usually obtained via the lcb_CMDFTS::handle pointer.

Data Structure Documentation


struct lcb_RESPFTS

Response structure for full-text searches.

Data Fields
lcb_U16 rflags Flags for response structure.
const char * row A query hit, or response metadta (if rflags contains LCB_RESP_F_FINAL).

The format of the row will be JSON, and should be decoded by a JSON decoded in your application.

size_t nrow Length of row.
const lcb_RESPHTTP * htresp Original HTTP response obejct.

◆ lcb_CMDFTS

struct lcb_CMDFTS

Search Command.

Data Fields
lcb_U32 cmdflags Modifiers for command.

Currently none are defined

const char * query Encoded JSON query.
size_t nquery Length of JSON query.
lcb_FTSCALLBACK callback Callback to be invoked.

This must be supplied

lcb_FTSHANDLE * handle Optional pointer to store the handle.

The handle may then be used for query cancellation via lcb_fts_cancel()