get ? localhost:9200/_count?pretty ? ?//返回總數(shù)
put ? localhost:9200/megacorp/employee/3 ? ? //插入id為3的數(shù)據(jù)
{
"first_name" :? "Douglas",
"last_name" :? "Fir",
"age" :? ? ? ? 35,
"about":? ? ? ? "I like to build cabinets",
"interests":? [ "forestry" ]
}
get localhost:9200/megacorp/employee/3 ? //查詢id為3的數(shù)據(jù)
get localhost:9200/megacorp/employee/_search? ? //搜索轻要,默認10條
get localhost:9200/megacorp/employee/_search?q=last_name:Smith ? //搜索last_name字段為smith的數(shù)據(jù)
_search?q=key:value ? ? ? ? ? eg: ? ?_search?q=last_name:smith ? (不區(qū)分大小寫)
_search?q=value ? ?ge: ?_search?q=smith
get localhost:9200/megacorp/employee/_search ?//構(gòu)造查詢條件
{
"query":{
"match":{
"last_name":"smith"
}}}