집계 쿼리를 실행하는 데이터 저장소는 Elasticsearch 위에 구축되어 있습니다 (현재 버전 1.7.x). Elasticsearch는 실시간 검색 및 집계 기능을 제공하며, Analytics API는 그 위에 얇고 보안이 강화된 레이어를 형성해. Elasticsearch 쿼리 및 집계 언어는 예제에서 사용됩니다.
-
쿼리 JSON의 filter 필드에서 사용되는 언어는 Elasticsearch Query DSL 문서에 설명되어 있습니다.
-
쿼리 JSON의 aggregations 필드에서 사용되는 언어는 Elasticsearch Aggregations 문서에 자세히 설명되어 있어.
인덱스
다양한 유형의 데이터는 서로 다른 인덱스에 존재합니다. 예를 들어, job 데이터는 jobPart 인덱스에 존재하고, costs 데이터는 costs 인덱스에 존재합니다. 필요한 데이터는 집계 API 엔드포인트 URL에서 인덱스를 지정해서 지정할 수 있어.
부모-자식 문서
작업에 대한 정보의 일부는 Elasticsearch DB의 두 개의 서로 다른 문서에 존재합니다. 이 문서들은 parent-child 관계에 있습니다. 예를 들어, 작업의 프로젝트에 대한 정보는 부모 문서에 존재하고, 작업 자체에 대한 정보는 자식 문서에 존재합니다. 필요한 정보에 따라 집계는 데이터 부모-자식 집계 이전 또는 이후에 이루어지지만, 데이터 집계 자체는 모든 쿼리에 존재해야 합니다.
공통 데이터
분석
{
"id": string,
"createdBy": <User>,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"innerId": number,
"name": 문자열,
"tags": string[],
"trashed": boolean,
"trashedBy": <User>,
"type": string
}
할당
{
"name": 문자열,
"linguist": <User>,
"vendor": <Vendor>
}
Submitter portal
{
"id": string,
"createdBy": <User>,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"name": 문자열,
"tags": string[],
"trashed": boolean,
"urlId": string
}
구매자
{
"id": string,
"name": string
}
클라이언트
{
"id": string,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"externalId": string,
"name": string,
"tags": string[],
"trashed": boolean,
}
비용 센터
{
"id": string,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"name": 문자열,
"tags": string[],
"trashed": boolean,
}
도메인
{
"id": string,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"name": 문자열,
"tags": string[],
"trashed": boolean
}
Job
{
"id": string,
"createdBy": <User>,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"extension": string,
"fileName": string,
"groupCount": number,
"innerId": "1",
"languagePair": 문자열,
"lastModified": 날짜,
"localePair": 문자열,
"sourceLanguage": 문자열,
"sourceLocale": 문자열,
"tags": 문자열[],
"targetLanguage": 문자열,
"targetLocale": 문자열",
"taskId": 문자열,
"trashed": boolean,
"trashedBy": <User>,
"uid": 문자열
}
JobPart
{
"id": "19",
"assignedTo": <Assignment>,
"beginIndex": number,
"buyer": <Buyer>,
"createdBy": <User>,
"dateCreated": 날짜,
"dateDue": 날짜,
"endIndex": number,
"groupCount": number,
"innerId": string,
"lastModified": 날짜,
"level": 숫자,
"상태": 문자열,
"tags": [],
"uid": 문자열,
"workflowStep": <WorkflowStep>
}
MtEngine
{
"id": string,
"deleted": boolean,
"default_: boolean,
"includeTags": boolean,
"name": 문자열,
"tags": string[],
"type": string,
}
NetRateScheme
{
"id": string,
"createdBy": <User>,
"dateCreated": Date,
"dateDeleted": Date,
"default_": boolean,
"deleted": boolean,
"externalId": string,
"name": string,
"tags": string[],
}
PriceList
{
"id": string,
"createdBy": <User>,
"currency": string,
"dateCreated": Date,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"default_": boolean,
"deleted": boolean,
"name": 문자열,
"tags": string[],
"trashed": boolean,
"unit": 문자열
}
프로젝트
{
"id": string,
"buyer": <Buyer>,
"client": <Client>,
"costCenter": <CostCenter>,
"createdBy": <User>,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateDue": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"domain": <Domain>,
"innerId": number,
"languagePairs": string[],
"localePairs": string[],
"mtEngine": <MtEngine>,
"name": string,
"note": string,
"owner": <User>,
"sourceLanguage": string,
"sourceLocale": string,
"status": string,
"subDomain": <SubDomain>,
"tags": string[],
"targetLanguages": string[],
"targetLocales": string[],
"trashed": boolean,
"trashedBy": <User>,
"uid": 문자열,
"vendor": <Vendor>
}
견적
{
"id": ID,
"createdBy: <사용자>,
"currency": 문자열,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"innerId": string,
"name": 문자열,
"상태": 문자열,
"tags": 태그[],
"trashed": boolean,
"trashedBy": <User>,
"unit": string
}
서비스
{
"id": string,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"name": 문자열,
"publicName": 문자열,
"tags": string[],
"trashed": boolean,
"type": string
}
하위 도메인
{
"id": string,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"name": 문자열,
"tags": 태그[],
"trashed": boolean
}
사용자
{
"id": ID,
"active": 활성,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": 삭제,
"email": 이메일,
"firstName": 문자열,
"fullName": 문자열,
"innerId": number,
"jobTitle": 문자열,
"lastName": 문자열,
"locale": 로캘,
"note": 문자열,
"role": 문자열,
"tags": 태그[],
"timeZone": 문자열,
"trashed": boolean,
"userName": 사용자 이름
}
공급자
{
"id": 문자열,
"candidate": boolean,
"dateCreated": 날짜,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"deleted": boolean,
"tags": 태그[],
"token": 토큰,
"trashed": boolean
}
WorkflowStep
{
"id": 문자열,
"abbreviation": 문자열,
"dateDeleted": 날짜,
"dateTrashed": 날짜,
"name": 문자열,
"순서": 숫자,
"tags": 태그[],
"trashed": boolean
}
분석 지수
데이터 집계
"data": {
"children": {
"type": "analysisType"
}
}
상위 요소 문서
{
"automationWidget": <AutomationWidget>,
"project": <Project>,
"service": <Service>
}
하위 요소 문서
{
"analysis": <Analysis>,
"jobPart": <JobPart>,
"job": <Job>,
"netRateScheme": <NetRateScheme>,
"priority": 숫자,
"data": {
"mt": {
"match0": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match100": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match50": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match75": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match85": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match95": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
}
},
"repetitions": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"tm": {
"match0": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match100": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match101": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match50": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match75": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match85": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
},
"match95": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
}
},
"total": {
"characters": 글자,
"pages": 숫자,
"percent": 숫자,
"segments": 세그먼트,
"words": 숫자
}
}
}
API Index
데이터 집계
"data": {
"children": {
"type": "apiType"
}
}
상위 요소 문서
{
"user": <User>
}
하위 요소 문서
{
"request": {
"date": 날짜,
"host": 문자열,
"ipv4": 문자열,
"ipv6": 문자열,
"location": 문자열,
"method": 문자열
},
"response": {
"date": 날짜,
"duration": 숫자,
"상태": 숫자
},
"api": {
"action": 문자열,
"asynch": boolean,
"type": 문자열,
"ver": 문자열
"ver": string
}
}
비용 지수
데이터 집계
"data": {
"children": {
"type": "costsType"
}
}
상위 문서
{
"automationWidget": <AutomationWidget>,
"project": <Project>,
"service": <Service>
}
하위 문서
{
"analysis": <Analysis>,
"job": <Job>,
"jobPart": <JobPart>,
"netRateScheme": <NetRateScheme>,
"priceList": <PriceList>,
"quote": <Quote>,
"workflowStep": <WorkflowStep>,
"priority": 숫자,
"data": {
"mt": {
"match0": 숫자,
"match100": number,
"match50": number,
"match75": number,
"match85": number,
"match95": number
},
"반복": 숫자,
"tm": {
"일치 항목0": 숫자,
"match100": number,
"match101": number,
"match50": number,
"match75": number,
"match85": number,
"match95": number
},
"total": 숫자
}
}
작업부 지수
데이터 집계
"data": {
"children": {
"type": "jobPartType"
}
}
상위 문서
{
"automationWidget": <AutomationWidget>,
"project": <Project>,
"service": <Service>
}
하위 문서
{
"job": <Job>,
"jobPart": <JobPart>
"data": {
"counts": {
"chars": {
"total": 숫자,
"confirmed": 숫자,
"notConfirmed": number,
"잠김": 숫자,
"notLocked": number,
"confirmedAndLocked": number,
"notConfirmedAndLocked": number,
"완료": 숫자,
"notCompleted": number
},
"groups": {
"총계": 숫자
},
"segments": {
"총계": 숫자,
"확인됨": 숫자,
"notConfirmed": number,
"잠김": 숫자,
"notLocked": number,
"confirmedAndLocked": number,
"notConfirmedAndLocked": number,
"완료": 숫자,
"notCompleted": number,
"mt": {
"postEdited": number,
"관련 있음": 숫자,
"notRelevant": number
},
"qa": {
"확인됨": 숫자,
"notChecked": number
}
},
"words": {
"총계": 숫자,
"확인됨": 숫자,
"notConfirmed": 숫자,
"잠김": 숫자,
"notLocked": 숫자,
"confirmedAndLocked": 숫자,
"notConfirmedAndLocked": 숫자,
"완료": 숫자,
"notCompleted": 숫자
},
"qa": {
"경고": 숫자,
"ignoredWarnings": 숫자,
"notIgnoredWarnings": 숫자
}
}
}
-
HTTP 요청은 Postman에서 실행돼.
-
PM이나 관리자 프로필로 로그인하고, 로그인 API를 사용해서 로그인 토큰을 받아.
-
POST requests to
api/v3/analytics/jobPart?token=<your_login_token>
총 작업 수
문의
{
"aggregations": {
"data": {
"children": {
"type": "jobPartType"
}
}
}
}
응답
{
"hits": {
"total": 359
},
"aggregations": {
"data": {
"doc_count": 14417
}
}
}
aggregations 필드 아래에서 data 집계는 doc_count 필드에 표시된 14,417개의 일치하는 문서로 응답했어.
소스 단어 총 수
문의
{
"aggregations": {
"data": {
"children": {
"type": "jobPartType"
},
"aggs": {
"wordCount": {
"sum": {
"field": "data.volume.words"
}
}
}
}
}
}
응답
{
"hits": {
"total": 359
},
"aggregations": {
"data": {
"doc_count": 14417,
"wordCount": {
"value": 6893067
}
}
}
}
대상 언어별 소스 단어 총 수
문의
{
"aggregations": {
"data": {
"하위 요소": {
"type": "jobPartType"
},
"aggs": {
"byTargetLanguage": {
"terms": {
"field": "job.targetLanguage",
"size": 3
},
"aggs": {
"wordCount": {
"sum": {
"field": "data.volume.words"
}
}
}
}
}
}
}
}
응답
{
"hits": {
"total": 359
},
"aggregations": {
"data": {
"byTargetLanguage": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 10071,
"buckets": [
{
"doc_count": 1835,
"wordCount": {
"value": 702721
},
"key": "cs"
},
{
"doc_count": 1491,
"wordCount": {
"value": 2602529
},
"key": "de"
},
{
"doc_count": 1020,
"wordCount": {
"value": 92676
},
"key": "fi"
}
]
},
"doc_count": 14417
}
}
}
응답에 버킷 엔티티가 표시돼. 분석 모듈이 데이터를 특정 카테고리로 분할하도록 요청하면, 결과는 버킷 목록으로 보여. 각 버킷에는 이 버킷이 어떤 데이터를 나타내는지 정의하는 키(이 경우 대상 언어)와, 이 데이터 세트의 이 부분에만 해당하는 값(다른 집계)이 들어 있어.
프로젝트 상태로 나누어진 작업의 총 수
문의
{
"aggregations": {
"projectStatus": {
"terms": {
"field": "project.status"
},
"aggs": {
"data": {
"children": {
"type": "jobPartType"
}
}
}
}
}
}
응답
{
"hits": {
"total": 359
},
"aggregations": {
"projectStatus": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"doc_count": 326,
"data": {
"doc_count": 14318
},
"key": "NEW"
},
{
"doc_count": 31,
"data": {
"doc_count": 89
},
"key": "COMPLETED"
},
{
"doc_count": 1,
"data": {
"doc_count": 4
},
"key": "ASSIGNED"
},
{
"doc_count": 1,
"data": {
"doc_count": 6
},
"key": "DECLINED_BY_VENDOR"
}
]
}
}
}
분석 모듈은 data 집계 전에 프로젝트 상태로 데이터를 분할하도록 지시받았어.
새 프로젝트의 작업 총 개수
문의
{
"filter": {
"term": {
"project.status": "NEW"
}
},
"aggregations": {
"data": {
"children": {
"type": "jobPartType"
}
}
}
}
응답
{
"hits": {
"total": 326
},
"aggregations": {
"data": {
"doc_count": 14318
}
}
}
필터 필드는 문의에서 사용돼. 이건 다음 집계 전에 데이터를 좁혀줘.