/** * @param nc_search_query_expression_fuzzy $expression * @return string */ protected function translate_fuzzy(nc_search_query_expression_fuzzy $expression) { $term1 = mb_convert_case($expression->get_value(), nc_search::get_setting("FilterStringCase"), 'UTF-8'); $similar_terms = $this->get_similar_terms($term1, $expression->get_similarity()); $fts_query = ($expression->is_excluded() ? "-" : "") . "(" . join(" ", $similar_terms) . ")"; if ($fts_query == "(____)" || $fts_query == "-(____)") { return ''; } $this->add_field_matches($expression, $fts_query); $this->query_builder->add_term_ranking($expression->get_field(), $similar_terms, 1); return $fts_query; }
/** * @param nc_search_query_expression_fuzzy $expression * @return void */ protected function translate_fuzzy(nc_search_query_expression_fuzzy $expression) { $this->print_line('FUZZY "' . $expression->get_value() . '"' . $this->get_modifiers($expression)); }