Query Analysis Time Series
    • PDF

    Query Analysis Time Series

    • PDF

    Article summary

    We are preparing a localization service for the content. We will do our best to provide the localization service as soon as possible.

    Analyze the search queries used at the specified time and calculate them by field.

    • city1: city classification field1 ex) Seoul, Gyeonggi-do, Chungcheongbuk-do
    • city2: city classification field2 ex) Gangnam-gu, Seocho, Guro-gu
    • city3: city classification field2 ex) Yeoksam-dong, Jeongja-dong, Seocho-dong
    • country: country
    • word: word that stemmed from the search Query
    POST https://cloudsearch.apigw.ntruss.com/CloudSearch/real/v1/domain/{name}/analysis/timeseries
    

    Request

    Request parameter

    Parameter NameRequiredTypeRestrictionsDescription
    nameYesstringThe name of the created domain

    Request body

    Field NameRequiredTypeRestrictionsDescription
    fromYesstringStart time (UTC, ex: 20161027T171340Z)
    toYesstringEnd time (UTC, ex: 20161027T171340Z)
    fieldYesQueryAnalysisFieldAggregation field settings
    field_valueNostringOnly return field value matching corresponding parameter
    max_sizeYesintMaximum Size to Import
    intervalYesintinterval of aggregation / unit : min

    Response

    Field NameTypeDescriptionRemarks
    key_as_stringstringaggregate base timeExample: 2019-09-25T09: 50: 00.000Z
    keynumberaggreagte reference time (milliseconds)Example: 1569405000000
    doc_countnumberSum of results aggregated over base time
    aggregated_result.sum_other_doc_countnumberWhen the aggregate result is greater than the specified max_size value, the sum of all the values not printed in the result
    aggregated_result.buckets []arrayGrouping by key of aggreagte result
    aggregated_result.buckets []. keystringThe value of the field used in the query during that time
    aggregated_result.buckets []. doc_countstringThe number of keys used in the query during that time

    Response Status

    Http StatusDesc
    200OK
    400Bad Request
    401Unauthorized
    401there is no such service
    403Forbidden
    404Not Found
    500Internal Server Error

    Example

    Example Request1 : In case 'field_value' is not available

    POST https://cloudsearch.apigw.ntruss.com/CloudSearch/real/v1/domain/car_dev/analysis/timeseries
    
    POST /CloudSearch/real/v1/domain/car_dev/analysis/timeseries HTTP/1.1
    Host:cloudsearch.apigw.ntruss.com
    accept:application/json
    x-ncp-apigw-signature-v2: cDwtHuQeGmwWyNmwlN6XIGA66zge4iMXvfoDQNna05g=
    x-ncp-apigw-timestamp: 1545817618751
    x-ncp-iam-access-key: teGTwtcSEGA7fu28BGGi
    
    {
      "from": "2019-09-25T05:00:00Z",
      "to": "2019-09-25T15:00:00Z",
      "field": "word",
      "max_size": 5,
      "interval": 1
    }
    

    Example response

    [
      {
        "key_as_string": "2019-09-25T09:50:00.000Z",
        "key": 1569405000000,
        "doc_count": 2,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "kia",
              "doc_count": 1
            },
            {
              "key": "hyundai",
              "doc_count": 1
            }
          ]
        }
      },
      {
        "key_as_string": "2019-09-25T09:53:00.000Z",
        "key": 1569405180000,
        "doc_count": 2,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "kia",
              "doc_count": 2
            }
          ]
        }
      }
    ]
    

    Example Request2 : In case 'field_value' is available

    POST https://cloudsearch.apigw.ntruss.com/CloudSearch/real/v1/domain/car_dev/analysis/timeseries
    
    POST /CloudSearch/real/v1/domain/car_dev/analysis/timeseries HTTP/1.1
    Host:cloudsearch.apigw.ntruss.com
    accept:application/json
    x-ncp-apigw-signature-v2: cDwtHuQeGmwWyNmwlN6XIGA66zge4iMXvfoDQNna05g=
    x-ncp-apigw-timestamp: 1545817618751
    x-ncp-iam-access-key: teGTwtcSEGA7fu28BGGi
    
    {
      "from": "2019-09-25T05:00:00Z",
      "to": "2019-09-25T15:00:00Z",
      "field": "word",
      "field_value": "bmw",
      "maxSize": 5,
      "interval": 1
    }
    

    Example response

    [
      {
        "key_as_string": "2019-09-25T10:35:00.000Z",
        "key": 1569407700000,
        "doc_count": 2,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "bmw",
              "doc_count": 2
            }
          ]
        }
      },
      {
        "key_as_string": "2019-09-25T10:38:00.000Z",
        "key": 1569407880000,
        "doc_count": 13,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "bmw",
              "doc_count": 13
            }
          ]
        }
      },
      {
        "key_as_string": "2019-09-25T11:14:00.000Z",
        "key": 1569410040000,
        "doc_count": 11,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "bmw",
              "doc_count": 11
            }
          ]
        }
      },
      {
        "key_as_string": "2019-09-25T11:15:00.000Z",
        "key": 1569410100000,
        "doc_count": 12,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "bmw",
              "doc_count": 12
            }
          ]
        }
      },
      {
        "key_as_string": "2019-09-25T11:16:00.000Z",
        "key": 1569410160000,
        "doc_count": 1013,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "bmw",
              "doc_count": 1013
            }
          ]
        }
      },
      {
        "key_as_string": "2019-09-25T11:17:00.000Z",
        "key": 1569410220000,
        "doc_count": 1016,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "bmw",
              "doc_count": 1016
            }
          ]
        }
      },
      {
        "key_as_string": "2019-09-25T11:18:00.000Z",
        "key": 1569410280000,
        "doc_count": 960,
        "aggregated_result": {
          "sum_other_doc_count": 0,
          "buckets": [
            {
              "key": "bmw",
              "doc_count": 960
            }
          ]
        }
      }
    ]
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.