docs: @Override
    public MtasSpanQuery getQuery() throws ParseException {
      MtasSpanQuery q = null;
      // match any word (try to avoid...)
      if (wordCondition.isEmpty()) {
        q = new MtasSpanMatchAllQuery(wordCondition.field());
        // only positive queries
      } else if (wordCondition.isSimplePositive()) {
        if (wordCondition.isSingle()) {
          q = wordCondition.getPositiveQuery(0);
        } else {
          if (wordCondition.type().equals(MtasCQLParserWordCondition.TYPE_AND)) {
            q = new MtasSpanAndQuery(wordCondition.getPositiveQuery().toArray(
                new MtasSpanQuery[wordCondition.getPositiveQuery().size()]));
          } else if (wordCondition.type()
              .equals(MtasCQLParserWordCondition.TYPE_OR)) {
            q = new MtasSpanOrQuery(wordCondition.getPositiveQuery().toArray(
                new MtasSpanQuery[wordCondition.getPositiveQuery().size()]));
          } else {
            throw new ParseException("unknown type " + wordCondition.type());
          }
        }
        // only negative queries
      } else if (wordCondition.isSimpleNegative()) {
        throw new ParseException("shouldn't be simple negative");
        // both positive and negative queries
      } else {
        if (wordCondition.type().equals(MtasCQLParserWordCondition.TYPE_AND)) {
          MtasSpanQuery qPositive;
          MtasSpanQuery qNegative;
          if (wordCondition.getPositiveQuery().size() == 1) {
            qPositive = wordCondition.getPositiveQuery(0);
          } else {
            qPositive = new MtasSpanAndQuery(
                wordCondition.getPositiveQuery().toArray(
                    new MtasSpanQuery[wordCondition.getPositiveQuery().size()]));
          }
          if (wordCondition.getNegativeQuery().size() == 1) {
            qNegative = wordCondition.getNegativeQuery(0);
          } else {
            qNegative = new MtasSpanOrQuery(
                wordCondition.getNegativeQuery().toArray(
                    new MtasSpanQuery[wordCondition.getNegativeQuery().size()]));
          }
          q = new MtasSpanNotQuery(qPositive, qNegative);
        } else if (wordCondition.type()
            .equals(MtasCQLParserWordCondition.TYPE_OR)) {
          MtasSpanQuery qPositive;
          MtasSpanQuery qNegative;
          if (wordCondition.getPositiveQuery().size() == 1) {
            qPositive = wordCondition.getPositiveQuery(0);
          } else {
            qPositive = new MtasSpanOrQuery(
                wordCondition.getPositiveQuery().toArray(
                    new MtasSpanQuery[wordCondition.getPositiveQuery().size()]));
          }
          if (wordCondition.getNegativeQuery().size() == 1) {
            qNegative = wordCondition.getNegativeQuery(0);
          } else {
            qNegative = new MtasSpanAndQuery(
                wordCondition.getNegativeQuery().toArray(
                    new MtasSpanQuery[wordCondition.getNegativeQuery().size()]));
          }
          q = new MtasSpanNotQuery(qPositive, qNegative);
        } else {
          throw new ParseException("unknown type " + wordCondition.type());
        }
      }
      if (not) {
        MtasSpanQuery qPositive = new MtasSpanMatchAllQuery(
            wordCondition.field());
        q = new MtasSpanNotQuery(qPositive, q);
      }
      return q;
    }