def invenio_query_factory(parser=None, walkers=None):
parser = parser or Main<EOL>walkers = walkers or [PypegConverter()]<EOL>walkers.append(ElasticSearchDSL())<EOL>def invenio_query(pattern):<EOL><INDENT>query = pypeg2.parse(pattern, parser, whitespace="<STR_LIT>")<EOL>for walker in walkers:<EOL><INDENT>query = query.accept(walker)<EOL><DEDENT>return query<EOL><DEDENT>return invenio_query<EOL>
Create a parser returning Elastic Search DSL query instance.