2016-06-21 90 views
0

我正在研究elasticsearch 2.3.3。在查询搜索时,只有在指定了字段名称的情况下才能获得结果。即在elasticsearch中需要使用通配符而不是特定字段名称

GET /mydocs/_search?q=file.content:cat 

但我需要搜索而不提供字段名称。这怎么可能?

响应从http://localhost:9200/mydocs

{ 
"mydocs":{ 
    "aliases":{ 

    }, 
    "mappings":{ 
    "indexdocument":{ 
     "properties":{ 
      "docLocation":{ 
       "type":"string", 
       "index":"not_analyzed", 
       "store":true 
      }, 
      "documentType":{ 
       "type":"string", 
       "store":true 
      }, 
      "file":{ 
       "type":"attachment", 
       "fields":{ 
       "content":{ 
        "type":"string", 
        "analyzer":"full" 
       }, 
       "author":{ 
        "type":"string" 
       }, 
       "title":{ 
        "type":"string", 
        "term_vector":"with_positions_offsets", 
        "analyzer":"full" 
       }, 
       "name":{ 
        "type":"string" 
       }, 
       "date":{ 
        "type":"date", 
        "format":"strict_date_optional_time||epoch_millis" 
       }, 
       "keywords":{ 
        "type":"string" 
       }, 
       "content_type":{ 
        "type":"string" 
       }, 
       "content_length":{ 
        "type":"integer" 
       }, 
       "language":{ 
        "type":"string" 
       } 
       } 
      }, 
      "filePermissionInfo":{ 
       "properties":{ 
       "accessControlType":{ 
        "type":"string", 
        "store":true 
       }, 
       "accountValue":{ 
        "type":"string", 
        "store":true 
       }, 
       "fileSystemRights":{ 
        "type":"string", 
        "store":true 
       }, 
       "isInherited":{ 
        "type":"string", 
        "store":true 
       } 
       } 
      }, 
      "id":{ 
       "type":"double", 
       "store":true 
      }, 
      "lastModifiedDate":{ 
       "type":"date", 
       "store":true, 
       "format":"strict_date_optional_time||epoch_millis" 
      }, 
      "title":{ 
       "type":"string", 
       "store":true, 
       "term_vector":"with_positions_offsets" 
      } 
     } 
    } 
    }, 
    "settings":{ 
    "index":{ 
     "creation_date":"1466482894271", 
     "analysis":{ 
      "filter":{ 
       "snowball":{ 
       "type":"snowball", 
       "language":"English" 
       } 
      }, 
      "analyzer":{ 
       "full":{ 
       "filter":[ 
        "lowercase", 
        "snowball" 
       ], 
       "type":"custom", 
       "tokenizer":"standard" 
       } 
      } 
     }, 
     "number_of_shards":"5", 
     "number_of_replicas":"1", 
     "uuid":"PpxcRl29QTCPtFcsd3PHtw", 
     "version":{ 
      "created":"2030399" 
     } 
    } 
    }, 
    "warmers":{ 

    } 
} 
} 
+0

你可以用'GET/mydocs'获得的回答更新你的问题吗? – Val

+0

你想对所有字符串字段执行查询字符串查询吗? https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html –

+0

@RussCam用户不知道任何字段名称,他们将输入要搜索的文本(我正在使用kibana)。我们内部需要检查给定的文本是否包含在标题或附加内容中。可以使用kibana吗? –

回答

相关问题