2016-04-14 9 views
0

誰かが助けることができたら? 1.タイトルと説明の両方が、トップレベルのフィールドmustnested QueryElasticSearch - ネストされたフィールドの全文検索

GET /docidx/Document/_search 
{ 
    "query": { 
     "query_string": { 
      "query": "title:computer AND description:electronics" 
     } 
    } 
} 

This works fine. 

2. The full text search query where title is top level field but "abstract.content" i.e content is a nested field under abstract - does not return results. 

GET /docidx/Document/_search 
{ 
    "query": { 
     "query_string": { 
      "query": "title:computer AND abstract.content:memory" 
     } 
    } 
} 

Does Elastic Search has support for full text search for nested fields? 

答えて

0

使用の組み合わせですフルテキスト検索クエリ:

GET /docidx/Document/_search 
{ 
"query": { 
    "bool": { 
    "must": [ 
     { 
      "query_string": { 
       "default_field": "title", 
       "query": "computer" 
      } 
     }, 
     { 
      "nested": { 
       "path": "abstract", 
       "query": { 
       "query_string": { 
        "default_field": "abstract.content", 
        "query": "memory" 
       } 
       } 
      } 
      } 
     ] 
     } 
    } 
    } 
+0

しかし、どのようにこのフレーズ「タイトル解析するには:コンピュータと抽象を。内容:メモリ "。または、次のような複雑なフレーズが存在する可能性があります。 - "((タイトル:コンピュータAND記述:electronics OR(serialNum:123 AND misc:test))ORサーバ" – sanesearch

+0

同じquery_stringでクラブのネストされていないフィールドとネストされていないフィールドはできません。 1つのクエリ内のすべてのネストされたフィールドで、他のネストされていないフィールドはネストされておらず、要件に応じて両方の間に 'must'または' should'を適用します – Richa

関連する問題