【发布时间】:2015-02-26 22:46:39
【问题描述】:
我正在使用 datastax 企业 4.5。如何在 solr 中使用诸如 timeof() 和 token() 之类的 cassandra 函数?我想显示在 timeuuid 条目上使用 timeof() 函数时产生的时间戳。我不知道从哪里开始。
【问题讨论】:
我正在使用 datastax 企业 4.5。如何在 solr 中使用诸如 timeof() 和 token() 之类的 cassandra 函数?我想显示在 timeuuid 条目上使用 timeof() 函数时产生的时间戳。我不知道从哪里开始。
【问题讨论】:
对于 token() 使用 restricted query routing,4.6 中的新功能。如下所示指定密钥(您也可以自己指定令牌范围,但我不确定您为什么要这样做):
http://localhost:8983/solr/test.route/select?q=*:*&indent=true&shards.info=true&route.partition=nike|2,reebok|2
或者,在 CQL 中:
SELECT * FROM test.route WHERE solr_query='{"q" : "*:*", "route.partition" : "nike|2,reebok|2"}'
请注意,第二种情况使用 CQL 中的 solr_query。我不确定您的确切用例是什么,但您可能可以从 CQL 为 time functions of cql timeuuid's 做类似的事情。
【讨论】: