<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Apache - Solr : Need help with group by on solr documents and sum on different field values in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Apache-Solr-Need-help-with-group-by-on-solr-documents-and/m-p/362235#M238734</link>
    <description>&lt;P&gt;Ok guys, I figured this out myself:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;curl -ikv --negotiate -u: &lt;A href="https://dev-ran-7.dev-ran.root.hwx.site:8995/solr/ranger_audits/select" target="_blank"&gt;https://dev-ran-7.dev-ran.root.hwx.site:8995/solr/ranger_audits/select&lt;/A&gt; -d '&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;q=*:*&amp;amp;wt=json&amp;amp;fl=access%2C%20agent%2C%20repo%2C%20resource%2C%20resType%2C%20event_count&amp;amp;fq=access%3Aread&amp;amp;fq=repo%3Acm_ozone&amp;amp;fq=-repoType%3A7&amp;amp;fq=resType%3Akey&amp;amp;fq=evtTime%3A%5B2023-01-23T18%3A30%3A00Z+TO+NOW%5D&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;json.facet={&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resources:{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;terms,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;resource,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;facet:{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;read_access_count&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;"sum(event_count)"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 25 Jan 2023 09:05:25 GMT</pubDate>
    <dc:creator>Devesh</dc:creator>
    <dc:date>2023-01-25T09:05:25Z</dc:date>
    <item>
      <title>Apache - Solr : Need help with group by on solr documents and sum on different field values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Solr-Need-help-with-group-by-on-solr-documents-and/m-p/362228#M238732</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;Can someone please help me, how I can write a solr query where results to be grouped on one field (text type) and sum on another field. Here is my documents results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"responseHeader": {&lt;BR /&gt;"zkConnected": true,&lt;BR /&gt;"status": 0,&lt;BR /&gt;"QTime": 30,&lt;BR /&gt;"params": {&lt;BR /&gt;"q": "*:*",&lt;BR /&gt;"doAs": "knoxui",&lt;BR /&gt;"fl": "access, agent, repo, resource, resType, event_count",&lt;BR /&gt;"fq": [&lt;BR /&gt;"access:read",&lt;BR /&gt;"repo:cm_ozone",&lt;BR /&gt;"resType:key",&lt;BR /&gt;"action:read"&lt;BR /&gt;],&lt;BR /&gt;"_forwardedCount": "1",&lt;BR /&gt;"_": "1674633786010"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;"response": {&lt;BR /&gt;"numFound": 8,&lt;BR /&gt;"start": 0,&lt;BR /&gt;"docs": [&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1/dir2/dir3",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1/test3.txt",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1/dir2",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1/dir2/dir3",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1/test3.txt",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"access": "read",&lt;BR /&gt;"agent": "ozone",&lt;BR /&gt;"repo": "cm_ozone",&lt;BR /&gt;"resource": "volume1/fso-bucket/dir1/dir2",&lt;BR /&gt;"resType": "key",&lt;BR /&gt;"event_count": 1&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here I need something like equivalent to SQL:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select resource, count(event_count) from &amp;lt;docs&amp;gt; group by resource;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 08:21:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Solr-Need-help-with-group-by-on-solr-documents-and/m-p/362228#M238732</guid>
      <dc:creator>Devesh</dc:creator>
      <dc:date>2023-01-25T08:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Apache - Solr : Need help with group by on solr documents and sum on different field values</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Apache-Solr-Need-help-with-group-by-on-solr-documents-and/m-p/362235#M238734</link>
      <description>&lt;P&gt;Ok guys, I figured this out myself:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;curl -ikv --negotiate -u: &lt;A href="https://dev-ran-7.dev-ran.root.hwx.site:8995/solr/ranger_audits/select" target="_blank"&gt;https://dev-ran-7.dev-ran.root.hwx.site:8995/solr/ranger_audits/select&lt;/A&gt; -d '&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;q=*:*&amp;amp;wt=json&amp;amp;fl=access%2C%20agent%2C%20repo%2C%20resource%2C%20resType%2C%20event_count&amp;amp;fq=access%3Aread&amp;amp;fq=repo%3Acm_ozone&amp;amp;fq=-repoType%3A7&amp;amp;fq=resType%3Akey&amp;amp;fq=evtTime%3A%5B2023-01-23T18%3A30%3A00Z+TO+NOW%5D&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;json.facet={&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;resources:{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;terms,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;field&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;resource,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;facet:{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;read_access_count&lt;/SPAN&gt;&lt;SPAN&gt; : &lt;/SPAN&gt;&lt;SPAN&gt;"sum(event_count)"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 25 Jan 2023 09:05:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Apache-Solr-Need-help-with-group-by-on-solr-documents-and/m-p/362235#M238734</guid>
      <dc:creator>Devesh</dc:creator>
      <dc:date>2023-01-25T09:05:25Z</dc:date>
    </item>
  </channel>
</rss>

