Elasticsearch 全文搜尋

2022-07-25 10:30:36 字數 987 閱讀 6357

// 1,初始化資料

delete /my_index

put /my_index

} post /my_index/my_type/_bulk}}

}}// 2,match 單個詞查詢

get /my_index/my_type/_search

}}// 3,match 多詞查詢

get /my_index/my_type/_search

}}// 3.1 operator 操作符,預設值為or

get /my_index/my_type/_search}}}

// 3.2 minimum_should_match 最小匹配引數

get /my_index/my_type/_search

}}}

// 組合查詢

get /my_index/my_type/_search

}, "must_not":},

"should":[},}

]}

}}// 控制精度(minimum_should_match)

get /my_index/my_type/_search

}, },}],

"minimum_should_match": 2

}}}

// boost 控制查詢語句的相對權重,預設值為1,大於1會提公升乙個語句的相對權重

get /_search}},

"should": [

}},}}]}

}}

// 1,新增字段,並配置分析器}}

}// 2,validate-query api 分析查詢過程

get /my_index/my_type/_validate/query?explain

}, }]}

}}

elasticsearch全文搜尋

put test4 properties age mail hobby 結果 插入資料 post test4 bulk 單詞搜尋 post test4 search highlight 結果 hits max score 0.816522,hits highlight highlight 過程說明 ...

elasticSearch 全文檢索工具

index es裡的index相當於乙個資料庫。type 相當於資料庫裡的乙個表。id 唯一,相當於主鍵。node 節點是es例項,一台機器可以執行多個例項,但是同一臺機器上的例項在配置檔案中要確保http和tcp埠不同 下面有講 cluster 代表乙個集群,集群中有多個節點,其中有乙個會被選為主...

全文搜尋之 Elasticsearch

elasticsearch es 是乙個基於 lucene 的開源搜尋引擎,它不但穩定 可靠 快速,而且也具有良好的水平擴充套件能力,是專門為分布式環境設計的。json 輸入 輸出格式為 json,意味著不需要定義 schema,快捷方便 restful 基本所有操作 索引 查詢 甚至是配置 都可以...