Recommended setup for javascript client & elasticsearch backend?


(Andy-2) #1

Hi,

My front end is a browser-based javascript program that generates read-
only queries. Should I have the js program communicating directly with
elasticsearch? If not, is there any proxy/middleware setup you would
recommend?

Thanks.


(Sindre Sorhus) #2

I just started using ES too.

I have a setup with a JS frontend directly communicating with ES. I'm using
jQuery for JSONP and jQuery tmpl for templating. ES is fast, and returns a
clean JSON file that you can dig out what you need with JS. I've had no
problems communicating directly with ES, but it might depend on
your environment and what you need to do with the results.


(avasilenko) #3

How did you solve security vulnerability issues? Everyone can access your
data and add, edit, delete it.

2011/8/18 Sindre Sorhus sindresorhus@gmail.com

I just started using ES too.

I have a setup with a JS frontend directly communicating with ES. I'm using
jQuery for JSONP and jQuery tmpl for templating. ES is fast, and returns a
clean JSON file that you can dig out what you need with JS. I've had no
problems communicating directly with ES, but it might depend on
your environment and what you need to do with the results.


(Ivan Brusic) #4

There is a node.js proxy for elasticsearch:

I was considering writing one for nginx, but I believe someone might already
have done so.

--
Ivan

On Thu, Aug 18, 2011 at 4:33 AM, Andy selforganized@gmail.com wrote:

Hi,

My front end is a browser-based javascript program that generates read-
only queries. Should I have the js program communicating directly with
elasticsearch? If not, is there any proxy/middleware setup you would
recommend?

Thanks.


(Lukáš Vlček) #5

Hi,

note that this proxy hasn't been updated for a while but I think it probably
still works fine in most cases (it is highly configurable).
But generally speaking you should not directly expose ES api. It can be
really dangerous. You should deploy proxy (and there are more option, not
only node.js)

Regards,
Lukas

On Thu, Aug 18, 2011 at 10:22 PM, Ivan Brusic ivan@brusic.com wrote:

There is a node.js proxy for elasticsearch:
https://github.com/lukas-vlcek/node.es

I was considering writing one for nginx, but I believe someone might
already have done so.

--
Ivan

On Thu, Aug 18, 2011 at 4:33 AM, Andy selforganized@gmail.com wrote:

Hi,

My front end is a browser-based javascript program that generates read-
only queries. Should I have the js program communicating directly with
elasticsearch? If not, is there any proxy/middleware setup you would
recommend?

Thanks.


(Andy-2) #6

There is a node.js proxy for elasticsearch:https://github.com/lukas-vlcek/node.es

I was considering writing one for nginx, but I believe someone might already
have done so.

Can you share a link to the nginx proxy?


(Andy-2) #7

You should deploy proxy (and there are more option, not
only node.js)

Can you share those options? Any list of available proxies for
elasticsearch?


(Sindre Sorhus) #8

It's running on a restricted network, so it's not really a problem.

But for my next project, I could need a Python proxy for ES. Someone make.
:wink:


(system) #9