You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Jigar Shah <ji...@gmail.com> on 2016/10/31 20:28:41 UTC

ProximityQueryNode dosen't allow distance parameter to be 0

In some cases where tokens are indexed at same position. e.g. using
(synonym filter).

Queryparser Flexible API dosen't allow to create ProximityQueryNode with
distance '0'.

{code}

    if (type == Type.NUMBER) {
      if (distance <= 0) {
        throw new QueryNodeError(new MessageImpl(
            QueryParserMessages.PARAMETER_VALUE_NOT_SUPPORTED, "distance",
            distance));

      } else {
        this.distance = distance;
      }

{code}

Is this a bug ?