Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An order of fields in HTTP API aggregation request affect results #2364

Closed
5 tasks done
Nick-S-2018 opened this issue Jul 2, 2024 · 3 comments
Closed
5 tasks done

Comments

@Nick-S-2018
Copy link
Collaborator

Nick-S-2018 commented Jul 2, 2024

Bug Description:

Setting the sort key before the terms key inside the aggs node leads to an error. If the order is opposite, all works fine.

curl -X GET localhost:9308/cli -d 'create table test(f int)'
Query OK, 0 rows affected (0.012 sec)

curl -sX POST http://localhost:9308/search -d '  
{
   "index":"test",
   "aggs":{
      "group_property":{
         "terms":{
            "field":"f"
         },                
         "sort":[
            {   
               "count(*)":{
                  "order":"desc"
               }
            }           
         ]
      }
   }   
}'
{"took":0,"timed_out":false,"hits":{"total":0,"total_relation":"eq","hits":[]},"aggregations":{"group_property":{"buckets":[]}}}

curl -sX POST http://localhost:9308/search -d '  
{
   "index":"test",
   "aggs":{
      "group_property":{
         "sort":[
            {
               "count(*)":{
                  "order":"desc"
               }
            }
         ],
         "terms":{
            "field":"f"
         }
      }
   }
}'
{"error":"\"aggs\" bucket 'group_property' should be an object"}

Manticore Search Version:

Manticore 6.3.3 1de3cb364@24062617 dev

Operating System Version:

Ununtu 22.04 LTS

Have you tried the latest development version?

Yes

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

  • Implementation completed
  • Tests developed
  • Documentation updated
  • Documentation reviewed
  • Changelog updated
@sanikolaev
Copy link
Collaborator

@Nick-S-2018 does this issue block anything?

@Nick-S-2018
Copy link
Collaborator Author

No, it doesn't.

@leessmin
Copy link

leessmin commented Jul 3, 2024

I also encountered this problem, the key is the go language map can not be adjusted to follow the order of the headache

@sanikolaev sanikolaev added the rel::upcoming Upcoming release label Jul 3, 2024
@sanikolaev sanikolaev reopened this Jul 3, 2024
tomatolog added a commit that referenced this issue Jul 11, 2024
@sanikolaev sanikolaev added rel::6.3.4 and removed rel::upcoming Upcoming release labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants