Exact Meaning of “Slop” in Lucene SpanNearQuery (or slop in ElasticSearch span_near)

南笙酒味 提交于 2019-12-03 03:36:11

Question 1: Slop is the number of words separating the span clauses. So slop 0 would mean they are adjacent. In the example I gave, slop of 1 would match.

Question 2: When there are more than two span near clauses, each clause must be connected to at least one other clause by no more than slop words separating them AND all of the clauses must be connected to each other through a chain. However, each clause need not be separated by slop words to every other clause.

For the first example in question 2: slop of 0, 1, and 2 would all match. Slop of zero matches even though foo and biz are separated by more than one because there is a chain through all clauses.

For the second example in question 2: slop of 0 would not match because biz is separated from all other clauses by more than 0 slop. Slop of 1 would match because foo and bar are separated by 0 slop, in addition bar and biz are separated by 1 slop. It matches even though foo and biz are separated by more than one because there is a chain through all clauses. Slop of 2 would obviously match.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!