I guess the question says it all, but the thing is that there are some anomalies here :|
When javascript tries to fetch the search results I get this error:
Firefox(Firebug):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:9200/index/type/_search. (Reason: CORS request failed).
Chrome:
POST http://localhost:9200/index/type/_search net::ERR_CONNECTION_REFUSED
This is a totally anticipated result, so I googled the solution and found it. So I added the following lines to the config:
http.cors.allow-origin: '*'
http.cors.enabled: true
And it kinda fixed the problem. Here's the strange part: The app is on a web server, which I access using, let's say, http://whateverdomain.com. So the origin of the javascript would be http://whateverdomain.com and not localhost, thus the problem. Well if that's the case, how come I can interact with elasticsearch, on the remote server, using Sense on my local machine? Isn't my global IP considered cross-origin????
It might be of importance to mention that in sense, i access the server using its IP.