FieldExpression 클래스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
클래스 FieldExpression
을 사용하면 검색을 통해 반환된 각 결과에 대해 맞춤 설정된 콘텐츠 스니펫을 계산할 수 있습니다.
FieldExpression
은 모듈 google.appengine.api.search
에 정의됩니다.
생성자
FieldExpression
클래스의 생성자는 다음과 같이 정의됩니다.
-
class FieldExpression(name, expression)
FieldExpression
클래스의 인스턴스를 생성합니다.
예를 들면 다음과 같습니다.
FieldExpression(name='content_snippet',
expression='snippet("very important", content)')
위 함수는 각 검색결과와 함께 content-snippet
이라는 계산 필드를 반환하는 필드 표현식을 생성합니다. 검색결과에는 "very
important"
쿼리와 일치하는 content
필드의 HTML 스니펫이 포함됩니다.
인수
- name
계산 필드의 이름입니다.
- expression
평가하여 반환할 표현식입니다.
결과 값
FieldExpression
클래스의 새 인스턴스입니다.
예외
- TypeError
매개변수가 잘못된 유형이거나 알 수 없는 속성이 전달되었습니다.
- ValueError
매개변수의 값이 잘못되었습니다.
속성
FieldExpression
클래스의 인스턴스에는 다음 속성이 있습니다.
- name
계산 필드의 이름입니다.
- expression
평가하여 반환할 표현식을 포함하는 문자열입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-03-06(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-06(UTC)"],[[["`FieldExpression` enables the computation of custom content snippets for each search result."],["This API is available for first-generation runtimes and is applicable when upgrading to second-generation runtimes."],["The `FieldExpression` constructor takes a `name` for the computed field and an `expression` to define how the content is generated."],["The properties `name` and `expression` hold the name of the computed field and the string defining its expression, respectively."],["`FieldExpression` will raise a TypeError or ValueError exception if invalid types or values are passed during instantiation."]]],[]]