1

I am using python 2.7 for backend and angular js for the frontend. I am using AWS elastic search 2.3.3 which is active and the data is indexed. But when I try querying the indexes from angular I am facing the following issue.

Issue

(function() {
'use strict';

angular.module('jobgatorApp', ['ui.router', 'ui.bootstrap', 'angular-carousel', 'ui.tinymce', 'elasticsearch'
    //NO NOT TOUCH THE FOLLOWING LINE, IT IS SEARCH AND REPLACED BY GRUNT WHEN WE MINIFY THE JS
    ])

//TODO RESEARCH LAZY LOAD http://stackoverflow.com/questions/28184616/angularjs-lazy-load-template-and-controller-in-ui-router-requirejs-oclazyload
//TODO RESEARCH SECURITY http://stackoverflow.com/questions/20870386/authentication-with-angularjs-session-management-and-security-issues-with-rest
//TODO RESEARCH SECURITY http://www.pluralsight.com/courses/angularjs-security-fundamentals
    .factory('elasticClient', ['esFactory', function (esFactory) {
        return esFactory({
            location: 'https://search-myjobgator-mkumzk6ax5z3ogumel2ga37bq4.us-west-2.es.amazonaws.com',
            sniffOnStart: true,
            sniffInterval: 300000
        });
    }])
})();
2
  • Why do you want to query from the frontend, instead of providing an API from your backend (which queries ES and returns results to the frontend)? It's usually a bad idea to leave ES open to the world unless you absolutely have to... Commented Aug 31, 2017 at 8:08
  • yeah just shifted querying code to backend its working now thanks:) Commented Sep 1, 2017 at 8:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.