0

I am newbie to elasticsearch .I am using AWS elastic search instance 5.1.1. I have a requirement where I need to specify multiple indices and types in request body of Elasticsearch for search operation ,is it possible ? What is the simplest way to do it an example would be appreciated. Thanks in advance !

Taylan Aydinli
  • 4,333
  • 15
  • 39
  • 33
SSG
  • 1,265
  • 2
  • 17
  • 29

2 Answers2

0

Referring back to documentation you can try doing a simple CURL as below

curl -XGET 'localhost:9200/_search?pretty'

This should ideally query across all indices and types.

Hope This helps!

Christian Häckh
  • 512
  • 6
  • 11
segFaulter
  • 180
  • 9
  • Thanks segFaulter,Christian But it would be more efficient if we can search across specific indices and types. Also I want to avoid the pattern: /gb,us/user,tweet/_search So is there any other way we can specify multiple indices and types ? – SSG Mar 07 '17 at 05:39
0

When creating Canonical Request you need to URI encode with escape character like

>  str.replaceAll("%20", " "))).toString()
>                 .replaceAll("%3A", ":")
>                 .replaceAll("%2F", "/")
>                 .replaceAll("%3B", ";")
>                 .replaceAll("%40", "@")
>                 .replaceAll("%3C", "<")
>                 .replaceAll("%3E", ">")
>                 .replaceAll("%3D", "=")
>                 .replaceAll("%26", "&")
>                 .replaceAll("%25", "%")
>                 .replaceAll("%24", "$")
>                 .replaceAll("%23", "#")
>                 .replaceAll("%2B", "+")
>                 .replaceAll("%2C", ",")
>                 .replaceAll("%3F", "?");
MMT
  • 81
  • 1
  • 3