2013-04-25 63 views
1

我有一個Elasticsearch DSL查詢像下面,ElasticSearch面搜索的多語種現場

query = { 
    "query": {"query_string": {"query": "%s" % q}}, 
     "facets": {"destination": { 
      "terms": {"field": "destination"}}}} 

在我的目的地索引爲象下面這樣一個多語種的領域,

destination': {u'fr': u'Portland', u'en': u'Portland'} 

所以我的面導致來自空因爲這個問題。有任何想法嗎?

回答

0
query = { 
    "query": {"query_string": {"query": "%s" % q}}, 
     "facets": {"destination": { 
      "terms": {"field": "destination.en"}}}} 

工作對我來說

+0

什麼是目標的映射?我認爲目標具有可擴展的屬性結構,因此它可以處理按需屬性,如:destination.en,destination.fr,destination.du等。 – 2013-09-09 13:39:43