What Is in a Record(레코드 안에 어떤 것이 있을까)
What is in a record | Algolia
Learn everything you need to know about Algolia records, including attributes, types, limits, formatting, nesting, and more.
www.algolia.com
[
{
"objectID": 42,
"title": "Breaking Bad",
"episodes": [
"Crazy Handful of Nothin'",
"Gray Matter"
],
"like_count": 978,
"avg_rating": 1.23456,
"air_date": 1356846157,
"featured": true,
"lead_role": {
"name": "Walter White",
"portrayed_by": "Bryan Cranston"
},
"_tags": ["tv series", "drugs"]
}
]
Integers and booleans are treated as strings by searchable attributes but treated as numerical values by numerical facets.정수와 부울란은 검색 가능한 속성에서는 문자열로 취급되지만 숫자 면에서는 숫자 값으로 취급된다.
Unique record identifier(고유 레코드 식별자)
The engine identifies each object with a unique objectID attribute.
You should set objectIDs yourself, based on your data. Since you use objectIDs to update and delete specific records, it’s easier if you’ve defined them yourself. If you don’t set objectIDs, Algolia generates them for you: you can check their values by browsing the index.
엔진은 각 object를 고유한 ID 속성으로 식별합니다.
당신의 데이터를 기반으로 고유 ID를 설정해야 합니다. objectIDs를 사용하여 특정 레코드를 업데이트 및 삭제하기 때문에, 사용자가 직접 정의하면 더 쉬워집니다. 객체를 설정하지 않은 경우ID, Algolia가 생성합니다. 인덱스를 검색하여 ID 값을 확인할 수 있습니다.
When you retrieve objects, objectIDs are in string format, even if you set them as integers. If you want to use integers in your application, convert objectID into integers after retrieving the objects but make sure that all your objectIDs contain integer values.
Since objectID uniquely identifies your objects:
객체를 검색할 때, objectIDs를 integers로 설정한 경우에도 ID는 string format입니다. application에서 integers를 사용하려면 object 검색 후에 objectID를 정수로 변환합니다. 그러나 모든 objectId는 integer 값을 포함해야한다는 것을 명심하십시오.
- You can search for it by declaring it as a searchableAttributes.
- You can’t highlight or snippet it. If you declare objectID in attributesToHighlight or attributesToSnippet, the engine ignores it.
- You can’t exclude it from results. If you declare objectID in unretrievableAttributes or omit it from attributesToRetrieve, the engine still returns it. For this reason, objectIDs mustn’t contain any sensitive data.
- You can use it as a facet filter, but you can’t facet it. If you declare objectID in attributesForFaceting, the engine ignores it. Faceting on a unique identifier makes little sense since every facet count would equal one.
-searchableAttributes로 선언하여 검색할 수 있습니다.
-강조하거나 잘라낼 수 없습니다. 객체를 선언하는 경우속성의 ID끝:강조 표시 또는 속성스니펫, 엔진은 그것을 무시합니다.
-당신은 그것을 결과에서 제외할 수 없습니다. 객체를 선언하는 경우ID는 unretriableAttributes로 지정하거나 특성에서 생략합니다.토레트리브, 엔진이 아직 돌려주고 있어. 이러한 이유로 객체ID는 민감한 데이터를 포함해서는 안 됩니다.
-면 필터로 사용할 수는 있지만 면 필터로는 사용할 수 없습니다. 객체를 선언하는 경우ID는 attributesForFaceting이지만 엔진은 이를 무시합니다. 모든 면의 개수가 하나이기 때문에 고유 식별자를 면으로 만드는 것은 의미가 없다.
Acceptable characters for objectIDs(objectIDs로 가능한 문자)
objectID strings can:
- Contain any character(어떤 문자를 포함해도 괜찮다.)
- Be of any length as long as it fits the size limit for your plan. (당신의 plan 크기 제한에 맞다면 어떤 길이라도 가능합니다.)
Dates(날짜)
If you want to filter or sort by date, you must format date attributes as Unix timestamps (for example, 1435735848). Since Algolia’s engine doesn’t interpret dates as ISO 8601 strings, you must convert them into numeric timestamp values, using the appropriate functions for your chosen programming language:
날짜별로 필터링하거나 정렬하려면 날짜 속성 형식을 Unix 타임스탬프로 지정해야 합니다(예: 1435735848). Algolia의 엔진은 날짜를 ISO 8601 문자열로 해석하지 않으므로 선택한 프로그래밍 언어에 적합한 함수를 사용하여 숫자 타임스탬프 값으로 변환해야 합니다.
- Android - Date()
- Go - time.Unix
- Java/Scala (java.time package) - getTime()
- JavaScript - getTime()
- Kotlin - kotlinx-datetime
- .Net - ToUnixTimeSeconds
- PHP - strtotime
- Python - datetime
- Ruby - date.to_time
- Swift - NSDate(withTimeIntervalSince1970:)
Depending on the function, the output may need further manipulation to produce an integer value in seconds.
function에 따라, output은 초단위의 정수값을 생성하기 위해 추가적인 조작이 필요할 수 있다.
Reserved attribute names(예약된 특성 이름)
Algolia’s API uses underscore prefixes to identify reserved attribute names, both in records and the search response.
알골리아의 API는 레코드 및 검색 응답 모두에서 예약된 특성 이름을 식별하기 위해 밑줄 접두사를 사용한다.
In your records
In a record, you can use attribute names like _tags or _geoloc, but they have an imposed schema. All other attribute names are schema-agnostic.
Reserved words aren’t searchable by default. If you want to search _tags or _geoloc, you must add them to your searchableAttributes.
레코드에서 _tags 또는 _geoloc과 같은 특성 이름을 사용할 수 있지만 이러한 특성에는 적용된 스키마가 있습니다. 다른 모든 특성 이름은 스키마에 구애받지 않습니다.
예약어는 기본적으로 검색할 수 없습니다. _tags 또는 _geoloc을 검색하려면 searchableAttributes에 추가해야 합니다.
In the search response(검색 응답에서)
In the search response, Algolia returns attributes such as _highlightResult, _snippetResult, _rankingInfo, or _distinctSeqID. They’re reserved Algolia attributes tied to specific features. Make sure not to use any of those in your records to avoid conflicts.
검색 응답에서 Algolia는 _highlightResult, _snippetResult, __rankingInfo 또는 _distinctSeq와 같은 특성을 반환합니다.ID. 특정 기능과 연계된 알고리아 속성입니다. 충돌을 피하기 위해 레코드에서 어떤 것도 사용하지 않도록 하십시오.