Skip to content

Example of Elasticsearch Pass-Through query #12341

Answered by metalshanked
metalshanked asked this question in Q&A
Discussion options

You must be logged in to vote

Update: Found the answer, I had an extra colon earlier which was causing empty results

Example: Standard DSL Query

GET my_index/_search
{
  "query": {
    "query_string": {
      "fields": ["message"],
      "query": "Hello World"
    }
  }
}

Convert above query (just the query part and not GET my_index/_search ) into Base32 using any web or code tool (easily available)

Converted BASE32 string

PMFCAIBCOF2WK4TZEI5CA6YKEAQCAIBCOF2WK4TZL5ZXI4TJNZTSEORAPMFCAIBAEAQCAITGNFSWYZDTEI5CAWZCNVSXG43BM5SSEXJMBIQCAIBAEAQCE4LVMVZHSIR2EAREQZLMNRXSAV3POJWGIIQKEAQCAID5BIQCA7IKPU======

Use in Query

SELECT * FROM es.default."my_index$query:PMFCAIBCOF2WK4TZEI5CA6YKEAQCAIBCOF2WK4TZL5ZXI4TJNZTSEORAPMFCAIBAEAQ…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by metalshanked
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants