【问题标题】:using timeof() and token() in datastax solr search在 datastax solr 搜索中使用 timeof() 和 token()
【发布时间】:2015-02-26 22:46:39
【问题描述】:

我正在使用 datastax 企业 4.5。如何在 solr 中使用诸如 timeof() 和 token() 之类的 cassandra 函数?我想显示在 timeuuid 条目上使用 timeof() 函数时产生的时间戳。我不知道从哪里开始。

【问题讨论】:

    标签: solr datastax


    【解决方案1】:

    对于 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 做类似的事情。

    【讨论】:

    • 谢谢。我从来没有想过……我会尝试混合使用 solr_query 和 cql 命令。
    猜你喜欢
    • 2015-03-15
    • 2017-02-26
    • 1970-01-01
    • 1970-01-01
    • 2013-01-22
    • 1970-01-01
    • 2011-03-24
    • 2011-08-28
    相关资源
    最近更新 更多