[ 
https://issues.apache.org/jira/browse/LUCENE-7603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15787396#comment-15787396
 ] 

ASF GitHub Bot commented on LUCENE-7603:
----------------------------------------

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?


> Support Graph Token Streams in QueryBuilder
> -------------------------------------------
>
>                 Key: LUCENE-7603
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7603
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/queryparser, core/search
>            Reporter: Matt Weber
>
> With [LUCENE-6664|https://issues.apache.org/jira/browse/LUCENE-6664] we can 
> use multi-term synonyms query time.  A "graph token stream" will be created 
> which which is nothing more than using the position length attribute on 
> stacked tokens to indicate how many positions a token should span.  Currently 
> the position length attribute on tokens is ignored during query parsing.  
> This issue will add support for handling these graph token streams inside the 
> QueryBuilder utility class used by query parsers.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to