Clusterpoint Cloud中聚合功能的索引不正确

时间:2015-09-13 18:45:02

标签: database clusterpoint nosql

聚合函数的正确索引应该是什么,如果我使用的标记值是' ID' ' s_version标记中的标记和字符串值'? ' ID'有index-numbers = yes ' s_version标记'有index = xml

我的聚合查询如下:

$aggregateQuery = 'COUNT(ID) as user_count, s_version as a GROUP BY s_version ORDER BY s_version';

$ response返回错误:

Cannot aggregate unindexed fields
Cannot aggregate fields that have not been indexed. Check your policy and make sure all fields you are aggregating are indexed with appropriate types

1 个答案:

答案 0 :(得分:0)

您在聚合中使用的标记应该使用index-numbers = yes,index-dates = yes或index = facet(index = xml仅影响路径如何定义某个标记)进行适当的索引。数字标签使用“index-numbers”,日期值使用“index-dates”,字符串使用“index-facet”。

似乎您的“ID”标记已正确编入索引。但对于“s_version”,你应该添加“index = facet”:

<rule>
<xpath>//root_tag/.../s_version</xpath>
<property>index=xml&amp;facet</property>
</rule>