2013-03-16 20 views
0

我試圖將elasticsearch的multi_field語法與Elastica結合使用。我創建了一個索引和映射,如下所示:Elastica multi_field安裝程序

$mapping->setProperties(array(
    'id'   => array('type' => 'string', 'include_in_all' => true), 
    'title'  => array('type' => 'string', 'include_in_all' => true), 
    'publisher' => array('type' => 'multi_field', 'include_in_all' => TRUE, 'fields' => 
     array('publisherName' => array('type' => 'string', 'index' => 'analyzed'), 
      'untouched'  => array('type' => 'string', 'index' => 'not_analyzed') 
    ) 
)); 

到目前爲止,這麼好。我可以針對標題字段運行查詢。

但是,當我嘗試查詢http://example.com:9200/_plugin/head/字段「publisher」時,我無法選擇字段發佈者或創建結構化查詢。我看起來,字段發佈者不在索引中。

但我可以在publisher.untouched上構建方面,這很有效。我的地圖有什麼問題?我需要搜索發佈商。

回答