doris测试建表语句:
CREATE TABLE test
(
userid
varchar(32) NOT NULL COMMENT "个人账号id",
time
datetime NOT NULL COMMENT "发送时间",
information_source
STRING NOT NULL COMMENT "信源类型",
INDEX useridindex(userid
) USING INVERTED,
INDEX information_sourceindex(information_source
) USING INVERTED
PROPERTIES("parser" = "unicode","lower_case"="true")
) ENGINE=OLAP
UNIQUE KEY(userid
,time
)
COMMENT "OLAP"
PARTITION BY RANGE(time
)
()
DISTRIBUTED BY HASH(userid
) BUCKETS 6
PROPERTIES (
"replication_num"="1",
"dynamic_partition.replication_num" = "1",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "MONTH",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-2147483648",
"dynamic_partition.end" = "2",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "6"
);
doris测试数据
insert into test values('1','2024-12-16 12:30:29',"祖国真伟大啊China")
insert into test values('2','2024-12-16 12:32:29',"中真伟国大啊China")
insert into test values('3','2024-12-16 12:31:29',"AbcdEf")
doris查询测试1
select * from test WHERE information_source MATCH_ALL '祖国'
查询结果
祖国真伟大啊China
中真伟国大啊China
这两条数据都出现了
doris查询测试2
select * from test WHERE information_source MATCH_ANY '祖国'
查询结果
祖国真伟大啊China
中真伟国大啊China
这两条数据都出现了
doris查询测试3
select * from test WHERE information_source MATCH_PHRASE '祖国'
查询结果
祖国真伟大啊China
这次查询正确了接着测试英文
select * from test WHERE information_source MATCH_PHRASE 'c'
显示无结果了
有没有那种方法可以做到,查询祖国 只输出祖国两个词在一起的结果,查询其他语言也是同理切不区分大小写呢,而且可以混合查询输入祖国真伟大啊C也只出现一条结果