Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
courses:cs397:winter2017:elasticsearch [2017/03/27 17:16] – [Inserting documents to an index] admin | courses:cs397:winter2017:elasticsearch [2017/04/16 19:23] – [Limiting Results] admin | ||
---|---|---|---|
Line 2: | Line 2: | ||
The following assumes that elasticsearch is running on the localhost on port 9200. | The following assumes that elasticsearch is running on the localhost on port 9200. | ||
+ | |||
+ | How do I learn more? https:// | ||
===== General Info about elasticsearch instance ===== | ===== General Info about elasticsearch instance ===== | ||
Line 22: | Line 24: | ||
curl –XGET ‘localhost: | curl –XGET ‘localhost: | ||
+ | |||
+ | ==== Filtering Results ==== | ||
+ | |||
+ | Only get results that match certain criteria: | ||
+ | |||
+ | curl -XGET ' | ||
+ | |||
+ | |||
+ | curl -XGET ' | ||
+ | " | ||
+ | " | ||
+ | { " | ||
+ | { " | ||
+ | ] | ||
+ | } | ||
+ | } | ||
+ | }' | ||
+ | |||
+ | ==== Sorting Examples ==== | ||
+ | |||
+ | Search '' | ||
+ | |||
+ | curl -XGET ' | ||
+ | |||
+ | Search '' | ||
+ | |||
+ | curl -XGET ' | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | { " | ||
+ | ] | ||
+ | }' | ||
+ | | ||
+ | ==== Limiting Results ==== | ||
+ | |||
+ | Only give one result back from searching '' | ||
+ | |||
+ | curl -XGET ' | ||
+ | | ||
+ | Give back one result, starting at search result 10, from '' | ||
+ | |||
+ | curl -XGET ' | ||
+ | |||
+ | ==== Aggregations ==== | ||
+ | |||
+ | curl -XGET ' | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | ' | ||
===== Adding Information ===== | ===== Adding Information ===== |