【发布时间】:2018-12-19 16:08:06
【问题描述】:
我已经在 windows 中安装了 elasticsearch-6.3.1 并尝试使用 angular 1 中的以下代码过滤数据,它给出了 CORS 错误
$http({
url: 'http://localhost:9200/empinfo/employeedetails/_search',
method: "POST",
data: "{ 'query': { 'query_string': { 'query': 'Sujit','fields':['name'] } } }",
headers: { 'Content-Type': 'application/json' }
}).success(function (data, status, headers, config) {
console.log(data);
}).error(function (data, status, headers, config) {
});
我在 angular.js 中的 Elastic 搜索错误
虽然我在 elasticsearch.yml 文件中添加了 Allow CORS。
请帮帮我。
【问题讨论】:
-
$http
.success方法已经是deprecated and removed from V1.6。
标签: angularjs elasticsearch cors