You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Gary Yang (JIRA)" <ji...@apache.org> on 2015/07/24 19:33:04 UTC

[jira] [Created] (SOLR-7828) add a new facet function to pick one result's value

Gary Yang created SOLR-7828:
-------------------------------

             Summary: add a new facet function to pick one result's value
                 Key: SOLR-7828
                 URL: https://issues.apache.org/jira/browse/SOLR-7828
             Project: Solr
          Issue Type: New Feature
          Components: faceting
    Affects Versions: 5x
            Reporter: Gary Yang


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": "*{color:red}ANY_FIRST_LAST_OR_FILTER{color}*(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.

thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org