Elasticssearch:必须请求不起作用

时间:2018-07-27 15:49:06

标签: elasticsearch

我正在尝试使用ElasticSearch 5.6.3进行请求,其中所有文件都应包含_queryText中的字段,文件类型为_docType(.csv,.jpg,.. 。),但是我有一些文件不包含查询中的所有参数。 所有参数都在“信息”字段中。

方法如下:

fullTextSearch(_index, _type, _queryText, _docType): any {
return this.client.search({
    index: _index,
    type: _type,
    body: {
      "stored_fields" : ["date", "infos"],
      'query': {
        "bool":{
          "must":{
            "query_string": {
              "query" : _queryText
            }
          },
          "filter": {
            "query_string": {
              "query": _docType
            }
          }
        }
      }
    },
    sort: '_score',
    _source: ['URL','date','infos'],
  });
}

谢谢您的帮助。

0 个答案:

没有答案
相关问题