# Simple query string syntax highlighter

**URL:** <https://discuss.elastic.co/t/simple-query-string-syntax-highlighter/225130>\
**Category:** Elasticsearch\
**Created:** [March 26, 2020, 6:53am UTC](https://discuss.elastic.co/t/simple-query-string-syntax-highlighter/225130 "2020-03-26T06:53:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![weilandia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weilandia/32/55574_2.png) [@weilandia](https://discuss.elastic.co/u/weilandia)\
**Post date:** [March 26, 2020, 6:53am UTC](https://discuss.elastic.co/t/simple-query-string-syntax-highlighter/225130/1 "2020-03-26T06:53:33Z")

</div>

Does anyone know of an existing syntax highlighter for simple query string?

More generally, I’d like to find a way to help my users avoid mistakes in their queries — missing parentheses, missing quotes for a phrase, etc. My first instinct was to write a syntax highlighter (the queries are simple query strings), but open to ideas.

Thanks!

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [March 27, 2020, 11:15am UTC](https://discuss.elastic.co/t/simple-query-string-syntax-highlighter/225130/2 "2020-03-27T11:15:52Z")

</div>

There's a [javascript package](https://www.npmjs.com/package/lucene-query-parser) that can parse Lucene `query_string` syntax and it give you offsets of where errors occur that can be useful in highlighting.

If you can use Kibana, the KQL input format tries to help with a lot of this stuff in providing auto-complete behaviour and selections built into the input box.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 24, 2020, 11:26am UTC](https://discuss.elastic.co/t/simple-query-string-syntax-highlighter/225130/3 "2020-04-24T11:26:49Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
