Javascript convert query string to Query DSL


Hi, is there a way to convert a user input string to Query DSL in Node? I notice that searchBar in ElasticUI framework can convert a string to Query DSL object. I'm wondering whether there is a way to convert an input string to DSL object on server side. Thanks in advance!

User input: a reason:b
Converted Query DSL:

  "bool": {
    "must": [
        "simple_query_string": {
          "query": "a"
        "match": {
          "reason": {
            "query": "b",
            "operator": "and"
(Bhavya R M) #2

@Bargs can we please get some help?


(Matt Bargar) #3

The best way to do this is with our new KQL language (referred to as kuery in the code). You can find the tools for parsing it and generating ES queries here:

(system) closed #4

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