How do I see SOLR dynamic fields in CQL with Cassandra?

不羁的心 提交于 2019-12-20 03:08:25

问题


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?


回答1:


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

  1. You need to declare the type as a map (eg: dyn_ map) and create the CQL schema.
  2. Post your schema with the dynamic type declared.
  3. The dynamic part isn't inferred inside the map by the name of the container (the map). So you need to include the dynamic part in the data. This also means that the key part has to be a text type.

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.



来源:https://stackoverflow.com/questions/20954157/how-do-i-see-solr-dynamic-fields-in-cql-with-cassandra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!