Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no support - intervals #162

Open
saviifraimov2 opened this issue Aug 9, 2022 · 0 comments
Open

no support - intervals #162

saviifraimov2 opened this issue Aug 9, 2022 · 0 comments

Comments

@saviifraimov2
Copy link

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).

@saviifraimov2 saviifraimov2 changed the title lack of support in intervals lack of support - intervals Aug 9, 2022
@saviifraimov2 saviifraimov2 changed the title lack of support - intervals no support - intervals Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant