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

Detailed Description

Search for strings in documents and more.

Functions

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

Typedefs

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 
)


Stability
Volatile:
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
Parameters
instancethe instance
cookieopaque user cookie to be set in the response object
cmdcommand containing the query and callback
Examples:
example/fts/fts.c.

◆ lcb_fts_cancel()

void lcb_fts_cancel ( lcb_t  ,
lcb_FTSHANDLE   
)


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

Data Structure Documentation

◆ lcb_RESPFTS

struct lcb_RESPFTS

Response structure for full-text searches.

Examples:
example/fts/fts.c.
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.

Examples:
example/fts/fts.c.
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()