【问题标题】:Query state level db in Hyperledger Fabric using mutiple index sorting使用多索引排序查询 Hyperledger Fabric 中的状态级别数据库
【发布时间】:2020-08-25 12:47:06
【问题描述】:

我必须使用对多个索引进行排序来查询 Hyperledger Fabric 中的 couchdb。我已经正确定义了所有索引,并尝试分别使用每个索引并且工作正常。但是,一旦我在一个查询中同时包含两个索引,它就会抛出错误:

Error:no_usable_index,  Status Code:400,  Reason:No index exists for this sort, try indexing by the sort fields. 

这是我的查询不起作用:

{"selector":{"info":{"organization_id":"ABC123"},"status":{"$in":["STATUS1","STATUS2","STATUS3"]},"docType":"doc_awa"},"use_index":["_design/biltiDoc","indexbiltino"],"sort":[{"creation_date":"desc"},{"doc_no":"desc"}]}

请告诉我是否可以在查询中使用多个排序索引?

【问题讨论】:

    标签: couchdb hyperledger-fabric hyperledger


    【解决方案1】:

    我终于解决了,错误在索引定义中。在使用 sort 进行查询时,我必须按照所需的顺序定义索引。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多