elasticsearch - Elasticsearch 找不到单词

标签 elasticsearch

我已经在Elasticsearch中加载了一些数据并验证了它已被索引:

curl -XGET http://localhost:9200/studies/gov/NCT02953782
{"_index":"studies","_type":"gov","_id":"NCT02953782","_version":5,"found":true,"_source":{"status": "Recruiting", "is_fda_regulated": false, "description": "", "open_study_countries": ["United States"], "phase": "Phase 1/Phase 2", "completion_date": "2018-05-01", "references": [], "is_drug_intervention": true, "keywords": ["Colorectal Neoplasms, Hu5F9-G4, CD47, cetuximab"], "id": "NCT02953782", "title": "Trial of Hu5F9-G4 in Combination With Cetuximab in Patients With Solid Tumors and Advanced Colorectal Cancer", "summary": " This trial will evaluate Hu5F9-G4 in combination with cetuximab. Hu5F9-G4 is a monoclonal antibody which is designed to block a protein called CD47, which is widely expressed on human cancer cells. Blocking CD47 with Hu5F9-G4 may enable the body's immune system to find and destroy the cancer cells. Cetuximab is a monoclonal antibody drug that is used for treatment of certain types of colorectal cancer as well as head and neck cancer.\n The major aims of the study are: (Phase 1b) to define the safety profile and to determine a recommended Phase 2 dose for Hu5F9-G4 in combination with cetuximab, and (Phase 2) to evaluate the objective response rate of Hu5F9-G4 in combination with cetuximab in patients with advanced colorectal cancer. ", "first_received_date": "2016-11-01", "inclusion_criteria": " - Histological Diagnosis - Phase 1b only: Advanced solid malignancy with an emphasis on colorectal, head and neck, breast, pancreatic and ovarian cancers who have been treated with at least one regimen of prior systemic therapy, or who refuse systemic therapy, and for which there is no curative therapy available. - Phase 2: - KRAS Mutant CRC: Advanced KRAS mutant CRC who have progressed or are ineligible for both irinotecan and oxaliplatin based chemotherapy - KRAS Wild Type CRC: Advanced KRAS wild type CRC who have progressed or are ineligible for both irinotecan and oxaliplatin based chemotherapy and who are relapsed or refractory to at least 1 prior systemic therapy that included an anti-EGFR antibody, such as cetuximab, panitumumab or others. - Adequate performance status and hematological, liver, and kidney function - Phase 2 only: Willing to consent to 1 mandatory pre-treatment and 1 on-treatment tumor biopsy ", "exclusion_criteria": " - Active brain metastases - Prior treatment with CD47 or signal regulatory protein alpha (SIRPα) targeting agents. - Phase 2 only: second malignancy within the last 3 years. - Known active or chronic hepatitis B or C infection or HIV - Pregnancy or active breastfeeding", "start_date": "2016-11-01"}}

当我使用简单查询搜索在其中搜索一个单词时,找不到它:
curl -XPOST http://localhost:9200/studies/_search?pretty=true -d '{
  "query": {
    "simple_query_string" : {
        "query": "Colorectal",
        "analyzer": "snowball"
    }
  }
}'
{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 0,
    "max_score" : null,
    "hits" : [ ]
  }
}

有谁知道如何使它工作?

最佳答案

您的simple_query_string queryquery_string query一样,是针对index.query.default_field索引设置执行的,该设置默认为_all。默认情况下,使用Standard Analyzer分析_all字段。

您需要查询使用Snowball Analyzer,这很可能不是您在索引时使用的。

如果您确实不需要雪球分析仪,则可以要求查询使用标准分析仪。

相反,如果您实际上要使用雪球分析器,则应在开始建立索引文档之前将mapping放在_all字段中,但请确保这样做不会破坏任何其他查询。

这是将snowball分析器放入gov索引的studies类型的映射中的方式:

curl -XPUT http://localhost:9200/studies/_mapping/gov -d'{
  "_all": {
    "analyzer": "snowball"
  }
}'

之后,您需要再次为文档建立索引。

关于elasticsearch - Elasticsearch 找不到单词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42308882/

相关文章:

javascript - 如何在 Node js Controller 文件中引用 Elastic Search JavaScript 客户端库

python - 无法从 pyspark 读取 keystore 文件

pagination - Elasticsearch——持续更新数据的分页

elasticsearch - 如何从 elasticsearch 数据源在 grafana 中制作累积和图?

elasticsearch - EFK JSON key 作为字段

elasticsearch - 如何在Logstash中解析tmx文件(用于翻译数据的xml文件)

search - 在Elasticsearch中按子项聚合过滤父项

elasticsearch - 如何在包含空格的字段上设置一个not_analyized的字段?

amazon-web-services - 为Elastic Search AWS托管实例中的所有字符串设置 “not_analyzed”对我不起作用

elasticsearch - 使用一个索引作为另一个索引的术语来源