如何使用 Cassandra 在 CQL 中查看 SOLR 动态字段? [英] How do I see SOLR dynamic fields in CQL with Cassandra?

查看:30
本文介绍了如何使用 Cassandra 在 CQL 中查看 SOLR 动态字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Solr 动态字段在 Solr 中显示为可搜索并在 Thrift 界面中可用,但在使用 CQL 时,这些字段不会出现.是否有特定的搜索样式或查询样式可用于公开动态字段及其值?

Solr dynamic fields appear as searchable in Solr and available in the Thrift interface, but when using CQL, the fields don't appear. Is there a specific search style or querying style that can be used to expose what the dynamic fields are and their values?

推荐答案

通过 CQL3 动态字段应该也能正常工作,但有一些注意事项.

Through CQL3 Dynamic fields should work as well with a few caveats.

  1. 您需要将类型声明为映射(例如:dyn_map)并创建 CQL 架构.
  2. 使用声明的动态类型发布您的架构.
  3. 动态部分不是通过容器(地图)的名称在地图内推断出来的.所以你需要在数据中包含动态部分.这也意味着关键部分必须是文本类型.

因此,在上面的示例中,您将获得如下所示的地图:

So in the above example you'll have a map that looks like this:

'dyn_' : {dyn_1 : 1, dyn_2 : 2, dyn_3 : 3}

将来我们会讨论取消对文本类型的限制并允许其他类型,但现在这就是索引的工作方式.

In the future we're talking about removing the limitation on the text type and allowing other types, but right now this is how it works for indexing.

我们也使用特殊字段来存储动态字段名称,这个查询:

We also use the special field to store dynamic field names, this query:

'_dynFld:dyn_1'

应该从上面的例子中返回一个结果.

Should return one result from the above example.

这篇关于如何使用 Cassandra 在 CQL 中查看 SOLR 动态字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆