NEST vs. javascript/jquery - Trying to get started

(Daniel Duarte Figueiredo) #1

Hello everyone,
This is my first message here and I am new to ElasticSearch.
I am currently developing an ASP.NET MVC application using the Razor View
I'm using an AWS server with two nodes (ec2 small server), using the NGINX
proxy. I configured the server using this tutorial:

My question is: what is the best way to implement the client-server
communication? I was trying to add a script in my view to put or get
indexes in/from the server,
but I couldn't make it work. Then I read about NEST and it seems pretty
interesting, so what do you think is the best way to start?
Are there any advantages or disadvantages in the use of NEST? How can I
configure the connection using the NGINX proxy (the problems I went through
seem to be
related with the proxy)?

Just to ilustrate how I was trying to make the connection:
I wrote a simple script in my .cshtml file that was supposed to retrieve a
previously created index:

var username="USERNAME";
var password="PASSWORD"

function getElastic() { = true;
xhrFields: {
withCredentials: true
beforeSend: function (req, settings) {
make_base_auth(username, password));
type: 'POST',
data: JSON.stringify({
"query": { "match_all": {} }
dataType: 'json',
processData: false,
success: function (json, statusText, xhr) {
error: function (xhr, message, error) {

(system) #2