From 8a5a12d96152fd0787f81910f07da202da0f6297 Mon Sep 17 00:00:00 2001 From: PSeitz Date: Wed, 16 Mar 2022 02:36:30 +0100 Subject: [PATCH] add setter to json object options (#1311) --- src/schema/json_object_options.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/schema/json_object_options.rs b/src/schema/json_object_options.rs index 1bbd90889..d5829bddb 100644 --- a/src/schema/json_object_options.rs +++ b/src/schema/json_object_options.rs @@ -34,6 +34,20 @@ impl JsonObjectOptions { pub fn get_text_indexing_options(&self) -> Option<&TextFieldIndexing> { self.indexing.as_ref() } + + /// Sets the field as stored + #[must_use] + pub fn set_stored(mut self) -> Self { + self.stored = true; + self + } + + /// Sets the field as indexed, with the specific indexing options. + #[must_use] + pub fn set_indexing_options(mut self, indexing: TextFieldIndexing) -> Self { + self.indexing = Some(indexing); + self + } } impl From for JsonObjectOptions {