Go to the source code of this file.
Classes | |
struct | StringBuffer |
struct | DocList |
struct | DocListReader |
struct | QueryTerm |
struct | Query |
struct | Snippet |
struct | Snippet::snippetMatch |
struct | fulltext_vtab |
struct | fulltext_cursor |
struct | Token |
struct | TableSpec |
Defines | |
#define | TRACE(A) |
#define | VARINT_MAX 10 |
#define | DL_DEFAULT DL_POSITIONS |
#define | CHUNK_MAX 256 |
#define | TOKEN_EOF 0 |
#define | TOKEN_SPACE 1 |
#define | TOKEN_ID 2 |
#define | TOKEN_STRING 3 |
#define | TOKEN_PUNCT 4 |
#define | IdChar(C) (((c=C)&0x80)!=0 || (c>0x1f && isIdChar[c-0x20])) |
#define | FTS1_ROTOR_SZ (32) |
#define | FTS1_ROTOR_MASK (FTS1_ROTOR_SZ-1) |
#define | SNIPPET_IGNORE 0 |
#define | SNIPPET_DESIRED 1 |
Typedefs | |
typedef struct fulltext_vtab | fulltext_vtab |
Enumerations | |
enum | DocListType { DL_DOCIDS, DL_POSITIONS, DL_POSITIONS_OFFSETS, DL_DOCIDS, DL_POSITIONS, DL_POSITIONS_OFFSETS, DL_DOCIDS, DL_POSITIONS, DL_POSITIONS_OFFSETS } |
enum | { POS_END = 0, POS_COLUMN, POS_BASE } |
enum | QueryType { QUERY_GENERIC, QUERY_ROWID, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_ROWID, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_DOCID, QUERY_FULLTEXT } |
enum | fulltext_statement { CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, TERM_SELECT_STMT, TERM_SELECT_ALL_STMT, TERM_INSERT_STMT, TERM_UPDATE_STMT, TERM_DELETE_STMT, MAX_STMT, CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, CONTENT_EXISTS_STMT, BLOCK_INSERT_STMT, BLOCK_SELECT_STMT, BLOCK_DELETE_STMT, BLOCK_DELETE_ALL_STMT, SEGDIR_MAX_INDEX_STMT, SEGDIR_SET_STMT, SEGDIR_SELECT_LEVEL_STMT, SEGDIR_SPAN_STMT, SEGDIR_DELETE_STMT, SEGDIR_SELECT_SEGMENT_STMT, SEGDIR_SELECT_ALL_STMT, SEGDIR_DELETE_ALL_STMT, SEGDIR_COUNT_STMT, MAX_STMT, CONTENT_INSERT_STMT, CONTENT_SELECT_STMT, CONTENT_UPDATE_STMT, CONTENT_DELETE_STMT, CONTENT_EXISTS_STMT, BLOCK_INSERT_STMT, BLOCK_SELECT_STMT, BLOCK_DELETE_STMT, BLOCK_DELETE_ALL_STMT, SEGDIR_MAX_INDEX_STMT, SEGDIR_SET_STMT, SEGDIR_SELECT_LEVEL_STMT, SEGDIR_SPAN_STMT, SEGDIR_DELETE_STMT, SEGDIR_SELECT_SEGMENT_STMT, SEGDIR_SELECT_ALL_STMT, SEGDIR_DELETE_ALL_STMT, SEGDIR_COUNT_STMT, MAX_STMT } |
Functions | |
static void | initStringBuffer (StringBuffer *sb) |
static void | nappend (StringBuffer *sb, const char *zFrom, int nFrom) |
static void | append (StringBuffer *sb, const char *zFrom) |
static int | putVarint (char *p, sqlite_int64 v) |
static int | getVarint (const char *p, sqlite_int64 *v) |
static int | getVarint32 (const char *p, int *pi) |
static int | safe_isspace (char c) |
static int | safe_tolower (char c) |
static int | safe_isalnum (char c) |
static void | docListInit (DocList *d, DocListType iType, const char *pData, int nData) |
static DocList * | docListNew (DocListType iType) |
static void | docListDestroy (DocList *d) |
static void | docListDelete (DocList *d) |
static char * | docListEnd (DocList *d) |
static void | appendVarint (DocList *d, sqlite_int64 i) |
static void | docListAddDocid (DocList *d, sqlite_int64 iDocid) |
static void | addPos (DocList *d, int iColumn, int iPos) |
static void | docListAddPos (DocList *d, int iColumn, int iPos) |
static void | docListAddPosOffset (DocList *d, int iColumn, int iPos, int iStartOffset, int iEndOffset) |
static void | readerInit (DocListReader *r, DocList *pDoclist) |
static int | atEnd (DocListReader *pReader) |
static sqlite_int64 | peekDocid (DocListReader *pReader) |
static sqlite_int64 | readDocid (DocListReader *pReader) |
static int | readPosition (DocListReader *pReader, int *iColumn) |
static void | skipPositionList (DocListReader *pReader) |
static void | skipDocument (DocListReader *pReader) |
static int | skipToDocid (DocListReader *pReader, sqlite_int64 iDocid) |
static sqlite_int64 | firstDocid (DocList *d) |
static void | docListRestrictColumn (DocList *in, int iRestrictColumn) |
static void | docListDiscardEmpty (DocList *in) |
static void | docListSpliceElement (DocListReader *r, sqlite_int64 iDocid, const char *pSource, int nSource) |
static void | docListUpdate (DocList *d, DocList *pUpdate) |
static void | docListAccumulate (DocList *pAcc, DocList *pUpdate) |
static sqlite_int64 | nextDocid (DocListReader *pIn) |
static void | mergePosList (DocListReader *pLeft, DocListReader *pRight, sqlite_int64 iDocid, DocList *pOut) |
static void | docListPhraseMerge (DocList *pLeft, DocList *pRight, DocList *pOut) |
static void | docListAndMerge (DocList *pLeft, DocList *pRight, DocList *pOut) |
static void | docListOrMerge (DocList *pLeft, DocList *pRight, DocList *pOut) |
static void | docListExceptMerge (DocList *pLeft, DocList *pRight, DocList *pOut) |
static char * | string_dup_n (const char *s, int n) |
static char * | string_dup (const char *s) |
static char * | string_format (const char *zFormat, const char *zDb, const char *zName) |
static int | sql_exec (sqlite3 *db, const char *zDb, const char *zName, const char *zFormat) |
static int | sql_prepare (sqlite3 *db, const char *zDb, const char *zName, sqlite3_stmt **ppStmt, const char *zFormat) |
static struct fulltext_vtab * | cursor_vtab (fulltext_cursor *c) |
static void | appendList (StringBuffer *sb, int nString, char **azString) |
static const char * | contentInsertStatement (fulltext_vtab *v) |
static const char * | contentUpdateStatement (fulltext_vtab *v) |
static int | sql_get_statement (fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt) |
static int | sql_step_statement (fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt) |
static int | sql_single_step_statement (fulltext_vtab *v, fulltext_statement iStmt, sqlite3_stmt **ppStmt) |
static int | content_insert (fulltext_vtab *v, sqlite3_value *rowid, sqlite3_value **pValues) |
static int | content_update (fulltext_vtab *v, sqlite3_value **pValues, sqlite_int64 iRowid) |
static void | freeStringArray (int nString, const char **pString) |
static int | content_select (fulltext_vtab *v, sqlite_int64 iRow, const char ***pValues) |
static int | content_delete (fulltext_vtab *v, sqlite_int64 iRow) |
static int | term_select (fulltext_vtab *v, const char *pTerm, int nTerm, int iSegment, sqlite_int64 *rowid, DocList *out) |
static int | term_select_all (fulltext_vtab *v, int iColumn, const char *pTerm, int nTerm, DocList *out) |
static int | term_insert (fulltext_vtab *v, sqlite_int64 *piRowid, const char *pTerm, int nTerm, int iSegment, DocList *doclist) |
static int | term_update (fulltext_vtab *v, sqlite_int64 rowid, DocList *doclist) |
static int | term_delete (fulltext_vtab *v, sqlite_int64 rowid) |
static void | fulltext_vtab_destroy (fulltext_vtab *v) |
static int | getToken (const char *z, int *tokenType) |
static char ** | tokenizeString (const char *z, int *pnToken) |
static void | dequoteString (char *z) |
static void | tokenListToIdList (char **azIn) |
static char * | firstToken (char *zIn, char **pzTail) |
static int | startsWith (const char *s, const char *t) |
static void | clearTableSpec (TableSpec *p) |
static int | parseSpec (TableSpec *pSpec, int argc, const char *const *argv, char **pzErr) |
static char * | fulltextSchema (int nColumn, const char *const *azColumn, const char *zTableName) |
static int | constructVtab (sqlite3 *db, TableSpec *spec, sqlite3_vtab **ppVTab, char **pzErr) |
static int | fulltextConnect (sqlite3 *db, void *pAux, int argc, const char *const *argv, sqlite3_vtab **ppVTab, char **pzErr) |
static int | fulltextCreate (sqlite3 *db, void *pAux, int argc, const char *const *argv, sqlite3_vtab **ppVTab, char **pzErr) |
static int | fulltextBestIndex (sqlite3_vtab *pVTab, sqlite3_index_info *pInfo) |
static int | fulltextDisconnect (sqlite3_vtab *pVTab) |
static int | fulltextDestroy (sqlite3_vtab *pVTab) |
static int | fulltextOpen (sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor) |
static void | queryClear (Query *q) |
static void | snippetClear (Snippet *p) |
static void | snippetAppendMatch (Snippet *p, int iCol, int iTerm, int iStart, int nByte) |
static void | snippetOffsetsOfColumn (Query *pQuery, Snippet *pSnippet, int iColumn, const char *zDoc, int nDoc) |
static void | snippetAllOffsets (fulltext_cursor *p) |
static void | snippetOffsetText (Snippet *p) |
static int | wordBoundary (int iBreak, const char *zDoc, int nDoc, struct snippetMatch *aMatch, int nMatch, int iCol) |
static void | appendWhiteSpace (StringBuffer *p) |
static void | trimWhiteSpace (StringBuffer *p) |
static void | snippetText (fulltext_cursor *pCursor, const char *zStartMark, const char *zEndMark, const char *zEllipsis) |
static int | fulltextClose (sqlite3_vtab_cursor *pCursor) |
static int | fulltextNext (sqlite3_vtab_cursor *pCursor) |
static int | docListOfTerm (fulltext_vtab *v, int iColumn, QueryTerm *pQTerm, DocList **ppResult) |
static void | queryAdd (Query *q, const char *pTerm, int nTerm) |
static int | checkColumnSpecifier (fulltext_vtab *pVtab, const char *zToken, int nToken) |
static int | tokenizeSegment (sqlite3_tokenizer *pTokenizer, const char *pSegment, int nSegment, int inPhrase, Query *pQuery) |
static int | parseQuery (fulltext_vtab *v, const char *zInput, int nInput, int dfltColumn, Query *pQuery) |
static int | fulltextQuery (fulltext_vtab *v, int iColumn, const char *zInput, int nInput, DocList **pResult, Query *pQuery) |
static int | fulltextFilter (sqlite3_vtab_cursor *pCursor, int idxNum, const char *idxStr, int argc, sqlite3_value **argv) |
static int | fulltextEof (sqlite3_vtab_cursor *pCursor) |
static int | fulltextColumn (sqlite3_vtab_cursor *pCursor, sqlite3_context *pContext, int idxCol) |
static int | fulltextRowid (sqlite3_vtab_cursor *pCursor, sqlite_int64 *pRowid) |
static int | buildTerms (fulltext_vtab *v, fts1Hash *terms, sqlite_int64 iDocid, const char *zText, int iColumn) |
static int | index_insert_term (fulltext_vtab *v, const char *pTerm, int nTerm, DocList *d) |
static int | insertTerms (fulltext_vtab *v, fts1Hash *terms, sqlite_int64 iRowid, sqlite3_value **pValues) |
static int | deleteTerms (fulltext_vtab *v, fts1Hash *pTerms, sqlite_int64 iRowid) |
static int | index_insert (fulltext_vtab *v, sqlite3_value *pRequestRowid, sqlite3_value **pValues, sqlite_int64 *piRowid, fts1Hash *pTerms) |
static int | index_delete (fulltext_vtab *v, sqlite_int64 iRow, fts1Hash *pTerms) |
static int | index_update (fulltext_vtab *v, sqlite_int64 iRow, sqlite3_value **pValues, fts1Hash *pTerms) |
static int | fulltextUpdate (sqlite3_vtab *pVtab, int nArg, sqlite3_value **ppArg, sqlite_int64 *pRowid) |
static void | snippetFunc (sqlite3_context *pContext, int argc, sqlite3_value **argv) |
static void | snippetOffsetsFunc (sqlite3_context *pContext, int argc, sqlite3_value **argv) |
static int | fulltextFindFunction (sqlite3_vtab *pVtab, int nArg, const char *zName, void(**pxFunc)(sqlite3_context *, int, sqlite3_value **), void **ppArg) |
static int | fulltextRename (sqlite3_vtab *pVtab, const char *zName) |
int | sqlite3Fts1Init (sqlite3 *db) |
int | sqlite3_extension_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi) |
Variables | |
static const char *const | fulltext_zStatement [MAX_STMT] |
static const sqlite3_module | fulltextModule |
static const char | isIdChar [] |
#define CHUNK_MAX 256 |
Definition at line 1038 of file fts1.c.
Referenced by index_insert_term().
#define DL_DEFAULT DL_POSITIONS |
Definition at line 231 of file fts1.c.
Referenced by buildTerms(), deleteTerms(), docListOfTerm(), docListUnion(), index_insert_term(), leafWriterStep(), leafWriterStepMerge(), leavesReadersMerge(), loadSegment(), optimizeInternal(), term_select(), term_select_all(), and termSelect().
#define FTS1_ROTOR_MASK (FTS1_ROTOR_SZ-1) |
Definition at line 2205 of file fts1.c.
Referenced by snippetOffsetsOfColumn().
#define FTS1_ROTOR_SZ (32) |
Definition at line 2204 of file fts1.c.
Referenced by snippetOffsetsOfColumn().
#define IdChar | ( | C | ) | (((c=C)&0x80)!=0 || (c>0x1f && isIdChar[c-0x20])) |
Definition at line 1559 of file fts1.c.
Referenced by getToken(), sqlite3_complete(), and sqlite3GetToken().
#define SNIPPET_DESIRED 1 |
Definition at line 2404 of file fts1.c.
Referenced by snippetText().
#define SNIPPET_IGNORE 0 |
Definition at line 2403 of file fts1.c.
Referenced by snippetText().
#define TOKEN_EOF 0 |
Definition at line 1531 of file fts1.c.
Referenced by firstToken(), ftsGetToken(), and getToken().
#define TOKEN_ID 2 |
Definition at line 1533 of file fts1.c.
Referenced by ftsGetToken(), and getToken().
#define TOKEN_PUNCT 4 |
Definition at line 1535 of file fts1.c.
Referenced by ftsGetToken(), and getToken().
#define TOKEN_SPACE 1 |
Definition at line 1532 of file fts1.c.
Referenced by firstToken(), ftsGetToken(), getToken(), and tokenizeString().
#define TOKEN_STRING 3 |
Definition at line 1534 of file fts1.c.
Referenced by ftsGetToken(), and getToken().
#define VARINT_MAX 10 |
Definition at line 109 of file fts1.c.
Referenced by appendVarint(), dlcAddDoclist(), dlwAdd(), dlwAppend(), fts3GetVarint(), fts3PutVarint(), getVarint(), interiorBlockNew(), interiorWriterAppend(), leafWriterEncodeTerm(), leafWriterInlineFlush(), leafWriterStepMerge(), plwAdd(), plwInit(), plwTerminate(), and putVarint().
typedef struct fulltext_vtab fulltext_vtab |
enum DocListType |
enum fulltext_statement |
enum QueryType |
static void addPos | ( | DocList * | d, | |
int | iColumn, | |||
int | iPos | |||
) | [static] |
Definition at line 306 of file fts1.c.
References appendVarint(), DocList::iLastColumn, DocList::iLastOffset, DocList::iLastPos, DocList::nData, POS_BASE, and POS_COLUMN.
Referenced by docListAddPos(), and docListAddPosOffset().
static void append | ( | StringBuffer * | sb, | |
const char * | zFrom | |||
) | [static] |
Definition at line 91 of file fts1.c.
References nappend().
Referenced by appendList(), appendWhiteSpace(), contentInsertStatement(), contentUpdateStatement(), fulltextCreate(), snippetOffsetText(), and snippetText().
static void appendList | ( | StringBuffer * | sb, | |
int | nString, | |||
char ** | azString | |||
) | [static] |
Definition at line 1123 of file fts1.c.
References append().
Referenced by contentInsertStatement(), and fulltextCreate().
static void appendVarint | ( | DocList * | d, | |
sqlite_int64 | i | |||
) | [static] |
Definition at line 288 of file fts1.c.
References DocList::nData, DocList::pData, putVarint, and VARINT_MAX.
Referenced by addPos(), docListAddDocid(), docListAddPos(), and docListAddPosOffset().
static void appendWhiteSpace | ( | StringBuffer * | p | ) | [static] |
Definition at line 2383 of file fts1.c.
References append(), StringBuffer::len, StringBuffer::s, and safe_isspace().
Referenced by snippetText().
static int atEnd | ( | DocListReader * | pReader | ) | [static] |
Definition at line 390 of file fts1.c.
References docListEnd(), DocListReader::p, and DocListReader::pDoclist.
Referenced by docListAccumulate(), docListDiscardEmpty(), docListRestrictColumn(), nextDocid(), peekDocid(), readDocid(), readPosition(), and skipToDocid().
static int buildTerms | ( | fulltext_vtab * | v, | |
fts1Hash * | terms, | |||
sqlite_int64 | iDocid, | |||
const char * | zText, | |||
int | iColumn | |||
) | [static] |
Definition at line 2970 of file fts1.c.
References DL_DEFAULT, docListAddDocid(), docListAddPosOffset(), docListNew(), fts1HashFind, fts1HashInsert, sqlite3_tokenizer::pModule, sqlite3_tokenizer_cursor::pTokenizer, fulltext_vtab::pTokenizer, SQLITE_ERROR, SQLITE_OK, sqlite3_tokenizer_module::xClose, sqlite3_tokenizer_module::xNext, and sqlite3_tokenizer_module::xOpen.
Referenced by deleteTerms(), and insertTerms().
static int checkColumnSpecifier | ( | fulltext_vtab * | pVtab, | |
const char * | zToken, | |||
int | nToken | |||
) | [static] |
Definition at line 2646 of file fts1.c.
References fulltext_vtab::azColumn, and fulltext_vtab::nColumn.
Referenced by tokenizeSegment().
static void clearTableSpec | ( | TableSpec * | p | ) | [static] |
Definition at line 1800 of file fts1.c.
References TableSpec::azColumn, TableSpec::azContentColumn, and TableSpec::azTokenizer.
Referenced by fulltextConnect(), fulltextCreate(), and parseSpec().
static int constructVtab | ( | sqlite3 * | db, | |
TableSpec * | spec, | |||
sqlite3_vtab ** | ppVTab, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 1936 of file fts1.c.
References TableSpec::azColumn, fulltext_vtab::azColumn, TableSpec::azContentColumn, fulltext_vtab::azContentColumn, TableSpec::azTokenizer, fulltext_vtab::base, fulltext_vtab::db, fulltext_vtab_destroy(), fulltextSchema(), TableSpec::nColumn, fulltext_vtab::nColumn, fulltext_vtab::pFulltextStatements, sqlite3_tokenizer::pModule, fulltext_vtab::pTokenizer, sqlite3_declare_vtab(), sqlite3_free(), sqlite3_mprintf(), sqlite3Fts1PorterTokenizerModule(), sqlite3Fts1SimpleTokenizerModule(), SQLITE_ERROR, SQLITE_NOMEM, SQLITE_OK, startsWith(), TRACE, sqlite3_tokenizer_module::xCreate, TableSpec::zDb, fulltext_vtab::zDb, TableSpec::zName, and fulltext_vtab::zName.
Referenced by fulltextConnect(), and fulltextCreate().
static int content_delete | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow | |||
) | [static] |
Definition at line 1338 of file fts1.c.
References CONTENT_DELETE_STMT, sql_get_statement(), sql_single_step_statement(), sqlite3_bind_int64(), and SQLITE_OK.
Referenced by index_delete().
static int content_insert | ( | fulltext_vtab * | v, | |
sqlite3_value * | rowid, | |||
sqlite3_value ** | pValues | |||
) | [static] |
Definition at line 1245 of file fts1.c.
References CONTENT_INSERT_STMT, fulltext_vtab::nColumn, sql_get_statement(), sql_single_step_statement(), sqlite3_bind_value(), and SQLITE_OK.
Referenced by index_insert().
static int content_select | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow, | |||
const char *** | pValues | |||
) | [static] |
Definition at line 1298 of file fts1.c.
References CONTENT_SELECT_STMT, freeStringArray(), fulltext_vtab::nColumn, sql_get_statement(), sql_step_statement(), sqlite3_bind_int64(), sqlite3_column_text(), sqlite3_column_type(), sqlite3_step(), SQLITE_DONE, SQLITE_NULL, SQLITE_OK, SQLITE_ROW, and string_dup().
Referenced by deleteTerms().
static int content_update | ( | fulltext_vtab * | v, | |
sqlite3_value ** | pValues, | |||
sqlite_int64 | iRowid | |||
) | [static] |
Definition at line 1265 of file fts1.c.
References CONTENT_UPDATE_STMT, fulltext_vtab::nColumn, sql_get_statement(), sql_single_step_statement(), sqlite3_bind_int64(), sqlite3_bind_value(), and SQLITE_OK.
Referenced by index_update().
static const char* contentInsertStatement | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 1134 of file fts1.c.
References append(), appendList(), fulltext_vtab::azContentColumn, initStringBuffer(), fulltext_vtab::nColumn, and StringBuffer::s.
Referenced by sql_get_statement().
static const char* contentUpdateStatement | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 1152 of file fts1.c.
References append(), fulltext_vtab::azContentColumn, initStringBuffer(), fulltext_vtab::nColumn, and StringBuffer::s.
Referenced by sql_get_statement().
static struct fulltext_vtab* cursor_vtab | ( | fulltext_cursor * | c | ) | [static, read] |
Definition at line 1116 of file fts1.c.
References fulltext_cursor::base, and sqlite3_vtab_cursor::pVtab.
Referenced by fulltextColumn(), and fulltextFilter().
static int deleteTerms | ( | fulltext_vtab * | v, | |
fts1Hash * | pTerms, | |||
sqlite_int64 | iRowid | |||
) | [static] |
Definition at line 3096 of file fts1.c.
References buildTerms(), content_select(), freeStringArray(), fulltext_vtab::nColumn, and SQLITE_OK.
Referenced by index_delete(), and index_update().
static void dequoteString | ( | char * | z | ) | [static] |
Definition at line 1681 of file fts1.c.
Referenced by firstToken(), and tokenListToIdList().
Definition at line 637 of file fts1.c.
References atEnd(), docListSpliceElement(), DocList::nData, DocListReader::p, DocList::pData, readDocid(), readerInit(), and skipPositionList().
Referenced by index_insert_term(), and term_select_all().
static void docListAddDocid | ( | DocList * | d, | |
sqlite_int64 | iDocid | |||
) | [static] |
Definition at line 296 of file fts1.c.
References appendVarint(), DL_POSITIONS, DocList::iLastColumn, DocList::iLastOffset, DocList::iLastPos, DocList::iType, and POS_END.
Referenced by buildTerms(), docListAndMerge(), docListDiscardEmpty(), docListExceptMerge(), docListOrMerge(), docListRestrictColumn(), and mergePosList().
static void docListAddPos | ( | DocList * | d, | |
int | iColumn, | |||
int | iPos | |||
) | [static] |
Definition at line 322 of file fts1.c.
References addPos(), appendVarint(), DL_POSITIONS, DocList::iType, and POS_END.
Referenced by docListDiscardEmpty(), docListRestrictColumn(), and mergePosList().
static void docListAddPosOffset | ( | DocList * | d, | |
int | iColumn, | |||
int | iPos, | |||
int | iStartOffset, | |||
int | iEndOffset | |||
) | [static] |
Definition at line 334 of file fts1.c.
References addPos(), appendVarint(), DL_POSITIONS, DL_POSITIONS_OFFSETS, DocList::iLastOffset, DocList::iType, and POS_END.
Referenced by buildTerms().
Definition at line 762 of file fts1.c.
References DL_POSITIONS, docListAddDocid(), DocList::iType, left, nextDocid(), readerInit(), and right.
Referenced by fulltextQuery().
static void docListDelete | ( | DocList * | d | ) | [static] |
Definition at line 278 of file fts1.c.
References docListDestroy().
Referenced by docListOfTerm(), fulltextClose(), fulltextFilter(), fulltextQuery(), and fulltextUpdate().
static void docListDestroy | ( | DocList * | d | ) | [static] |
Definition at line 271 of file fts1.c.
References DocList::pData.
Referenced by docListDelete(), docListDiscardEmpty(), docListRestrictColumn(), index_insert_term(), and term_select_all().
static void docListDiscardEmpty | ( | DocList * | in | ) | [static] |
Definition at line 552 of file fts1.c.
References atEnd(), DL_POSITIONS, docListAddDocid(), docListAddPos(), docListDestroy(), docListInit(), DocList::iType, match(), readDocid(), readerInit(), and readPosition().
Referenced by term_select_all().
static char* docListEnd | ( | DocList * | d | ) | [static] |
Definition at line 283 of file fts1.c.
References DocList::nData, and DocList::pData.
Referenced by atEnd(), and docListSpliceElement().
Definition at line 841 of file fts1.c.
References docListAddDocid(), left, nextDocid(), readerInit(), and right.
Referenced by fulltextQuery().
static void docListInit | ( | DocList * | d, | |
DocListType | iType, | |||
const char * | pData, | |||
int | nData | |||
) | [static] |
Definition at line 250 of file fts1.c.
References DocList::iLastColumn, DocList::iLastOffset, DocList::iLastPos, DocList::iType, DocList::nData, and DocList::pData.
Referenced by docListDiscardEmpty(), docListNew(), docListRestrictColumn(), index_insert_term(), term_select(), and term_select_all().
static DocList* docListNew | ( | DocListType | iType | ) | [static] |
Definition at line 265 of file fts1.c.
References d(), and docListInit().
Referenced by buildTerms(), docListOfTerm(), and fulltextQuery().
static int docListOfTerm | ( | fulltext_vtab * | v, | |
int | iColumn, | |||
QueryTerm * | pQTerm, | |||
DocList ** | ppResult | |||
) | [static] |
Definition at line 2587 of file fts1.c.
References DL_DOCIDS, DL_POSITIONS, docListDelete(), docListNew(), docListPhraseMerge(), QueryTerm::nPhrase, QueryTerm::nTerm, QueryTerm::pTerm, SQLITE_OK, and term_select_all().
Referenced by fulltextQuery().
Definition at line 796 of file fts1.c.
References docListAddDocid(), left, nextDocid(), readerInit(), and right.
Referenced by fulltextQuery().
Definition at line 730 of file fts1.c.
References left, mergePosList(), nextDocid(), readerInit(), and right.
Referenced by docListOfTerm().
static void docListRestrictColumn | ( | DocList * | in, | |
int | iRestrictColumn | |||
) | [static] |
Definition at line 526 of file fts1.c.
References atEnd(), DL_POSITIONS, docListAddDocid(), docListAddPos(), docListDestroy(), docListInit(), DocList::iType, readDocid(), readerInit(), and readPosition().
Referenced by term_select_all().
static void docListSpliceElement | ( | DocListReader * | r, | |
sqlite_int64 | iDocid, | |||
const char * | pSource, | |||
int | nSource | |||
) | [static] |
Definition at line 583 of file fts1.c.
References d(), docListEnd(), DocList::nData, DocListReader::p, DocList::pData, DocListReader::pDoclist, skipDocument(), and skipToDocid().
Referenced by docListAccumulate(), and docListUpdate().
Definition at line 623 of file fts1.c.
References docListSpliceElement(), firstDocid(), DocList::iType, DocList::nData, DocList::pData, and readerInit().
Referenced by index_insert_term().
static sqlite_int64 firstDocid | ( | DocList * | d | ) | [static] |
Definition at line 483 of file fts1.c.
References readDocid(), and readerInit().
Referenced by docListUpdate().
static char* firstToken | ( | char * | zIn, | |
char ** | pzTail | |||
) | [static] |
Definition at line 1745 of file fts1.c.
References dequoteString(), getToken(), TOKEN_EOF, TOKEN_SPACE, and ttype.
Referenced by parseSpec().
static void freeStringArray | ( | int | nString, | |
const char ** | pString | |||
) | [static] |
Definition at line 1283 of file fts1.c.
Referenced by content_select(), and deleteTerms().
static void fulltext_vtab_destroy | ( | fulltext_vtab * | v | ) | [static] |
Definition at line 1504 of file fts1.c.
References fulltext_vtab::azColumn, fulltext_vtab::azContentColumn, MAX_STMT, fulltext_vtab::nColumn, fulltext_vtab::pFulltextStatements, sqlite3_tokenizer::pModule, fulltext_vtab::pTokenizer, sqlite3_finalize(), sqlite3_free(), TRACE, and sqlite3_tokenizer_module::xDestroy.
Referenced by constructVtab(), fulltextDestroy(), and fulltextDisconnect().
static int fulltextBestIndex | ( | sqlite3_vtab * | pVTab, | |
sqlite3_index_info * | pInfo | |||
) | [static] |
Definition at line 2087 of file fts1.c.
References sqlite3_index_info::aConstraint, sqlite3_index_info::aConstraintUsage, sqlite3_index_info::sqlite3_index_constraint_usage::argvIndex, sqlite3_index_info::estimatedCost, sqlite3_index_info::idxNum, sqlite3_index_info::nConstraint, sqlite3_index_info::sqlite3_index_constraint_usage::omit, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_ROWID, SQLITE_INDEX_CONSTRAINT_EQ, SQLITE_INDEX_CONSTRAINT_MATCH, SQLITE_OK, and TRACE.
static int fulltextClose | ( | sqlite3_vtab_cursor * | pCursor | ) | [static] |
Definition at line 2524 of file fts1.c.
References docListDelete(), DocListReader::pDoclist, fulltext_cursor::pStmt, fulltext_cursor::q, queryClear(), fulltext_cursor::result, fulltext_cursor::snippet, snippetClear(), sqlite3_finalize(), SQLITE_OK, and TRACE.
static int fulltextColumn | ( | sqlite3_vtab_cursor * | pCursor, | |
sqlite3_context * | pContext, | |||
int | idxCol | |||
) | [static] |
Definition at line 2939 of file fts1.c.
References cursor_vtab(), fulltext_vtab::nColumn, fulltext_cursor::pStmt, sqlite3_column_value(), sqlite3_result_blob(), sqlite3_result_value(), SQLITE_OK, and SQLITE_TRANSIENT.
static int fulltextConnect | ( | sqlite3 * | db, | |
void * | pAux, | |||
int | argc, | |||
const char *const * | argv, | |||
sqlite3_vtab ** | ppVTab, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 2004 of file fts1.c.
References clearTableSpec(), constructVtab(), parseSpec(), and SQLITE_OK.
static int fulltextCreate | ( | sqlite3 * | db, | |
void * | pAux, | |||
int | argc, | |||
const char *const * | argv, | |||
sqlite3_vtab ** | ppVTab, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 2055 of file fts1.c.
References append(), appendList(), TableSpec::azContentColumn, clearTableSpec(), constructVtab(), initStringBuffer(), TableSpec::nColumn, parseSpec(), StringBuffer::s, sql_exec(), SQLITE_OK, TRACE, TableSpec::zDb, and TableSpec::zName.
static int fulltextDestroy | ( | sqlite3_vtab * | pVTab | ) | [static] |
Definition at line 2127 of file fts1.c.
References fulltext_vtab::db, fulltext_vtab_destroy(), sql_exec(), SQLITE_OK, TRACE, fulltext_vtab::zDb, and fulltext_vtab::zName.
static int fulltextDisconnect | ( | sqlite3_vtab * | pVTab | ) | [static] |
Definition at line 2121 of file fts1.c.
References fulltext_vtab_destroy(), SQLITE_OK, and TRACE.
static int fulltextEof | ( | sqlite3_vtab_cursor * | pCursor | ) | [static] |
Definition at line 2928 of file fts1.c.
References fulltext_cursor::eof.
static int fulltextFilter | ( | sqlite3_vtab_cursor * | pCursor, | |
int | idxNum, | |||
const char * | idxStr, | |||
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 2877 of file fts1.c.
References cursor_vtab(), fulltext_vtab::db, docListDelete(), fulltextNext(), fulltextQuery(), fulltext_cursor::iCursorType, DocListReader::pDoclist, fulltext_cursor::pStmt, fulltext_cursor::q, QUERY_FULLTEXT, QUERY_GENERIC, QUERY_ROWID, queryClear(), readerInit(), fulltext_cursor::result, sql_prepare(), sqlite3_bind_int64(), sqlite3_finalize(), sqlite3_free(), sqlite3_mprintf(), sqlite3_value_int64(), sqlite3_value_text(), SQLITE_OK, TRACE, fulltext_vtab::zDb, and fulltext_vtab::zName.
static int fulltextFindFunction | ( | sqlite3_vtab * | pVtab, | |
int | nArg, | |||
const char * | zName, | |||
void(**)(sqlite3_context *, int, sqlite3_value **) | pxFunc, | |||
void ** | ppArg | |||
) | [static] |
Definition at line 3269 of file fts1.c.
References snippetFunc(), and snippetOffsetsFunc().
static int fulltextNext | ( | sqlite3_vtab_cursor * | pCursor | ) | [static] |
Definition at line 2537 of file fts1.c.
References fulltext_cursor::eof, fulltext_cursor::iCursorType, nextDocid(), fulltext_cursor::pStmt, QUERY_FULLTEXT, fulltext_cursor::result, fulltext_cursor::snippet, snippetClear(), sqlite3_bind_int64(), sqlite3_reset(), sqlite3_step(), SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, SQLITE_ROW, and TRACE.
Referenced by fulltextFilter().
static int fulltextOpen | ( | sqlite3_vtab * | pVTab, | |
sqlite3_vtab_cursor ** | ppCursor | |||
) | [static] |
Definition at line 2142 of file fts1.c.
References fulltext_cursor::base, SQLITE_OK, and TRACE.
static int fulltextQuery | ( | fulltext_vtab * | v, | |
int | iColumn, | |||
const char * | zInput, | |||
int | nInput, | |||
DocList ** | pResult, | |||
Query * | pQuery | |||
) | [static] |
Definition at line 2775 of file fts1.c.
References DL_DOCIDS, docListAndMerge(), docListDelete(), docListExceptMerge(), docListNew(), docListOfTerm(), docListOrMerge(), QueryTerm::nPhrase, Query::nTerms, parseQuery(), Query::pTerms, queryClear(), SQLITE_ERROR, and SQLITE_OK.
Referenced by fulltextFilter().
static int fulltextRename | ( | sqlite3_vtab * | pVtab, | |
const char * | zName | |||
) | [static] |
Definition at line 3289 of file fts1.c.
References fulltext_vtab::db, sqlite3_exec(), sqlite3_free(), sqlite3_mprintf(), SQLITE_NOMEM, fulltext_vtab::zDb, and fulltext_vtab::zName.
static int fulltextRowid | ( | sqlite3_vtab_cursor * | pCursor, | |
sqlite_int64 * | pRowid | |||
) | [static] |
Definition at line 2960 of file fts1.c.
References fulltext_cursor::pStmt, sqlite3_column_int64(), and SQLITE_OK.
static char* fulltextSchema | ( | int | nColumn, | |
const char *const * | azColumn, | |||
const char * | zTableName | |||
) | [static] |
Definition at line 1912 of file fts1.c.
References sqlite3_free(), and sqlite3_mprintf().
Referenced by constructVtab().
static int fulltextUpdate | ( | sqlite3_vtab * | pVtab, | |
int | nArg, | |||
sqlite3_value ** | ppArg, | |||
sqlite_int64 * | pRowid | |||
) | [static] |
Definition at line 3151 of file fts1.c.
References docListDelete(), FTS1_HASH_STRING, fts1HashClear, fts1HashData, fts1HashFirst, fts1HashInit, fts1HashKey, fts1HashKeysize, fts1HashNext, index_delete(), index_insert(), index_insert_term(), index_update(), fulltext_vtab::nColumn, sqlite3_value_int64(), sqlite3_value_type(), SQLITE_ERROR, SQLITE_INTEGER, SQLITE_NULL, SQLITE_OK, and TRACE.
static int getToken | ( | const char * | z, | |
int * | tokenType | |||
) | [static] |
Definition at line 1566 of file fts1.c.
References IdChar, safe_isspace(), TOKEN_EOF, TOKEN_ID, TOKEN_PUNCT, TOKEN_SPACE, and TOKEN_STRING.
Referenced by firstToken(), and tokenizeString().
static int getVarint | ( | const char * | p, | |
sqlite_int64 * | v | |||
) | [static] |
Definition at line 129 of file fts1.c.
References VARINT_MAX.
static int getVarint32 | ( | const char * | p, | |
int * | pi | |||
) | [static] |
static int index_delete | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow, | |||
fts1Hash * | pTerms | |||
) | [static] |
Definition at line 3127 of file fts1.c.
References content_delete(), deleteTerms(), and SQLITE_OK.
Referenced by fulltextUpdate().
static int index_insert | ( | fulltext_vtab * | v, | |
sqlite3_value * | pRequestRowid, | |||
sqlite3_value ** | pValues, | |||
sqlite_int64 * | piRowid, | |||
fts1Hash * | pTerms | |||
) | [static] |
Definition at line 3114 of file fts1.c.
References content_insert(), fulltext_vtab::db, insertTerms(), sqlite3_last_insert_rowid(), and SQLITE_OK.
Referenced by fulltextUpdate().
static int index_insert_term | ( | fulltext_vtab * | v, | |
const char * | pTerm, | |||
int | nTerm, | |||
DocList * | d | |||
) | [static] |
Definition at line 3016 of file fts1.c.
References CHUNK_MAX, DL_DEFAULT, docListAccumulate(), docListDestroy(), docListInit(), docListUpdate(), DocList::nData, SQLITE_DONE, SQLITE_ERROR, SQLITE_OK, SQLITE_ROW, term_delete(), term_insert(), term_select(), and term_update().
Referenced by fulltextUpdate().
static int index_update | ( | fulltext_vtab * | v, | |
sqlite_int64 | iRow, | |||
sqlite3_value ** | pValues, | |||
fts1Hash * | pTerms | |||
) | [static] |
Definition at line 3135 of file fts1.c.
References content_update(), deleteTerms(), insertTerms(), and SQLITE_OK.
Referenced by fulltextUpdate().
static void initStringBuffer | ( | StringBuffer * | sb | ) | [static] |
Definition at line 71 of file fts1.c.
References StringBuffer::alloced, StringBuffer::len, and StringBuffer::s.
Referenced by contentInsertStatement(), contentUpdateStatement(), fulltextCreate(), nappend(), snippetOffsetText(), and snippetText().
static int insertTerms | ( | fulltext_vtab * | v, | |
fts1Hash * | terms, | |||
sqlite_int64 | iRowid, | |||
sqlite3_value ** | pValues | |||
) | [static] |
Definition at line 3083 of file fts1.c.
References buildTerms(), fulltext_vtab::nColumn, sqlite3_value_text(), and SQLITE_OK.
Referenced by index_insert(), and index_update().
static void mergePosList | ( | DocListReader * | pLeft, | |
DocListReader * | pRight, | |||
sqlite_int64 | iDocid, | |||
DocList * | pOut | |||
) | [static] |
Definition at line 688 of file fts1.c.
References DL_POSITIONS, docListAddDocid(), docListAddPos(), DocList::iType, match(), readPosition(), and skipPositionList().
Referenced by docListPhraseMerge().
static void nappend | ( | StringBuffer * | sb, | |
const char * | zFrom, | |||
int | nFrom | |||
) | [static] |
Definition at line 78 of file fts1.c.
References StringBuffer::alloced, initStringBuffer(), StringBuffer::len, and StringBuffer::s.
Referenced by append(), and snippetText().
static sqlite_int64 nextDocid | ( | DocListReader * | pIn | ) | [static] |
Definition at line 667 of file fts1.c.
References atEnd(), readDocid(), and skipPositionList().
Referenced by docListAndMerge(), docListExceptMerge(), docListOrMerge(), docListPhraseMerge(), and fulltextNext().
static int parseQuery | ( | fulltext_vtab * | v, | |
const char * | zInput, | |||
int | nInput, | |||
int | dfltColumn, | |||
Query * | pQuery | |||
) | [static] |
Definition at line 2728 of file fts1.c.
References Query::dfltColumn, Query::nextColumn, Query::nextIsOr, Query::nTerms, Query::pFts, Query::pTerms, fulltext_vtab::pTokenizer, queryClear(), SQLITE_ERROR, SQLITE_OK, and tokenizeSegment().
Referenced by fulltextQuery().
static int parseSpec | ( | TableSpec * | pSpec, | |
int | argc, | |||
const char *const * | argv, | |||
char ** | pzErr | |||
) | [static] |
Definition at line 1814 of file fts1.c.
References TableSpec::azColumn, TableSpec::azContentColumn, TableSpec::azTokenizer, clearTableSpec(), firstToken(), TableSpec::nColumn, safe_isalnum(), sqlite3_mprintf(), SQLITE_NOMEM, SQLITE_OK, startsWith(), tokenizeString(), tokenListToIdList(), TableSpec::zDb, and TableSpec::zName.
Referenced by fulltextConnect(), and fulltextCreate().
static sqlite_int64 peekDocid | ( | DocListReader * | pReader | ) | [static] |
Definition at line 396 of file fts1.c.
References atEnd(), getVarint, DocListReader::iLastPos, and DocListReader::p.
Referenced by skipToDocid().
static int putVarint | ( | char * | p, | |
sqlite_int64 | v | |||
) | [static] |
Definition at line 114 of file fts1.c.
References VARINT_MAX.
static void queryAdd | ( | Query * | q, | |
const char * | pTerm, | |||
int | nTerm | |||
) | [static] |
Definition at line 2621 of file fts1.c.
References Query::dfltColumn, QueryTerm::iColumn, QueryTerm::isOr, Query::nextColumn, Query::nextIsOr, QueryTerm::nTerm, Query::nTerms, QueryTerm::pTerm, and Query::pTerms.
Referenced by tokenizeSegment().
static void queryClear | ( | Query * | q | ) | [static] |
Definition at line 2156 of file fts1.c.
References Query::nTerms, QueryTerm::pTerm, and Query::pTerms.
Referenced by fulltextClose(), fulltextFilter(), fulltextQuery(), and parseQuery().
static sqlite_int64 readDocid | ( | DocListReader * | pReader | ) | [static] |
Definition at line 406 of file fts1.c.
References atEnd(), DL_POSITIONS, getVarint, DocListReader::iLastColumn, DocListReader::iLastPos, DocList::iType, DocListReader::p, and DocListReader::pDoclist.
Referenced by docListAccumulate(), docListDiscardEmpty(), docListRestrictColumn(), firstDocid(), nextDocid(), and skipDocument().
static void readerInit | ( | DocListReader * | r, | |
DocList * | pDoclist | |||
) | [static] |
Definition at line 377 of file fts1.c.
References DocListReader::iLastColumn, DocListReader::iLastPos, DocListReader::p, DocList::pData, and DocListReader::pDoclist.
Referenced by docListAccumulate(), docListAndMerge(), docListDiscardEmpty(), docListExceptMerge(), docListOrMerge(), docListPhraseMerge(), docListRestrictColumn(), docListUpdate(), firstDocid(), and fulltextFilter().
static int readPosition | ( | DocListReader * | pReader, | |
int * | iColumn | |||
) | [static] |
Definition at line 420 of file fts1.c.
References atEnd(), DL_POSITIONS, DL_POSITIONS_OFFSETS, getVarint32, DocListReader::iLastColumn, DocListReader::iLastPos, DocList::iType, DocListReader::p, DocListReader::pDoclist, POS_BASE, POS_COLUMN, and POS_END.
Referenced by docListDiscardEmpty(), docListRestrictColumn(), mergePosList(), and skipPositionList().
static int safe_isalnum | ( | char | c | ) | [static] |
Definition at line 213 of file fts1.c.
Referenced by parseSpec(), startsWith(), and tokenListToIdList().
static int safe_isspace | ( | char | c | ) | [static] |
Definition at line 207 of file fts1.c.
Referenced by appendWhiteSpace(), getToken(), startsWith(), trimWhiteSpace(), and wordBoundary().
static int safe_tolower | ( | char | c | ) | [static] |
Definition at line 210 of file fts1.c.
Referenced by startsWith().
static void skipDocument | ( | DocListReader * | pReader | ) | [static] |
Definition at line 466 of file fts1.c.
References readDocid(), and skipPositionList().
Referenced by docListSpliceElement(), and skipToDocid().
static void skipPositionList | ( | DocListReader * | pReader | ) | [static] |
Definition at line 456 of file fts1.c.
References DL_POSITIONS, DocList::iType, DocListReader::pDoclist, and readPosition().
Referenced by docListAccumulate(), mergePosList(), nextDocid(), and skipDocument().
static int skipToDocid | ( | DocListReader * | pReader, | |
sqlite_int64 | iDocid | |||
) | [static] |
Definition at line 473 of file fts1.c.
References atEnd(), d(), peekDocid(), and skipDocument().
Referenced by docListSpliceElement().
static void snippetAllOffsets | ( | fulltext_cursor * | p | ) | [static] |
Definition at line 2284 of file fts1.c.
References fulltext_cursor::iCursorType, fulltext_vtab::nColumn, Snippet::nMatch, Query::nTerms, Query::pFts, fulltext_cursor::pStmt, fulltext_cursor::q, QUERY_FULLTEXT, fulltext_cursor::snippet, snippetOffsetsOfColumn(), sqlite3_column_bytes(), and sqlite3_column_text().
Referenced by snippetFunc(), and snippetOffsetsFunc().
static void snippetAppendMatch | ( | Snippet * | p, | |
int | iCol, | |||
int | iTerm, | |||
int | iStart, | |||
int | nByte | |||
) | [static] |
Definition at line 2177 of file fts1.c.
References Snippet::aMatch, Snippet::snippetMatch::iCol, Snippet::nAlloc, and Snippet::nMatch.
Referenced by snippetOffsetsOfColumn().
static void snippetClear | ( | Snippet * | p | ) | [static] |
Definition at line 2168 of file fts1.c.
References Snippet::aMatch, Snippet::zOffset, and Snippet::zSnippet.
Referenced by fulltextClose(), and fulltextNext().
static void snippetFunc | ( | sqlite3_context * | pContext, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 3211 of file fts1.c.
References Snippet::nSnippet, fulltext_cursor::snippet, snippetAllOffsets(), snippetText(), sqlite3_result_error(), sqlite3_result_text(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_text(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_STATIC, and Snippet::zSnippet.
Referenced by fulltextFindFunction().
static void snippetOffsetsFunc | ( | sqlite3_context * | pContext, | |
int | argc, | |||
sqlite3_value ** | argv | |||
) | [static] |
Definition at line 3245 of file fts1.c.
References Snippet::nOffset, fulltext_cursor::snippet, snippetAllOffsets(), snippetOffsetText(), sqlite3_result_error(), sqlite3_result_text(), sqlite3_value_blob(), sqlite3_value_bytes(), sqlite3_value_type(), SQLITE_BLOB, SQLITE_STATIC, and Snippet::zOffset.
Referenced by fulltextFindFunction().
static void snippetOffsetsOfColumn | ( | Query * | pQuery, | |
Snippet * | pSnippet, | |||
int | iColumn, | |||
const char * | zDoc, | |||
int | nDoc | |||
) | [static] |
Definition at line 2211 of file fts1.c.
References FTS1_ROTOR_MASK, FTS1_ROTOR_SZ, QueryTerm::iColumn, match(), fulltext_vtab::nColumn, Query::nTerms, Query::pFts, sqlite3_tokenizer::pModule, Query::pTerms, sqlite3_tokenizer_cursor::pTokenizer, fulltext_vtab::pTokenizer, snippetAppendMatch(), sqlite3_tokenizer_module::xClose, sqlite3_tokenizer_module::xNext, and sqlite3_tokenizer_module::xOpen.
Referenced by snippetAllOffsets().
static void snippetOffsetText | ( | Snippet * | p | ) | [static] |
Definition at line 2315 of file fts1.c.
References Snippet::aMatch, append(), initStringBuffer(), StringBuffer::len, Snippet::nMatch, Snippet::nOffset, StringBuffer::s, sqlite3_snprintf(), and Snippet::zOffset.
Referenced by snippetOffsetsFunc().
static void snippetText | ( | fulltext_cursor * | pCursor, | |
const char * | zStartMark, | |||
const char * | zEndMark, | |||
const char * | zEllipsis | |||
) | [static] |
Definition at line 2409 of file fts1.c.
References Snippet::aMatch, append(), appendWhiteSpace(), initStringBuffer(), StringBuffer::len, nappend(), Snippet::nMatch, Snippet::nSnippet, Query::nTerms, fulltext_cursor::pStmt, fulltext_cursor::q, StringBuffer::s, fulltext_cursor::snippet, SNIPPET_DESIRED, SNIPPET_IGNORE, sqlite3_column_bytes(), sqlite3_column_text(), trimWhiteSpace(), wordBoundary(), and Snippet::zSnippet.
Referenced by snippetFunc().
static int sql_exec | ( | sqlite3 * | db, | |
const char * | zDb, | |||
const char * | zName, | |||
const char * | zFormat | |||
) | [static] |
Definition at line 923 of file fts1.c.
References sqlite3_exec(), string_format(), and TRACE.
Referenced by fulltextCreate(), and fulltextDestroy().
static int sql_get_statement | ( | fulltext_vtab * | v, | |
fulltext_statement | iStmt, | |||
sqlite3_stmt ** | ppStmt | |||
) | [static] |
Definition at line 1173 of file fts1.c.
References CONTENT_INSERT_STMT, CONTENT_UPDATE_STMT, contentInsertStatement(), contentUpdateStatement(), fulltext_vtab::db, MAX_STMT, fulltext_vtab::pFulltextStatements, sql_prepare(), sqlite3_reset(), SQLITE_OK, fulltext_vtab::zDb, and fulltext_vtab::zName.
Referenced by content_delete(), content_insert(), content_select(), content_update(), term_delete(), term_insert(), term_select(), term_select_all(), and term_update().
static int sql_prepare | ( | sqlite3 * | db, | |
const char * | zDb, | |||
const char * | zName, | |||
sqlite3_stmt ** | ppStmt, | |||
const char * | zFormat | |||
) | [static] |
Definition at line 933 of file fts1.c.
References sqlite3_prepare(), string_format(), and TRACE.
Referenced by fulltextFilter(), and sql_get_statement().
static int sql_single_step_statement | ( | fulltext_vtab * | v, | |
fulltext_statement | iStmt, | |||
sqlite3_stmt ** | ppStmt | |||
) | [static] |
Definition at line 1237 of file fts1.c.
References sql_step_statement(), SQLITE_DONE, and SQLITE_OK.
Referenced by content_delete(), content_insert(), content_update(), term_delete(), term_insert(), and term_update().
static int sql_step_statement | ( | fulltext_vtab * | v, | |
fulltext_statement | iStmt, | |||
sqlite3_stmt ** | ppStmt | |||
) | [static] |
Definition at line 1206 of file fts1.c.
References MAX_STMT, fulltext_vtab::pFulltextStatements, sqlite3_finalize(), sqlite3_step(), SQLITE_BUSY, SQLITE_DONE, SQLITE_ERROR, and SQLITE_ROW.
Referenced by content_select(), sql_single_step_statement(), term_select(), and term_select_all().
int sqlite3_extension_init | ( | sqlite3 * | db, | |
char ** | pzErrMsg, | |||
const sqlite3_api_routines * | pApi | |||
) |
Definition at line 3338 of file fts1.c.
References sqlite3Fts1Init(), and SQLITE_EXTENSION_INIT2.
int sqlite3Fts1Init | ( | sqlite3 * | db | ) |
Definition at line 3331 of file fts1.c.
References sqlite3_create_module(), and sqlite3_overload_function().
Referenced by openDatabase(), and sqlite3_extension_init().
static int startsWith | ( | const char * | s, | |
const char * | t | |||
) | [static] |
Definition at line 1775 of file fts1.c.
References safe_isalnum(), safe_isspace(), and safe_tolower().
Referenced by constructVtab(), and parseSpec().
static char* string_dup | ( | const char * | s | ) | [static] |
static char* string_dup_n | ( | const char * | s, | |
int | n | |||
) | [static] |
Definition at line 872 of file fts1.c.
Referenced by string_dup().
static char* string_format | ( | const char * | zFormat, | |
const char * | zDb, | |||
const char * | zName | |||
) | [static] |
Definition at line 890 of file fts1.c.
Referenced by sql_exec(), and sql_prepare().
static int term_delete | ( | fulltext_vtab * | v, | |
sqlite_int64 | rowid | |||
) | [static] |
Definition at line 1490 of file fts1.c.
References sql_get_statement(), sql_single_step_statement(), sqlite3_bind_int64(), SQLITE_OK, and TERM_DELETE_STMT.
Referenced by index_insert_term().
static int term_insert | ( | fulltext_vtab * | v, | |
sqlite_int64 * | piRowid, | |||
const char * | pTerm, | |||
int | nTerm, | |||
int | iSegment, | |||
DocList * | doclist | |||
) | [static] |
Definition at line 1448 of file fts1.c.
References DocList::nData, DocList::pData, sql_get_statement(), sql_single_step_statement(), sqlite3_bind_blob(), sqlite3_bind_int(), sqlite3_bind_int64(), sqlite3_bind_null(), sqlite3_bind_text(), SQLITE_OK, SQLITE_STATIC, and TERM_INSERT_STMT.
Referenced by index_insert_term().
static int term_select | ( | fulltext_vtab * | v, | |
const char * | pTerm, | |||
int | nTerm, | |||
int | iSegment, | |||
sqlite_int64 * | rowid, | |||
DocList * | out | |||
) | [static] |
Definition at line 1353 of file fts1.c.
References DL_DEFAULT, docListInit(), sql_get_statement(), sql_step_statement(), sqlite3_bind_int(), sqlite3_bind_text(), sqlite3_column_blob(), sqlite3_column_bytes(), sqlite3_column_int64(), sqlite3_step(), SQLITE_DONE, SQLITE_OK, SQLITE_ROW, SQLITE_STATIC, and TERM_SELECT_STMT.
Referenced by index_insert_term().
static int term_select_all | ( | fulltext_vtab * | v, | |
int | iColumn, | |||
const char * | pTerm, | |||
int | nTerm, | |||
DocList * | out | |||
) | [static] |
Definition at line 1390 of file fts1.c.
References DL_DEFAULT, docListAccumulate(), docListDestroy(), docListDiscardEmpty(), docListInit(), docListRestrictColumn(), fulltext_vtab::nColumn, sql_get_statement(), sql_step_statement(), sqlite3_bind_text(), sqlite3_column_blob(), sqlite3_column_bytes(), SQLITE_DONE, SQLITE_OK, SQLITE_ROW, SQLITE_STATIC, and TERM_SELECT_ALL_STMT.
Referenced by docListOfTerm().
static int term_update | ( | fulltext_vtab * | v, | |
sqlite_int64 | rowid, | |||
DocList * | doclist | |||
) | [static] |
Definition at line 1475 of file fts1.c.
References DocList::nData, DocList::pData, sql_get_statement(), sql_single_step_statement(), sqlite3_bind_blob(), sqlite3_bind_int64(), SQLITE_OK, SQLITE_STATIC, and TERM_UPDATE_STMT.
Referenced by index_insert_term().
static int tokenizeSegment | ( | sqlite3_tokenizer * | pTokenizer, | |
const char * | pSegment, | |||
int | nSegment, | |||
int | inPhrase, | |||
Query * | pQuery | |||
) | [static] |
Definition at line 2671 of file fts1.c.
References checkColumnSpecifier(), QueryTerm::iPhrase, QueryTerm::isNot, Query::nextColumn, Query::nextIsOr, QueryTerm::nPhrase, Query::nTerms, Query::pFts, sqlite3_tokenizer::pModule, Query::pTerms, sqlite3_tokenizer_cursor::pTokenizer, queryAdd(), SQLITE_OK, sqlite3_tokenizer_module::xClose, sqlite3_tokenizer_module::xNext, and sqlite3_tokenizer_module::xOpen.
Referenced by parseQuery().
static char** tokenizeString | ( | const char * | z, | |
int * | pnToken | |||
) | [static] |
Definition at line 1634 of file fts1.c.
References getToken(), Token::n, TOKEN_SPACE, and Token::z.
Referenced by parseSpec().
static void tokenListToIdList | ( | char ** | azIn | ) | [static] |
Definition at line 1723 of file fts1.c.
References dequoteString(), and safe_isalnum().
Referenced by parseSpec().
static void trimWhiteSpace | ( | StringBuffer * | p | ) | [static] |
Definition at line 2392 of file fts1.c.
References StringBuffer::len, StringBuffer::s, and safe_isspace().
Referenced by snippetText().
static int wordBoundary | ( | int | iBreak, | |
const char * | zDoc, | |||
int | nDoc, | |||
struct snippetMatch * | aMatch, | |||
int | nMatch, | |||
int | iCol | |||
) | [static] |
const char* const fulltext_zStatement[MAX_STMT] [static] |
{ NULL, "select * from %_content where rowid = ?", NULL, "delete from %_content where rowid = ?", "select rowid, doclist from %_term where term = ? and segment = ?", "select doclist from %_term where term = ? order by segment", "insert into %_term (rowid, term, segment, doclist) values (?, ?, ?, ?)", "update %_term set doclist = ? where rowid = ?", "delete from %_term where rowid = ?", }
static const sqlite3_module fulltextModule [static] |
const char isIdChar[] [static] |
{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, }
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:58 2011 by Doxygen 1.6.1