Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14614

Add Simplified Aggregation Interface to Streaming Expression

    XMLWordPrintableJSON

    Details

      Description

      For the Data Analytics use cases the standard use case is:

      1. Find a pattern
      2. Then Aggregate by certain dimensions
      3. Then compute metrics (like count, sum, avg)
      4. Sort by a dimension or metric
      5. look at top-n

      This functionality has been available over many different interfaces in the past on solr, but only streaming expressions have the ability to deliver results in a scalable, performant and stable manner for systems that have large data to the tune of Big data systems.

      However, one barrier to entry is the query interface, not being simple enough in streaming expressions.

      to give an example of how involved the corresponding streaming expression can get, to get it to work on large scale systems, find top 10 cities where someone named Alex works with the respective counts

      qt=/stream&aggregationMode=facet&expr=
      select( top( rollup(sort(by%3D"city+asc",
         +plist( 
                select(facet(collection1,+q%3D"(*:*+AND+name:alex)",+buckets%3D"city",+bucketSizeLimit%3D"2010",+bucketSorts%3D"count(*)+desc",+count(*)),+city,+count(*)+as+Nj3bXa),
      
                select(facet(collection2,+q%3D"(*:*+AND+name:alex)",+buckets%3D"city",+bucketSizeLimit%3D"2010",+bucketSorts%3D"count(*)+desc",+count(*)),+city,+count(*)+as+Nj3bXa)
               )),
      		+over%3D"city",+sum(Nj3bXa)),
      	+n%3D"10",+sort%3D"sum(Nj3bXa)+desc"),
      +city,+sum(Nj3bXa)+as+Nj3bXa)
      
      
      

      This is a query on an alias with 2 collections behind it representing 2 data partitions, which is a requirement of sorts in big data systems. This is one of the only ways to get information from Billions of records in a matter of seconds. This is awesome in terms of capability and performance.

      But one can see how involved this syntax can be in the current scheme and is a barrier to entry for new adopters.

       

      This Jira is to track the work of creating a simplified analytics endpoint augmenting streaming expressions.

      a starting proposal is to have the endpoint have these query parameters:

      /analytics?action=aggregate&q=*:*&fq=name:alex&dimensions=city&metrics=count&sort=count&sortOrder=desc&limit=10

      This is equivalent to a sql that an analyst would write:

      select city, count(*) from collection where name = 'alex'
      group by city order by count(*) desc limit 10;

      On the solr side this would get translated to the best possible streaming expression using rollups, top, sort, plist etc.; but all done transparently to the user.

      Heres to making the power of Streaming expressions simpler to use for all.

       

       

        Attachments

          Activity

            People

            • Assignee:
              thelabdude Timothy Potter
              Reporter:
              aroopganguly Aroop
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: