Query Analysis Time Series
    • PDF

    Query Analysis Time Series

    • PDF

    記事の要約

    指定した時間に使われた検索Queryを分析してfield別に計算します。

    • city1: 都市区分フィールド1 ex) ソウル特別市、京畿道、忠清北道
    • city2: 都市区分フィールド2 ex) 江南区、瑞草、九老区
    • city3: 都市区分フィールド2 ex) ヨクサン洞、ジョンジャ洞、ソチョ洞
    • country: 国家
    • word : 検索Queryを形態素解析したword
    POST https://cloudsearch.apigw.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.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",
      "maxSize": 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.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",
      "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.