lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <trej...@trypticon.org>
Subject Are "position" and "position increment" actually the exact same concept?
Date Tue, 02 Feb 2016 01:21:58 GMT
I found the following code in PhraseQueryNodeBuilder:

    PhraseQuery.Builder builder = new PhraseQuery.Builder();
    List<QueryNode> children = phraseNode.getChildren();
    if (children != null) {
        for (QueryNode child : children) {
            TermQuery termQuery = (TermQuery) child
                .getTag(QueryTreeBuilder.QUERY_TREE_BUILDER_TAGID);
            FieldQueryNode termNode = (FieldQueryNode) child;

           builder.add(termQuery.getTerm(), termNode.getPositionIncrement());
        }
    }

Note that:
    * termNode.getPositionIncrement() returns a "position increment".
    * PhraseQuery.Builder.add(Term,int) takes a "position".

I thought that "position" and "position increment" were two different
things, so I'm confused. Are they actually the same after all?

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message