ClickHouse/src/Functions/hasTokenCaseInsensitive.cpp
2023-06-28 10:41:39 +02:00

37 lines
1.2 KiB
C++

#include <Functions/FunctionFactory.h>
#include <Functions/FunctionsStringSearch.h>
#include <Functions/HasTokenImpl.h>
#include <Common/Volnitsky.h>
namespace DB
{
struct NameHasTokenCaseInsensitive
{
static constexpr auto name = "hasTokenCaseInsensitive";
};
struct NameHasTokenCaseInsensitiveOrNull
{
static constexpr auto name = "hasTokenCaseInsensitiveOrNull";
};
using FunctionHasTokenCaseInsensitive
= FunctionsStringSearch<HasTokenImpl<NameHasTokenCaseInsensitive, VolnitskyCaseInsensitive, false>>;
using FunctionHasTokenCaseInsensitiveOrNull
= FunctionsStringSearch<HasTokenImpl<NameHasTokenCaseInsensitiveOrNull, VolnitskyCaseInsensitive, false>, ExecutionErrorPolicy::Null>;
REGISTER_FUNCTION(HasTokenCaseInsensitive)
{
factory.registerFunction<FunctionHasTokenCaseInsensitive>(
FunctionDocumentation{.description="Performs case insensitive lookup of needle in haystack using tokenbf_v1 index."},
DB::FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionHasTokenCaseInsensitiveOrNull>(
FunctionDocumentation{.description="Performs case insensitive lookup of needle in haystack using tokenbf_v1 index. Returns null if needle is ill-formed."},
DB::FunctionFactory::CaseInsensitive);
}
}