Azure搜索FindFailedActionsToRetry返回空操作? [英] Azure search FindFailedActionsToRetry returning empty actions?
问题描述
我正在c#客户端上测试FindFailedActionsToRetry
函数进行天蓝色搜索,但没有得到预期的结果.
I was testing the FindFailedActionsToRetry
function on c# client for azure search and I am not getting expected results.
在我的函数中,我尝试为批次编制索引,并且我有一个处理IndexBatchException的try-catch. 我要做的事情是:
In my function I try to index the batch and i have a try-catch that handles IndexBatchException. Inside the catch I do:
var retryBatch = e.FindFailedActionsToRetry(batch, id => id["Identifier"].ToString());
我第一次获得索引:
999 out of the 1000 documents failed to index
(这是预期的).
The first time I index I get:
999 out of the 1000 documents failed to index
(which is expected).
然后,我尝试再次为批处理编制索引,但没有抛出相同的indexbatchexception
(因为我有意将merge
设置为原始1k文档的操作),所以我得到了另一个异常:
Then I try to index the batch again but instead of getting the same indexbatchexception
thrown out (because I purposedly set merge
as the action of the original 1k documents), I get another exception:
The request is invalid. Details: actions : No indexing actions found in the request. Please include between 1 and 1000 indexing actions in your request.
有什么想法为什么FindFailedActionsToRetry
函数没有返回正确的结果?还是我做错了什么?
Any ideas why the FindFailedActionsToRetry
function is not returning correct results? or maybe im doing something wrong?
编辑
为显示更多上下文,当我展开创建的包含IndexBatch
对象的retrybatch
对象时,可以看到Actions
.然后,我进一步展开,单击结果视图,然后得到:Enumeration yielded no results
To show more context, when I expand the retrybatch
object I created which contains an IndexBatch
object, I can see Actions
. I then Expand further, click on results view, and I get: Enumeration yielded no results
我第一次发送的原始批次 有结果.实际上,我可以看到:Action,document.动作,文档等
The original batch That I sent the first time did have resutls. In fact, I could see: Action,document. Action,document, etc.
为什么我没有任何结果?
Why am I not seing any results?
推荐答案
您正在以一种非临时的,因此无法重试的方式来引发索引失败. FindFailedActionsToRetry
足够聪明以检测到这一点.看看ShouldRetry
方法
You are provoking an indexing failure in a way that is not transient and therefore not retriable. FindFailedActionsToRetry
is smart enough to detect this. Take a look at the ShouldRetry
method in the code.
这篇关于Azure搜索FindFailedActionsToRetry返回空操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!