我对ElasticSearch.I很陌生,我发现当我用"2“搜索时,它会给出如下的记录,但是当我搜索"2升”时,它会给出空的结果。似乎ElasticSearch服务器并没有考虑单词之间的空间。
苏索橙质量风味2升罐头ERP2
谁能帮我换一下我需要的东西吗?
谢谢。
已索引的中的JSON字段
产品细节:苏索橙优质风味2升罐头ERP2
ElasticSearch AngularJS客户端代码.
EsConnector.controller('QueryController', function($scope, es) {
$scope.change = function() {
console.log($scope.searchProduct);
// search for documents
es.search({
index: 'test_index',
size: 50,
body: {
"query":
{
"regexp": {
"productDetail":$scope.searchProduct+".*",
} ,
"analyzer": "whitespace"
},
}
}).then(function (response) {
$scope.hits = response.hits.hits;
});
}
});发布于 2014-05-29 19:48:37
https://stackoverflow.com/questions/23085226
复制相似问题