You are here

function fuzzysearch_get_word_id in Fuzzy Search 7

Create a word id in the specified table.

Parameters

string $table: The table where a string is currently being indexed.

1 call to fuzzysearch_get_word_id()
FuzzySearchService::indexItem in includes/service.inc
Helper method to index a given item.

File

./fuzzysearch.module, line 175
Fuzzysearch module.

Code

function fuzzysearch_get_word_id($table) {
  $word_id = db_insert($table)
    ->fields(array(
    'item_id' => 0,
    'word_id' => 0,
    'ngram' => 'xxx',
    'completeness' => 100,
    'score' => 1,
  ))
    ->execute();
  db_delete($table)
    ->condition('word_id', 0)
    ->execute();
  return $word_id;
}