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:12] – [General Info about elasticsearch instance] admin | courses:cs397:winter2017:elasticsearch [2017/03/27 17:19] – [Sorting Examples] admin | ||
---|---|---|---|
Line 14: | Line 14: | ||
curl -XGET ' | curl -XGET ' | ||
- | ===== Searching ===== | + | ===== Searching |
+ | |||
+ | |||
+ | ==== Viewing Data ==== | ||
+ | |||
+ | This will give you, by default, the first 20 results as prettified JSON | ||
+ | |||
+ | curl –XGET ‘localhost: | ||
+ | |||
+ | ==== 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 ' | ||
+ | |||
+ | ===== Adding Information ===== | ||
+ | |||
+ | ==== Adding an index ==== | ||
+ | |||
+ | curl -XPUT ' | ||
+ | |||
+ | ==== Inserting documents to an index ==== | ||
+ | |||
+ | Insert the JSON document (after the -d) into the index with the id '' | ||
+ | |||
+ | curl –XPUT ‘localhost: | ||