2023-04-28 10:10:42 +00:00
|
|
|
#include <Functions/FunctionFactory.h>
|
|
|
|
#include <Functions/FunctionsStringSearch.h>
|
|
|
|
#include <Functions/HasTokenImpl.h>
|
2020-03-29 17:04:16 +00:00
|
|
|
|
2023-01-17 13:27:41 +00:00
|
|
|
#include <Common/Volnitsky.h>
|
2020-03-29 17:04:16 +00:00
|
|
|
|
2023-04-28 10:10:42 +00:00
|
|
|
namespace DB
|
2020-09-07 18:00:37 +00:00
|
|
|
{
|
2023-06-28 08:41:39 +00:00
|
|
|
|
2020-03-29 17:04:16 +00:00
|
|
|
struct NameHasToken
|
|
|
|
{
|
|
|
|
static constexpr auto name = "hasToken";
|
|
|
|
};
|
|
|
|
|
2023-01-23 22:27:48 +00:00
|
|
|
struct NameHasTokenOrNull
|
|
|
|
{
|
|
|
|
static constexpr auto name = "hasTokenOrNull";
|
|
|
|
};
|
|
|
|
|
2023-06-26 15:00:46 +00:00
|
|
|
using FunctionHasToken
|
2023-06-28 08:41:39 +00:00
|
|
|
= FunctionsStringSearch<HasTokenImpl<NameHasToken, Volnitsky, false>>;
|
2023-06-26 15:00:46 +00:00
|
|
|
using FunctionHasTokenOrNull
|
2023-06-28 08:41:39 +00:00
|
|
|
= FunctionsStringSearch<HasTokenImpl<NameHasTokenOrNull, Volnitsky, false>, ExecutionErrorPolicy::Null>;
|
2020-09-07 18:00:37 +00:00
|
|
|
|
2022-07-04 07:01:39 +00:00
|
|
|
REGISTER_FUNCTION(HasToken)
|
2020-03-29 17:04:16 +00:00
|
|
|
{
|
2023-04-28 10:10:42 +00:00
|
|
|
factory.registerFunction<FunctionHasToken>(FunctionDocumentation
|
2023-06-26 15:00:46 +00:00
|
|
|
{.description="Performs lookup of needle in haystack using tokenbf_v1 index."}, FunctionFactory::CaseSensitive);
|
2023-01-17 15:12:06 +00:00
|
|
|
|
2023-04-28 10:10:42 +00:00
|
|
|
factory.registerFunction<FunctionHasTokenOrNull>(FunctionDocumentation
|
2023-06-26 15:00:46 +00:00
|
|
|
{.description="Performs lookup of needle in haystack using tokenbf_v1 index. Returns null if needle is ill-formed."}, FunctionFactory::CaseSensitive);
|
2020-03-29 17:04:16 +00:00
|
|
|
}
|
2023-04-28 10:10:42 +00:00
|
|
|
|
|
|
|
}
|