Keyboard shortcuts

Press ← or → to navigate between chapters

Press ? to show this help

Press Esc to hide this help

V1 JSON 객체 검색 조건

Search Objects의 query와 Aggregate Objects의 선택적 query는 SearchJsonQuery 형식을 사용합니다. type으로 조건을 구분하고 field에는 properties.{propertyApiName} 형태의 속성 참조를 사용합니다. 검색 조건은 최대 세 단계까지 중첩할 수 있습니다.

조건과 지원 속성

type의미지원 대상
lt주어진 값 미만number, string, date, timestamp
gt주어진 값 초과number, string, date, timestamp
lte주어진 값 이하number, string, date, timestamp
gte주어진 값 이상number, string, date, timestamp
eq주어진 값과 같음number, string, date, timestamp
isNullnull 여부모든 속성 유형
contains배열에 값 포함array
not하위 조건을 충족하지 않음검색 조건 하나
and모든 하위 조건 충족검색 조건 목록
or하위 조건 중 하나 이상 충족검색 조건 목록
prefix주어진 값으로 시작string
phrase주어진 값을 부분 문자열로 포함string
anyTerm입력 용어 중 하나 이상 포함string
allTerms입력 용어를 모두 포함string

문자열 속성의 eq에서 전체 용어 일치(full term matching)를 사용하려면 Ontology Manager에서 해당 속성의 Selectable 설정을 켜야 합니다.

필드 계약

조건추가 필드필수 여부
lt, lte, gt, gte, eq, containsfield: string, value: PropertyValue둘 다 필수
prefix, phrasefield: string, value: string둘 다 필수
allTerms, anyTermfield: string, value: string둘 다 필수
allTerms, anyTermfuzzy: boolean선택
isNullfield: string, value: boolean둘 다 필수
notvalue: SearchJsonQuery필수
and, orvalue: list<SearchJsonQuery>선택

비교값에는 PropertyValue 인코딩을 적용하며, 비교 연산에서 지원하는 속성 유형은 위 표를 따릅니다. isNull의 value가 true이면 null인 객체를, false이면 null이 아닌 객체를 선택합니다.

나이가 21과 같지 않은 객체를 검색하는 조건 예시입니다.

{
  "type": "not",
  "value": {
    "type": "eq",
    "field": "properties.age",
    "value": 21
  }
}

용어 검색

기본적으로 공백이나 다음 문장부호가 용어를 구분합니다. 단독 마침표 .는 무시합니다.

?!,:;-[](){}'"~

anyTerm과 allTerms는 용어 순서에 영향을 받지 않습니다. 용어 필터는 별도로 명시된 경우를 제외하면 용어의 일부만으로 일치하지 않습니다. 두 조건에서 fuzzy: true를 지정하면 근사 일치를 허용합니다.

{
  "type": "allTerms",
  "field": "properties.description",
  "value": "regional manager",
  "fuzzy": true
}

검색 결과 정렬

Search Objects 본문의 선택적 orderBy는 SearchOrderBy 객체입니다. 그 안의 선택적 fields 목록에 SearchOrdering 객체를 넣습니다. 각 항목의 field 문자열은 필수이며, 선택적인 direction에는 asc 또는 desc를 지정합니다.

{
  "fields": [
    {"field": "properties.lastName", "direction": "asc"},
    {"field": "properties.age", "direction": "desc"}
  ]
}

GET 목록 API의 orderBy는 문자열이고, 이 검색 API의 orderBy는 객체입니다. 각 요청 위치에 맞는 형식을 사용합니다.