public ParsedQuery parse(final String query) throws ParseException {
        final TokenCollectingQueryParser parser = new TokenCollectingQueryParser(ParsedTerm.DEFAULT_FIELD, ANALYZER);
        parser.setSplitOnWhitespace(true);
        parser.setAllowLeadingWildcard(allowLeadingWildcard);

        final Query parsed = parser.parse(query);
        final ParsedQuery.Builder builder = ParsedQuery.builder().query(query);

        builder.tokensBuilder().addAll(parser.getTokens());

        final TermCollectingQueryVisitor visitor = new TermCollectingQueryVisitor(ANALYZER, parser.getTokenLookup());
        parsed.visit(visitor);
        builder.termsBuilder().addAll(visitor.getParsedTerms());
        return builder.build();
    }
@Test
    void getFieldExistPosition() throws ParseException {
        final ParsedQuery fields = parser.parse("_exists_:lorem");
        assertThat(fields.allFieldNames()).contains("lorem");
        assertThat(fields.terms())
                .hasSize(1)
                .extracting(ParsedTerm::keyToken)
                .hasOnlyOneElementSatisfying(term ->
                        assertThat(term).hasValueSatisfying(t -> {
                            assertThat(t.beginLine()).isEqualTo(1);
                            assertThat(t.beginColumn()).isEqualTo(9);
                            assertThat(t.endLine()).isEqualTo(1);
                            assertThat(t.endColumn()).isEqualTo(14);
                        }));
    }