Python 2.7은 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Python 2.7 애플리케이션을 배포할 수 없습니다. 기존 Python 2.7 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
FacetRefinement 클래스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
FacetRefinement
클래스는 상품 속성값을 기준으로 검색 결과 범위를 좁히는 데 사용됩니다.
속성 상세검색을 사용하는 데 권장되는 방법은 토큰 문자열을 사용하는 것입니다. 각 FacetResult는 이 클래스 대신 허용되는 토큰을 갖습니다. 이 클래스의 인스턴스를 SearchOptions에 전달하면 수동 FacetRefinement를 제공할 수 있습니다.
FacetRefinement
은 모듈 google.appengine.api.search
에 정의됩니다.
생성자
FacetRefinement
클래스의 생성자는 다음과 같이 정의됩니다.
class FacetRefinement(name, value=None, facet_range=None)
FacetRefinement
클래스의 인스턴스를 생성합니다.
참고: value 또는 facet_range 중 하나만 설정해야 합니다.
인수
- name
name 속성을 설정합니다.
- value
value 속성을 설정합니다.
- facet_range
facet_range 속성을 설정합니다.
결과 값
FacetRefinement
클래스의 새 인스턴스입니다.
예외
- TypeError
유형이 잘못된 매개변수가 하나라도 있거나 알 수 없는 속성이 전달된 경우에 발생합니다.
- ValueError
값이 잘못된 매개변수가 하나라도 있는 경우에 발생합니다.
속성
FacetRefinement
클래스의 인스턴스에는 다음 속성이 있습니다.
- name
속성 상세검색의 이름입니다.
- value
속성 상세검색의 문자열 값입니다.
- range
속성 상세검색의 숫자 범위입니다.
인스턴스 메서드
FacetRefinement
클래스의 인스턴스에는 다음과 같은 메서드가 있습니다.
- ToTokenString()
이 상세검색을 HTML에서 안전하게 사용할 수 있는 토큰 문자열로 변환합니다. 이 문자열의 형식을 변경할 수 있습니다.
-
결과 값
HTML에서 안전하게 사용할 수 있는 이 속성 상세검색의 토큰 문자열입니다.
- FromTokenString()
토큰 문자열을 FacetRefinement 객체로 변환하는 정적 메서드입니다. 서로 다른 API 버전 간에 토큰 문자열을 저장하지 마세요. 키가 호환되지 않을 수 있습니다.
-
인수
- token_string
ToTokenString 메서드가 생성했거나 검색결과로 반환된 토큰 문자열입니다.
결과 값
FacetRefinement 객체입니다.
예외
- ValueError
token_string이 잘못된 경우입니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-09-04(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-09-04(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eFacetRefinement\u003c/code\u003e class is used to refine search results based on a specific facet value.\u003c/p\u003e\n"],["\u003cp\u003eWhile manual \u003ccode\u003eFacetRefinement\u003c/code\u003e is possible, using the token string from \u003ccode\u003eFacetResult\u003c/code\u003e is the recommended approach.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eFacetRefinement\u003c/code\u003e constructor accepts a name, a value, or a \u003ccode\u003efacet_range\u003c/code\u003e, but only one of the value or facet_range can be specified.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFacetRefinement\u003c/code\u003e instances have \u003ccode\u003ename\u003c/code\u003e, \u003ccode\u003evalue\u003c/code\u003e, and \u003ccode\u003erange\u003c/code\u003e properties that define the refinement.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eFacetRefinement\u003c/code\u003e objects can be converted to token strings using \u003ccode\u003eToTokenString()\u003c/code\u003e and can be created from a token string using the \u003ccode\u003eFromTokenString()\u003c/code\u003e method.\u003c/p\u003e\n"]]],[],null,["# The FacetRefinement Class\n\nClass `FacetRefinement` is used to narrow search results based on a facet value.\n\nThe recommended way to use facet refinement is to use its token string. Each FacetResult will\nhave a token that is acceptable instead of this class. To provide manual FacetRefinement, an\ninstance of this class can be passed to SearchOptions.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| python3\n|\n| /services/access). If you are updating to the App Engine Python 3 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/python-differences) to learn about your migration options for legacy bundled services.\n\n`FacetRefinement` is defined in the module `google.appengine.api.search`.\n\nConstructor\n-----------\n\nThe constructor for class `FacetRefinement` is defined as follows:\n\nclass FacetRefinement(name, value=None, facet_range=None)\n\n: Construct an instance of class `FacetRefinement`.\n\n NOTE: Either the value or the facet_range should be set but not both.\n\n:\n\n Arguments\n\n name\n\n : Sets the name property\n\n value\n\n : Sets the value property\n\n facet_range\n\n : Sets the facet_range property\n\n Result value\n\n : A new instance of class `FacetRefinement`.\n\n Exceptions\n\n TypeError\n\n : If any of the parameters have invalid types, or an unknown\n attribute is passed.\n\n ValueError\n\n : If any of the parameters have invalid values.\n\n \u003cbr /\u003e\n\n\u003cbr /\u003e\n\nProperties\n----------\n\nAn instance of class `FacetRefinement` has the following properties:\n\nname\n\n: name of the facet refinement.\n\nvalue\n\n: string value of the facet refinement.\n\nrange\n\n: numeric range of the facet refinement.\n\nInstance Methods\n----------------\n\nInstances of class `FacetRefinement` have the following methods:\n\nToTokenString()\n\n: Converts this refinement to a token string safe to be used in HTML. The format of this string may change.\n\n: Result value\n\n : A token string safe to be used in HTML for this facet refinement.\n\nFromTokenString()\n\n: This static method converts a token string to a FacetRefinement object. Do not store token strings between different versions of API as key could\n be incompatible.\n\n: Arguments\n\n token_string\n\n : A token string created by ToTokenString method or returned\n by a search result.\n\n Result value\n\n : A FacetRefinement object.\n\n Exceptions\n\n ValueError\n\n : If the token_string is invalid."]]