code: public Query rewrite(IndexReader reader) throws IOException
     {
        if (version.getVersion() >= IndexFormatVersion.V3.getVersion())
        {
           RangeQuery localNames = new RangeQuery(getLowerLocalNameTerm(), getUpperLocalNameTerm(), inclusive);
           BooleanQuery query = new BooleanQuery();
           query.add(new JcrTermQuery(new Term(FieldNames.NAMESPACE_URI, getNamespaceURI())),
              BooleanClause.Occur.MUST);
           query.add(localNames, BooleanClause.Occur.MUST);
           return query.rewrite(reader);
        }
        else
        {
           return new RangeQuery(getLowerTerm(), getUpperTerm(), inclusive).rewrite(reader);
        }
     }
docs: {@inheritDoc}