sudo-suhas/elastic-builder

no support - intervals

saviifraimov2 opened this issue · 0 comments

Building an Elasticsearch query using elastic-builder. Most cases are covered. However, "Intervals" is not.

What am I trying and why? to use intervals for search queries such as "home center store" within-6-distance-of plate (AKA ~6). So, for example: plate "home center store" ~6 should give me hits like
"in home center store, my favorite plate can be found",
whereas
"in home center store, there are a lot of new products including my favorite plate"
will not be found.

"query": {
    "bool": {
      "must": [
        {
          "match": {
            "content": {
              "query": 
                "plate"
              
            }
          }
        },
        {
          "intervals" : {
            "content" : {
              "all_of" : {
                "ordered" : true,
                "max_gaps" : 6,
                "intervals" : [
                  {
                    "match" : {
                      "query" : "home center store",
                      "max_gaps" : 0,
                      "ordered" : true
                    }
                  }
                ]
              
              }
          }
          }
        }
        ]
    }
  }

Is there a way to add a "dummy" query with elastic-builder / a built-in function that does it (intervals) OR a solid way to inject the json I set "manually" (which is kind of a bypass).