0

How can I have elasticsearch query return results without _ internal fields such as _index, _type?

Reason: For several pages I use AJAX call to get results rather than render the entire webpage on server. But exposing _index & _type internal fields for every document is not only redundant (bandwidth), its also exposing the index and type names (security issue).

Please help!

user3658423
  • 1,904
  • 5
  • 29
  • 49
  • You should be querying for the fileds you are interested in. Check this - http://stackoverflow.com/questions/9605292/make-elasticsearch-only-return-certain-fields – shan Dec 05 '16 at 23:44

1 Answers1

0

This question was discussed a while ago in this thread of the elasticsearch google group.

In summary you can't hide those "internal" fields out of the box. I guess that you are not querying Elasticsearch directly (I hope your server is not open to the world) but an intermediate REST service, so, you can filter those fields there.

moliware
  • 10,160
  • 3
  • 37
  • 47