Search-the most basic tool

Search-the most basic tool

# Retrieve all documents in ES (empty search)
# Query the first 10 documents

GET /_search

# Specify the timeout time, read the timeout time from each fragment

GET /_search?timeout=1ms

# Multiple types, multiple search
# Search all types in all indexes

GET /_search

# Search all types in the gb index

GET /gb/_search

# Search all types in gb, us two indexes

GET /gb,us/_search

# Search all types in the index beginning with g and u

GET /g*,u*/_search

# Search for tweet type in gb index

GET /gb/tweet/_search

# Search for tweet and user types in gb and us indexes

GET /gb,us/tweet,user/_search

# Search for tweet and user types in all indexes

GET /_all/tweet,user/_search

#分页
# Default size=10, from=0

GET /_search?size=5


# The second page

GET /_search?size=5&from=5


# page three

GET /_search?size=5&from=10

# 轻量搜
# query string

GET /_all/tweet/_search?q=tweet:elasticsearch


# + Means must match,-means not necessarily match, the more matches, the more relevant the document

GET /_all/tweet/_search?q=+name:mary+tweet:fanboy


# Search for document information containing mary in the _all field

GET /_search?q=mary

GET /_search?q=+name:(mary john)+date:>2014-9-10+(elasticsearch geo)

 

Guess you like

Origin blog.csdn.net/qq_39074984/article/details/113700084