Description
Subtract firstPosition from secondPosition for observedGap, then compare its absolute difference from expectedGap inclusively with allowedSlop.
Search metrics and positional checks depend on rank origins, token positions, relevance definitions, and tie or gap conventions. One term is not a complete query or retrieval evaluation.
Subtract firstPosition from secondPosition for observedGap, then compare its absolute difference from expectedGap inclusively with allowedSlop.
When to use this tool
Use Query Phrase Slop One Gap when you need one rank contribution or token-position diagnostic.
How to use the tool and how it works
- Enter firstPosition, secondPosition, expectedGap, allowedSlop. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read observedGap, displacement, matches. Inspect matches before interpreting the associated values.
Subtract firstPosition from secondPosition for observedGap, then compare its absolute difference from expectedGap inclusively with allowedSlop.1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| firstPosition | First Position | Required. Safe integer; minimum 0. |
| secondPosition | Second Position | Required. Safe integer; minimum 0. |
| expectedGap | Expected Gap | Required. Safe integer; minimum 0. |
| allowedSlop | Allowed Slop | Required. Safe integer; minimum 0. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| observedGap | Observed Gap | Required. Safe integer. |
| displacement | Displacement | Required. Safe integer. |
| matches | Matches | Required. Boolean. |
{
"input": {
"firstPosition": 5,
"secondPosition": 8,
"expectedGap": 1,
"allowedSlop": 2
},
"output": {
"observedGap": 3,
"displacement": 2,
"matches": true
}
} Limitations and assumptions
- This tests one pair's displacement without enforcing order separately or matching a complete search phrase.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.
Alternative or Complementary methods
Evaluate complete queries and result sets under a documented tokenization, relevance, and aggregation policy.
References
Similar or alternative tools
- Query Phrase Missing Token Position Flag
For each phrase token, test exact membership in availableTokens and return zero-based missing positions and their tokens.
- Indexing Stopword Position Increment
Retain unflagged tokens with zero-based originalPositions and increments from the prior retained position, beginning from -1.