ani8570 opened a new issue, #14056:
URL: https://github.com/apache/lucene/issues/14056
### Description
Hello,
I'm contacting you to confirm a discrepancy I've found while using
SpanNearQuery.
When searching for "applepie bananapie", it doesn't find results in files
indexed as "apple pie banana pie"
When analyzing "applepie bananapie":
apple:PositionIncrementAttribute.setPositionIncrement(1)
pie:PositionIncrementAttribute.setPositionIncrement(0)
banana:PositionIncrementAttribute.setPositionIncrement(1)
pie:PositionIncrementAttribute.setPositionIncrement(0)
Then searching with inorder spanNear(apple, pie, banana, pie)
3. Expected normal search results for all values below the default of 21
4. No results output
5. Debugging results show:
```
@Override public int endPosition() {
return (position == -1) ? -1 : (position != NO_MORE_POSITIONS) ? position +
1 : NO_MORE_POSITIONS;
}
```
The search stops due to position + 1, resulting in no search results
I'm wondering if there's a special reason for including position + 1. If
not, it seems it would be better to remove the "+1" part.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]