InnoDB Plugin  1.0
Data Structures | Typedefs | Functions | Variables
fts0types.h File Reference
#include "que0types.h"
#include "ut0byte.h"
#include "fut0fut.h"
#include "ut0rbt.h"
#include "fts0fts.h"
#include "fts0types.ic"
#include "fts0vlc.ic"
Include dependency graph for fts0types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fts_doc_stats_t
struct  fts_get_doc_t
struct  fts_index_cache_t
struct  fts_update_t
struct  fts_stopword_t
struct  fts_sync_t
struct  fts_cache_t
struct  fts_node_t
struct  fts_tokenizer_word_t
struct  fts_word_t
struct  fts_fetch_t
struct  fts_index_selector_t
struct  fts_doc_t
struct  fts_token_t

Typedefs

typedef pars_user_func_cb_t fts_sql_callback
typedef void(* fts_filter )(void *, fts_node_t *, void *, ulint len)

Functions

UNIV_INLINE int fts_utf8_string_cmp (const void *p1, const void *p2)
UNIV_INLINE int fts_utf8_string_cmp_prefix (const void *p1, const void *p2)
UNIV_INLINE int fts_trx_row_doc_id_cmp (const void *p1, const void *p2)
UNIV_INLINE int fts_ranking_doc_id_cmp (const void *p1, const void *p2)
UNIV_INLINE int fts_update_doc_id_cmp (const void *p1, const void *p2)
UNIV_INLINE ulint fts_decode_vlc (byte **ptr)
UNIV_INLINE void fts_utf8_string_dup (fts_string_t *dst, const fts_string_t *src, mem_heap_t *heap)
UNIV_INLINE ulint fts_get_encoded_len (ulint val)
UNIV_INLINE ulint fts_encode_int (ulint val, byte *buf)
UNIV_INLINE ulint fts_utf8_decode (const byte **ptr)
UNIV_INLINE void fts_utf8_tolower (fts_string_t *str)
UNIV_INLINE const char * fts_get_suffix (ulint selected)
UNIV_INLINE ulint fts_get_n_selectors (void)
UNIV_INLINE ulint fts_select_index (const CHARSET_INFO *cs, const byte *str, ulint len)
UNIV_INLINE ulint fts_select_next_index (const CHARSET_INFO *cs, const byte *str, ulint len)

Variables

const fts_index_selector_t fts_index_selector []

Detailed Description

Full text search types file

Created 2007-03-27 Sunny Bains

Typedef Documentation

Callbacks used within FTS.

Function Documentation

UNIV_INLINE ulint fts_decode_vlc ( byte **  ptr)

Decode and return the integer that was encoded using our VLC scheme. in: ptr to decode from, this ptr is incremented by the number of bytes decoded

Decode and return the integer that was encoded using our VLC scheme.

Returns
value decoded
Parameters
ptrout: value decoded
UNIV_INLINE ulint fts_encode_int ( ulint  val,
byte *  buf 
)

Encode an integer using our VLC scheme and return the length in bytes. in: buffer, must have enough space

Encode an integer using our VLC scheme and return the length in bytes.

Returns
length of value encoded, in bytes
Parameters
valout: length of value encoded, in bytes in: value to encode
UNIV_INLINE ulint fts_get_encoded_len ( ulint  val)

Return length of val if it were encoded using our VLC scheme. in: value to encode

Return length of val if it were encoded using our VLC scheme. FIXME: We will need to be able encode 8 bytes value

Returns
length of value encoded, in bytes
Parameters
valout: length of value encoded, in bytes
UNIV_INLINE ulint fts_get_n_selectors ( void  )

Get the number of index selectors.

Returns
The number of selectors
UNIV_INLINE const char* fts_get_suffix ( ulint  selected)

Get the selected FTS aux INDEX suffix. in: selected index

Return the selected FTS aux index suffix.

Parameters
selectedin: selected index
UNIV_INLINE int fts_ranking_doc_id_cmp ( const void *  p1,
const void *  p2 
)

Compare two fts_ranking_t instances doc_ids. in: id2

Compare two fts_ranking_t doc_ids.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: id1
p2in: id2
UNIV_INLINE ulint fts_select_index ( const CHARSET_INFO *  cs,
const byte *  str,
ulint  len 
)

Select the FTS auxiliary index for the given string.

Returns
the index to use for the string in: string length

Select the FTS auxiliary index for the given character.

Returns
the index to use for the string
Parameters
csin: Charset
strin: string
lenin: string length
UNIV_INLINE ulint fts_select_next_index ( const CHARSET_INFO *  cs,
const byte *  str,
ulint  len 
)

in: string length

Select the next FTS auxiliary index for the given character.

Returns
the next index to use for character
Parameters
csin: Charset
strin: string
lenin: string length
UNIV_INLINE int fts_trx_row_doc_id_cmp ( const void *  p1,
const void *  p2 
)

Compare two fts_trx_row_t instances doc_ids. in: id2

Compare two fts_trx_row_t doc_ids.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: id1
p2in: id2
UNIV_INLINE int fts_update_doc_id_cmp ( const void *  p1,
const void *  p2 
)

Compare two fts_update_t instances doc_ids. in: id2

Compare two fts_update_t doc_ids.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: id1
p2in: id2
UNIV_INLINE ulint fts_utf8_decode ( const byte **  ptr)

Decode a UTF-8 character.

http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf:

Scalar Value 1st Byte 2nd Byte 3rd Byte 4th Byte 00000000 0xxxxxxx 0xxxxxxx 00000yyy yyxxxxxx 110yyyyy 10xxxxxx zzzzyyyy yyxxxxxx 1110zzzz 10yyyyyy 10xxxxxx 000uuuzz zzzzyyyy yyxxxxxx 11110uuu 10zzzzzz 10yyyyyy 10xxxxxx

This function decodes UTF-8 sequences up to 6 bytes (31 bits).

On error *ptr will point to the first byte that was not correctly decoded. This will hopefully help in resyncing the input. in/out: pointer to UTF-8 string. The pointer is advanced to the start of the next character.

Decode a UTF-8 character.

http://www.unicode.org/versions/Unicode4.0.0/ch03.pdf:

Scalar Value 1st Byte 2nd Byte 3rd Byte 4th Byte 00000000 0xxxxxxx 0xxxxxxx 00000yyy yyxxxxxx 110yyyyy 10xxxxxx zzzzyyyy yyxxxxxx 1110zzzz 10yyyyyy 10xxxxxx 000uuuzz zzzzyyyy yyxxxxxx 11110uuu 10zzzzzz 10yyyyyy 10xxxxxx

This function decodes UTF-8 sequences up to 6 bytes (31 bits).

On error *ptr will point to the first byte that was not correctly decoded. This will hopefully help in resyncing the input.

Returns
UTF8_ERROR if *ptr did not point to a valid UTF-8 sequence, or the Unicode code point.
Parameters
ptrin/out: pointer to UTF-8 string. The pointer is advanced to the start of the next character.
UNIV_INLINE int fts_utf8_string_cmp ( const void *  p1,
const void *  p2 
)

Compare two UTF-8 strings. in: node

Compare two UTF-8 strings.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: key
p2in: node
UNIV_INLINE int fts_utf8_string_cmp_prefix ( const void *  p1,
const void *  p2 
)

Compare two UTF-8 strings, and return match (0) if passed in "key" value equals or is the prefix of the "node" value. in: node

Compare two UTF-8 strings, and return match (0) if passed in "key" value equals or is the prefix of the "node" value.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
p1in: key
p2in: node
UNIV_INLINE void fts_utf8_string_dup ( fts_string_t dst,
const fts_string_t src,
mem_heap_t heap 
)

Duplicate an UTF-8 string. in: heap to use

Duplicate an UTF-8 string.

Returns
< 0 if n1 < n2, 0 if n1 == n2, > 0 if n1 > n2
Parameters
dstin: dup to here
srcin: src string
heapin: heap to use
UNIV_INLINE void fts_utf8_tolower ( fts_string_t str)

Lowercase an UTF-8 string. in: string

Lowercase an UTF-8 string.

Parameters
strin: string

Variable Documentation

const fts_index_selector_t fts_index_selector[]

It's defined in fts/fts0fts.c