Python 2.7은 지원이 종료되었으며 2026년 1월 31일에
지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 Python 2.7 애플리케이션을 배포할 수 없습니다. 기존 Python 2.7 애플리케이션은
지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다.
지원되는 최신 Python 버전으로 마이그레이션하는 것이 좋습니다.
RescoringMatchScorer 클래스
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
RescoringMatchScorer
클래스를 사용하면 쿼리 일치 품질에 따라 문서를 정렬할 수 있습니다. 이 클래스는 MatchScorer와 유사하지만 일치 용어의 빈도 및 필드 유형과 같은 다른 요인에 기반하는 보다 복잡한 점수 알고리즘을 사용합니다.
이 알고리즘은 지속적으로 개선되며 시간이 지남에 따라 예고 없이 변경될 수 있습니다. 즉 이 점수 처리기를 사용하는 검색결과 또한 예고 없이 변경될 수 있습니다.
RescoringMatchScorer
를 사용하려면 다음 코드에서와 같이 SortOptions
에 추가하세요.
sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer())
점수 내림차순으로 문서가 정렬됩니다. 점수는 양수입니다.
오름차순으로 정렬하려면 다음 코드를 사용합니다.
sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer(),
expressions=[search.SortExpression(
expression='_score', direction=search.SortExpression.ASCENDING,
default_value=0.0)])
이 경우 점수는 음수입니다.
RescoringMatchScorer
은 google.appengine.api.search
모듈에 정의됩니다.
생성자
RescoringMatchScorer
클래스의 생성자는 다음과 같이 정의됩니다.
- class RescoringMatchScorer()
검색 결과에 문서 점수를 할당합니다. 문서 점수는 문서의 용어 빈도를 기준으로 하고 문서의 일부분으로 가중치를 부여하여 문서가 쿼리와 얼마나 일치하는지 나타냅니다.
결과 값
RescoringMatchScorer
클래스의 새 인스턴스입니다.
예외
- TypeError
매개변수에 잘못된 유형이 있거나 알 수 없는 속성이 전달된 경우 발생합니다.
- ValueError
매개변수에 잘못된 값이 있는 경우
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 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\u003e\u003ccode\u003eRescoringMatchScorer\u003c/code\u003e sorts documents by query match quality using a complex algorithm that considers term frequency and field type.\u003c/p\u003e\n"],["\u003cp\u003eThe scoring algorithm used by \u003ccode\u003eRescoringMatchScorer\u003c/code\u003e is subject to change, potentially impacting the order of search results.\u003c/p\u003e\n"],["\u003cp\u003eDocuments are sorted in descending order by default using \u003ccode\u003eRescoringMatchScorer\u003c/code\u003e, resulting in positive scores.\u003c/p\u003e\n"],["\u003cp\u003eTo sort in ascending order, use \u003ccode\u003eSortExpression\u003c/code\u003e with the \u003ccode\u003e_score\u003c/code\u003e expression and \u003ccode\u003eASCENDING\u003c/code\u003e direction, which results in negative scores.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRescoringMatchScorer\u003c/code\u003e is available in first-generation runtimes and can be used when upgrading to corresponding second-generation runtimes.\u003c/p\u003e\n"]]],[],null,["# class RescoringMatchScorer\n\nClass `RescoringMatchScorer` allows you to sort documents based on the quality\nof query match. It is similar to a\n[MatchScorer](/appengine/docs/legacy/standard/python/search/matchscorerclass)\nbut uses a more complex scoring algorithm based on match term frequency and other factors like field type.\nPlease be aware that this algorithm is continually refined and can change over time without notice. This means that the ordering\nof search results that use this scorer can also change without notice.\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\nTo use a `RescoringMatchScorer`, add it to the `SortOptions` as in the following code:\n\n\n```python\n sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer())\n```\n\nThis sorts the documents in descending score order. The scores will be\npositive.\n\nIf you want to sort in ascending order, then use the following code: \n\n```python\n sort_opts = search.SortOptions(match_scorer=search.RescoringMatchScorer(),\n expressions=[search.SortExpression(\n expression='_score', direction=search.SortExpression.ASCENDING,\n default_value=0.0)])\n```\n\nThe scores in this case will be negative.\n\n`RescoringMatchScorer` is defined in the `google.appengine.api.search` module.\n\nConstructor\n-----------\n\nThe constructor for class `RescoringMatchScorer` is defined as follows:\n\nclass RescoringMatchScorer()\n\n: Assigns a document score to search results representing how well they match the query, base on frequency of terms in the document and weighted by doc parts.\n\n Result value\n\n : A new instance of class `RescoringMatchScorer`.\n\n Exceptions\n\n TypeError\n\n : If any of the parameters have an invalid type, or an unknown attribute is passed.\n\n ValueError\n\n : If any parameter has an invalid value.\n\n \u003cbr /\u003e"]]