[ 
https://issues.apache.org/jira/browse/SOLR-7828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gary Yang updated SOLR-7828:
----------------------------
    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": 
"*{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.

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!

  was:
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!


> add a 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.
> 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!



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to