You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/04/11 13:14:21 UTC

[GitHub] [incubator-doris] morningman commented on issue #3305: Add field context for string field keyword type

morningman commented on issue #3305: Add field context for string field keyword type
URL: https://github.com/apache/incubator-doris/pull/3305#issuecomment-612418725
 
 
   > #3304
   > 
   > 这个方案其实是一个过度的解决方案,最佳的解决方案应该是将对EsScanNode的谓词转换在FE中完成,BE只负责扫描,这样将对查询的处理和执行完全分开。
   > 
   > 建表时增加一个 `enable_keyword_sniff ` 配置,默认是 "true", 会对分词字段进行探测获取`keyword`类型字段的`json path`.
   > 
   > ```
   > 
   > CREATE EXTERNAL TABLE `test` (
   >   `k1` varchar(20) COMMENT "",
   >   `create_time` datetime COMMENT ""
   > ) ENGINE=ELASTICSEARCH
   > PROPERTIES (
   > "hosts" = "http://10.74.167.16:8200",
   > "user" = "root",
   > "password" = "root",
   > "index" = "test",
   > "type" = "doc",
   > "enable_keyword_sniff" = "true"
   > );
   > ```
   > 
   > 其中 `enable_keyword_sniff` 默认就是true
   > 
   > 效果:
   > 
   > ```
   > select * from test where k1 = "wu yun feng"
   > ```
   > 
   > 输出:
   > 
   > ```
   > {"term":{"k1.keyword":"wu yun feng"}}
   > ```
   > 
   > 在这个PR中,我暂时把对ES的version检测移除了
   > 
   > 未来几个月将会将谓词的转换全部上移到FE中,处理这种就变得非常简单了。
   
   Better in English

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org