Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
courses:cs397:winter2017:elasticsearch [2017/03/27 17:16] – [Inserting documents to an index] admincourses:cs397:winter2017:elasticsearch [2017/03/27 17:18] – [Viewing Data] admin
Line 22: Line 22:
  
   curl –XGET ‘localhost:9200/index/_search?pretty’   curl –XGET ‘localhost:9200/index/_search?pretty’
 +
 +==== Sorting Examples ====
 +
 +Search ''index'', matching all, and sorting by ''field''
 +
 +  curl -XGET 'localhost:9200/index/_search?q=*&sort=field:asc&pretty’
 +
 +Search ''index'', matching all, and sorting by ''field''
 +
 +  curl -XGET 'localhost:9200/index/_search?pretty' -H 'Content-Type: application/json' -d’
 +{
 +  "query": { "match_all": {} },
 +  "sort": [
 +    { "field": "asc" }
 +  ]
 +}'
  
 ===== Adding Information ===== ===== Adding Information =====
courses/cs397/winter2017/elasticsearch.txt · Last modified: 2017/04/16 19:26 by admin
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0