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

add a facet function to pick one result's value

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • faceting
    • None

    Description

      The facet functions and analytics working great, especially with json API !

      As a developer, I would like a facet function to get a field value from one record from a group, please see this facet query:

      {
      "schema": {
      "slide_id":

      { "type": "long" }

      ,
      "slide_name":

      { "type": "string" }

      ,
      "slide_create_time":

      { "type": "timestamp" }

      },

      "facet.query": {
      "slide_viewed": {
      "type": "terms",
      "field": "slide_id",
      "facet": {
      "avg_viewed_time": "avg(slide_viewed_time)",
      "created_time": "max(slide_create_time)",
      "slide_name": "ANY_FIRST_LAST_OR_FILTER(slide_name)"
      }
      },
      "total": {
      "type": "query",
      "q": ":",
      "facet":

      { "slide_num": "unique(slide_id)" }

      }
      }
      }

      when grouping by slide_id, I would love to have the a function that can pick a slide name from each group of slides with the same slide_id.

      I know I can get the name by using sub facet, but it will be in one level deep, and I can't sort by it, it would be great to be in one flat level, so they can be sorted.

      thanks!

      Attachments

        Activity

          People

            Unassigned Unassigned
            flashflexpro Gary Yang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: