{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Search",
    "type": "object",
    "additionalProperties": false,
    "description": "TAnalytics-v3 .. Any time search engine was used and final list of results was returned. This could be an explicit request by the user or recommendations by the app.",
    "properties": {
        "log_context": {
            "$ref": "/resources/schema/analytics/client/v3/LogContext.json",
            "description": "Required Log Context Reference"
        },
        "event_name": {
            "type": "string",
            "enum": ["SEARCH"]
        },
        "schema_definition": {
            "type": "string",
            "enum": ["Search"]
        },
        "trigger": {
            "$ref": "/resources/schema/analytics/client/v3/SearchTriggerType.json",
            "description": "Reqired Starting Point of the Search in the app"
        },
        "mode": {
            "$ref": "/resources/schema/analytics/client/v3/SearchMode.json",
            "description": "Method of organizing search results"
        },
        "sort_type": {
            "$ref": "/resources/schema/analytics/client/v3/SearchType.json",
            "description": "Method of organizing search results"
        },
        "transaction_id": {
            "type": "string",
            "description": "Search transaction ID for the request"
        },
        "gecoding_source": {
            "type": "string",
            "description": "Search geocoding source for the request"
        },
        "term": {
            "type": "string",
            "description": "Search term entered by user (entire string)"
        },
        "srp_list": {
            "type": "array",
            "items": {
                "$ref": "/resources/schema/analytics/client/v3/SearchListItem.json"
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Required List of EntityIDs,Impression IDs,positions on SRP. The only scenario where srp_list would not be present is when search returns no matches."
        },
        "entity_id": {
            "type": "string",
            "description": "Required .. EntityID of the destination for which route was calculated."
        },
        "search_id": {
            "type": "string",
            "description": "LogID of the search event that triggered the first result page. For example, in case of pagination, the second search event logged (i.e. the 2nd page) should capture search_id as the log id of the search that rendered the first page. For the first page search_id would be same as log_id."
        },
        "parent_log_id": {
            "type": "string",
            "description": "The LogID of triggering event"
        },
        "route_id": {
            "type": "string",
            "description": "The LogID of the route id"
        },
        "autosuggest_id": {
            "type": "string",
            "description": "The LogID of the Autosuggest that was selected to initiate the search"
        },
        "autosuggest_iid": {
            "type": "string",
            "description": "The ImpressionID from the Autosuggest result that was selected to initiate the search"
        },
        "display": {
            "$ref": "/resources/schema/analytics/client/v3/DisplayType.json",
            "description": "Required Display mode of SRP"
        },
        "category_id": {
            "type": "string",
            "description": "POI category ID for the search initiated"
        },
        "category": {
            "type": "string",
            "description": "POI category like Coffee, Gas, ATM, etc"
        },
        "subcategory": {
            "type": "string",
            "description": "Log the subcategory if any. For example when user clicks on restaurants there may be a sub option of American, Mexican, etc."
        },
        "impression_limit": {
            "type": "number",
            "description": "Limit on the number of impressions displayed on a page"
        },
        "interaction_method": {
            "$ref": "/resources/schema/analytics/client/v3/InteractionMethodValues.json",
            "description": "for each user interaction log the interation method"
        },
        "request_time": {
            "type": "integer",
            "description": "Timestamp of the request (in milliseconds)"
        },
        "response_time": {
            "type": "integer",
            "description": "Timestamp of the response (in milliseconds)"
        },
        "first_time": {
            "type":"string",
            "enum": ["YES", "NO", "NONE"],
            "description": "Marks the first time this combination of values for the properties event_label, event_environment and page_title is fired for a user"
        },
        "event_environment":{
            "$ref":"/resources/schema/analytics/client/v3/EventEnvironmentValues.json",
            "description":"To identify if event happened on the mobile app or when connected to Car Play or if the app is on a memory stick or directly on a head unit."
        },
        "event_label":{
            "type":"string",
            "description":"The label of the button or the icon interacted with"
        },
        "page_title":{
            "type":"string",
            "description":"The identify the screen where the event occured. This is the URL for the screen/page"
        }
    },
    "required": [
        "log_context",
        "event_name",
        "schema_definition",
        "trigger",
        "display",
        "search_id",
        "transaction_id",
        "gecoding_source",
        "term",
        "srp_list",
        "parent_log_id",
        "impression_limit",
        "request_time",
        "response_time"
    ]
}