使用Elasticsearch 7.9.1实现对word,pdf,txt文件的全文内容检索

使用Elasticsearch 7.9.1实现对word,pdf,txt文件的全文内容检索

POST /docwrite/_doc?pipeline=attachment
{
  "name":"测试PDF2",
  "type":"pdf",
  "content":""
}

GET /docwrite/_search
{
  "_source": ["name","type"],
  "query": {
    "match": {
      "attachment.content": {
        "query": "技能中心",
        "analyzer": "ik_smart"
      }
    }
  },
  "highlight": {
    "fields": {
      "attachment.content": {
        "pre_tags": "",
        "post_tags": "
"
      }
    }
  }
}

你可能感兴趣的:(elasticsearch,搜索引擎,lucene)