Class CrowdingSpec (0.17.0)

CrowdingSpec(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Specification for crowding. Crowding improves the diversity of search results by limiting the number of results that share the same field value. For example, crowding on the color field with a max_count of 3 and mode DROP_CROWDED_RESULTS will return at most 3 results with the same color across all pages.

Attributes

Name Description
field str
The field to use for crowding. Documents can be crowded by a field in the Document object. Crowding field is case sensitive.
max_count int
The maximum number of documents to keep per value of the field. Once there are at least max_count previous results which contain the same value for the given field (according to the order specified in order_by), later results with the same value are "crowded away". If not specified, the default value is 1.
mode google.cloud.discoveryengine_v1.types.SearchRequest.CrowdingSpec.Mode
Mode to use for documents that are crowded away.

Classes

Mode

Mode(value)

Enum describing the mode to use for documents that are crowded away. They can be dropped or demoted to the later pages.