zincsearch / zincsearch

ZincSearch . A lightweight alternative to elasticsearch that requires minimal resources, written in Go.

Home Page:https://zincsearch-docs.zinc.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: summary aggregation function support

ssli08 opened this issue · comments

Add summary aggregation function for zinc, which can help summarize the number of certain keyword in the search results

Can you please provide some examples of what it might look like?

On Mon, Dec 27, 2021, 7:08 PM ssli08 @.> wrote: Add summary aggregation function for zinc, which can help summarize the number of certain keyword in the search results — Reply to this email directly, view it on GitHub <#57>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABALWDANONPYRBIWZ5Z4J3LUTES4DANCNFSM5K3LEV4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you are subscribed to this thread.Message ID: @.>

it might be just like

  1. shell command grep 'GET' searched.txt|grep ' 200 '|wc -l
  2. sql: select count(*) from table where column="keyword"

thanks

We already get standard aggregations today (Not faceted though). If you are able to construct the complete query using querystring you should be able to get the total number. Check this https://github.com/prabhatsharma/zinc#search - output section. If your query type is querystring then you can get the totals. What you can't get today is if you have something like in SQL GROUP BY clause.

From your examples it seems that you are looking for a single output - total value.

{
  "took": 0,
  "timed_out": false,
  "max_score": 7.6978611753656345,
  "hits": {
    "total": {
      "value": 3
    },

Does this help?

@ssli08 Does existing aggregation that provides totals covers your use case?