Github user mikemccand commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/129#discussion_r94215751
--- Diff:
lucene/core/src/java/org/apache/lucene/util/graph/GraphTokenStreamFiniteStrings.java
---
@@ -114,21 +127,20 @@ private void build(final TokenStream in) throws
IOException {
in.reset();
int pos = -1;
- int lastPos = 0;
+ int lastIncr = 1;
int maxOffset = 0;
int maxPos = -1;
int state = -1;
while (in.incrementToken()) {
int posInc = posIncAtt.getPositionIncrement();
- assert pos > -1 || posInc > 0;
- if (posInc > 1) {
- throw new IllegalArgumentException("cannot handle holes; to accept
any term, use '*' term");
- }
+ // always use inc 1 while building, but save original increment
+ int fakePosInc = posInc > 1 ? 1 : posInc;
--- End diff --
Maybe just `Math.min(1, posInc)` instead?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]