我们使用复合索引按2个字段排序,一个是文本,另一个是日期。 我已经创建了复合索引,并试图在.net应用程序中使用它。我们还使用延续令牌为同一查询实现了分页
第一页的记录即将到来,但是第二页的记录却出现了
值不能为null。参数名称:currentDocumentProducer
如果仅按一个字段排序,则分页正常。我们已经检查了Continuation令牌,除了字段顺序之外,两者似乎都相同。
var feedOptions = new FeedOptions
{
MaxItemCount = pageSize,
EnableCrossPartitionQuery = true,
RequestContinuation = continuationToken
};
IQueryable<T> filter = client.CreateDocumentQuery<T>(collectionLink, Query, feedOptions);
IDocumentQuery<T> query = filter.AsDocumentQuery();
FeedResponse<T> feedRespose = query.ExecuteNextAsync<T>().GetAwaiter().GetResult();
堆栈跟踪如下
System.ArgumentNullException:在 Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext.get_ActivityId (Microsoft.Azure.DocumentDB.Core,Version = 2.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35) Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext.ValidateAndExtractContinuationTokens (Microsoft.Azure.DocumentDB.Core,Version = 2.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35) Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext + d__23.MoveNext (Microsoft.Azure.DocumentDB.Core,Version = 2.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35) System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.GetResult (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 Microsoft.Azure.Documents.Query.OrderByDocumentQueryExecutionContext + d__19.MoveNext (Microsoft.Azure.DocumentDB.Core,Version = 2.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35) System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter
1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at Microsoft.Azure.Documents.Query.PipelinedDocumentQueryExecutionContext+<>c__DisplayClass5_0+<<CreateAsync>b__0>d.MoveNext (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 Microsoft.Azure.Documents.Query.PipelinedDocumentQueryExecutionContext + d__5.MoveNext (Microsoft.Azure.DocumentDB.Core,Version = 2.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35) System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at Microsoft.Azure.Documents.Query.DocumentQueryExecutionContextFactory+<CreateSpecializedDocumentQueryExecutionContext>d__3.MoveNext (Microsoft.Azure.DocumentDB.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at System.Runtime.CompilerServices.TaskAwaiter
1.GetResult (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 Microsoft.Azure.Documents.Query.ProxyDocumentQueryExecutionContext + d__15.MoveNext (Microsoft.Azure.DocumentDB.Core,Version = 2.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35) System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter1.GetResult (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e) at Microsoft.Azure.Documents.Linq.DocumentQuery
1 + d__36`1.MoveNext (Microsoft.Azure.DocumentDB.Core,Version = 2.0.0.0,Culture = neutral, PublicKeyToken = 31bf3856ad364e35) System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e),网址为 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib,版本= 4.0.0.0,文化=中性, PublicKeyToken = 7cec85d7bea7798e)