How to implement an in query instance like SQL with Elasticsearch

Source: Internet
Author: User

I want to implement an effect similar to the following SQL statement:

Select *  from where inch ('7a482589-e52e-0887-4dd5-5821aab77eea','  C68ACE46-1C07-FCCF-1CB6-57D4E77E40A2','3c9263d2-c44b-a9fd-155e-57aaf783ed58  ','69b087df-eb62-3e70-2cc0-582ec84a561b')

The corresponding ES query should be written as:

$v is a collection of rw_id, GET/_search

{    "query"        : {"Filtered"            : {"Filter                    "                : {"or": {" term ": {" rw_id ":" 7a482589-e52e-0887-4dd5-5821aab77eea " },                    " term ": {" rw_id ":" C68ACE46-1C07-FCCF-1CB6-57D4E77E40A2 " },                     " term ": {" rw_id ":" 3c9263d2-c44b-a9fd-155e-57aaf783ed58 " },                     "term": {"rw_id": "69b087df-eb62-3e70-2cc0-582ec84a561b"}}}}}            

How to implement an in query instance like SQL with Elasticsearch

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.