// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include #include #include #include namespace search::test { class DocBuilder; /* * Class used to make schema based on document type. */ class SchemaBuilder { const DocBuilder& _doc_builder; std::unique_ptr _schema; void add_index(vespalib::stringref field_name, std::optional interleaved_features); void add_attribute(vespalib::stringref field_name); public: SchemaBuilder(const DocBuilder& doc_builder); ~SchemaBuilder(); SchemaBuilder& add_indexes(std::vector field_names, std::optional interleaved_features = std::nullopt); SchemaBuilder& add_all_indexes(std::optional interleaved_features = std::nullopt); SchemaBuilder& add_attributes(std::vector field_names); SchemaBuilder& add_all_attributes(); search::index::Schema build(); }; }