[英]Is multi index search possible with ongr.io's ElasticSearchBundle?
[英]ONGR ElasticSearchBundle Mapping in Document Class
我在我的Symfony項目中安裝了ONGR ElasticSearchBundle。 要搜索具有公司名稱和描述的索引,索引名稱是公司。 它看起來像這樣:
"mappings": {
"_doc": {
"properties": {
"id": {"type": "long"},
"entityid": {"type": "long"},
"entityname": {"type": "keyword"},
"name": {"type": "text"},
"street": {"type": "text"},
"city": {"type": "text"},
"zip": {"type": "long"},
"ziptext": {"type": "keyword"},
"regionisocode": {"type": "keyword"},
"desc": {"type": "text"},
"branch": {"type": "text"},
"branchid": {"type": "long"},
"foundingyear": {"type": "date"}
}
}
}
然后我使用控制台工具創建一個文檔。
/**
* Company
*
* @ES\Document()
*/
class Company
{
/**
* @var string
*
* @ES\Property(type="long", options={"index"="not_analyzed"})
*/
private $id;
/**
* @var string
*
* @ES\Property(type="long", options={"index"="not_analyzed"})
*/
private $entityid;
/**
* @var string
*
* @ES\Property(type="keyword", options={"index"="not_analyzed"})
*/
private $entityname;
...
到目前為止,這似乎有效。 與ElasicSearch主機的連接正常,但即使我做了一個MatchAllQuery()我認為這是一個映射問題,我也沒有得到搜索結果? 梅比有人有提示嗎?
誠摯
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.