manticoresoftware / manticoresearch

Easy to use open source fast database for search | Good alternative to Elasticsearch now | Drop-in replacement for E in the ELK soon
https://manticoresearch.com
GNU General Public License v3.0
8.87k stars 490 forks source link

Sorting buckets via HTTP JSON API #961

Closed 2peter3 closed 1 year ago

2peter3 commented 1 year ago

A clear and concise description of what the problem is.
Currently it isn't possible sort a bucket via HTTP JSON API,
Fallback is currently via SQL.

Describe the solution you'd like
A clear and concise description of what you want to happen.
A function like this to get a sorted response of the buckets

      test_group: {    
        terms: {    
          field: "test",    
          size: 50,    
        },    
        sort: { order: "asc" },    
      },    

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Fallback is currently via SQL.

tomatolog commented 1 year ago

fixed at c4fc82d48360805ba3a8c9d1a182363db92d2a9a where sort option added it has the same syntax as the main query Sorting by attributes

You could read documentation after CI pass at the Faceted_search#HTTP-JSON

you could also use package from the dev repository after CI pass and push the package into dev repository