随笔分类 -  Golang / es

摘要:Es中处理父子关系的两种方式 1.nested类型 将goods类型设置为nested 这时候就可以查到数据了。 2.join类型 在mapping中指定字段类型为join 定义父子关系属性 PUT order{ "settings": { "number_of_shards": 1, "numbe 阅读全文
posted @ 2023-03-30 18:56 lisus2000 阅读(151) 评论(0) 推荐(0)
摘要:grpc服务端和客户端都提供了interceptor功能,功能类似middleware,很适合在这里处理验证、日志等流程,话不多说直接上代码 1.编写helloworld.proto 并用命令生成相应的go文件,生成的文件内容如下: // Code generated by protoc-gen-g 阅读全文
posted @ 2023-02-12 20:55 lisus2000 阅读(240) 评论(0) 推荐(0)