Notice: Over the next few months, we're reorganizing the App Engine documentation site to make it easier to find content and better align with the rest of Google Cloud products. The same content will be available, but the navigation will now match the rest of the Cloud products.

Python 2 is no longer supported by the community. We recommend that you migrate Python 2 apps to Python 3.

The FacetOptions Class

Class FacetOptions provides options for processing facet results of a query.

Caution: **This solution is no longer recommended:** Apps that use this API can only run in the Python 2 runtime and will need to upgrade to a [recommended solution](/appengine/docs/legacy/standard/python/migrate-to-python3/migrating-services#migration_paths_for_bundled_services) before migrating to the Python 3 runtime.

FacetOptions is defined in the module.


Class FacetOptions provides options for processing facet results of a query. Options include number of facets to discover, number of values for each facet and the depth of the result to be considered for facet computation.


The constructor for class FacetOptions is defined as follows:

facet_option = FacetOptions(discovery_limit=5, discovery_value_limit=None, depth=None)

Specify options for processing facet results of a query.



Result value

A new instance of class FacetOptions.



If an unknown attribute is passed.


If any of the parameters have invalid values (e.g., a negative depth).


An instance of class FacetOptions has the following properties:


Number of facets to discover if facet discovery is turned on. If None, discover facets will be disabled.


Number of values to be discovered for each of the top discovered facets.


Number of documents in query results to evaluate to gather facet information.