mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 10:22:10 +00:00
37 lines
1.2 KiB
C++
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);
|
|
}
|
|
|
|
}
|