Query Analysis Time Series
    • PDF

    Query Analysis Time Series

    • PDF

    Article Summary

    지정한 시간에 사용된 검색 Query 들을 분석하여 field 별로 계산합니다.

    • city1: 도시 구분필드1 ex) 서울특별시, 경기도, 충청북도
    • city2: 도시 구분필드2 ex) 강남구, 서초, 구로구
    • city3: 도시 구분필드2 ex) 역삼동, 정자동, 서초동
    • country: 국가
    • word : 검색 Query 를 형태소분석한 word
    POST https://cloudsearch.apigw.gov-ntruss.com/CloudSearch/real/v1/domain/{name}/analysis/timeseries
    

    요청

    요청 파라미터

    파라미터 명필수 여부타입제약사항설명
    nameYesstring생성되어져 있는 Domain 이름

    요청 바디

    파라미터 명필수 여부타입제약사항설명
    fromYesstring시작 시간(UTC, ex: 20161027T171340Z )
    toYesstring종료 시간(UTC, ex: 20161027T171340Z )
    fieldYesQueryAnalysisField집계 field 설정
    field_valueNostring해당 파라미터와 일치하는 field value 만 리턴
    max_sizeYesintaggregate 할 key의 최대 갯수
    intervalYesintaggregation 하는 시간 / 단위 : 분

    응답

    필드명타입설명비고
    key_as_stringstringaggregate 기준 시간예시: 2019-09-25T09:50:00.000Z
    keynumberaggreagte 기준 시간(milliseconds)예시: 1569405000000
    doc_countnumber기준 시간 동안 aggregate 된 결과의 합
    aggregated_result.sum_other_doc_countnumberaggregate 결과가 지정한 max_size 값보다 클 때, 결과에 출력되지 않은 모든 값의 합
    aggregated_result.buckets[]arrayaggreagte 결과의 key 별 그룹핑
    aggregated_result.buckets[].keystring해당 시간 동안 query에 사용된 field의 값
    aggregated_result.buckets[].doc_countstring해당 시간 동안 query에 사용된 key의 횟수

    응답 Status

    Http StatusDesc
    200OK
    400Bad Request
    401Unauthorized
    403Forbidden
    404Not Found
    500Internal Server Error

    예시

    예시1 : field_value 가 없는 경우

    요청

    POST https://cloudsearch.apigw.gov-ntruss.com/CloudSearch/real/v1/domain/car_dev/analysis/timeseries
    
    {
      "from": "2019-09-25T05:00:00Z",
      "to": "2019-09-25T15:00:00Z",
      "field": "word",
      "max_size": 5,
      "interval": 1
    }
    

    응답 예시

    [
      {
        "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
            }
          ]
        }
      }
    ]
    

    예시2 : field_value 가 있는 경우

    요청

    POST https://cloudsearch.apigw.gov-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.gov-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",
      "max_size": 10,
      "interval": 1
    }
    

    응답 예시

    [
      {
        "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
            }
          ]
        }
      }
    ]
    

    이 문서가 도움이 되었습니까?

    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.