aboutsummaryrefslogtreecommitdiff
path: root/icing/schema/schema-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'icing/schema/schema-util.h')
-rw-r--r--icing/schema/schema-util.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/icing/schema/schema-util.h b/icing/schema/schema-util.h
index e707758..0adc0ae 100644
--- a/icing/schema/schema-util.h
+++ b/icing/schema/schema-util.h
@@ -157,6 +157,9 @@ class SchemaUtil {
// (property whose joinable config is not NONE), OR
// ii. Any type node in the cycle has a nested-type (direct or
// indirect) with a joinable property.
+ // 15. For DOCUMENT data types, if
+ // DocumentIndexingConfig.indexable_nested_properties_list is non-empty,
+ // DocumentIndexingConfig.index_nested_properties must be false.
//
// Returns:
// On success, a dependent map from each types to their dependent types
@@ -315,6 +318,17 @@ class SchemaUtil {
PropertyConfigProto::Cardinality::Code cardinality,
std::string_view schema_type, std::string_view property_name);
+ // Checks that the 'document_indexing_config' satisfies the following rule:
+ // 1. If indexable_nested_properties is non-empty, index_nested_properties
+ // must be set to false.
+ //
+ // Returns:
+ // INVALID_ARGUMENT if any of the rules are not followed
+ // OK on success
+ static libtextclassifier3::Status ValidateDocumentIndexingConfig(
+ const DocumentIndexingConfig& config, std::string_view schema_type,
+ std::string_view property_name);
+
// Returns if 'parent_type' is a direct or indirect parent of 'child_type'.
static bool IsParent(const SchemaUtil::InheritanceMap& inheritance_map,
std::string_view parent_type,