strus  0.17
storageDocumentUpdateInterface.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Patrick P. Frey
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
10 #ifndef _STRUS_STORAGE_DOCUMENT_UPDATE_INTERFACE_HPP_INCLUDED
11 #define _STRUS_STORAGE_DOCUMENT_UPDATE_INTERFACE_HPP_INCLUDED
12 #include <string>
13 #include "strus/index.hpp"
14 #include "strus/numericVariant.hpp"
15 
16 namespace strus
17 {
18 
22 {
23 public:
26 
32  virtual void addSearchIndexTerm(
33  const std::string& type_,
34  const std::string& value_,
35  const Index& position_)=0;
36 
43  virtual void addSearchIndexStructure(
44  const std::string& struct_,
45  const IndexRange& source_,
46  const IndexRange& sink_)=0;
47 
54  virtual void addForwardIndexTerm(
55  const std::string& type_,
56  const std::string& value_,
57  const Index& position_)=0;
58 
62  virtual void clearSearchIndexTerm(
63  const std::string& type_)=0;
64 
68  virtual void clearSearchIndexStructure(
69  const std::string& struct_)=0;
70 
74  virtual void clearForwardIndexTerm(
75  const std::string& type_)=0;
76 
82  virtual void setMetaData(
83  const std::string& name_,
84  const NumericVariant& value_)=0;
85 
90  virtual void setAttribute(
91  const std::string& name_,
92  const std::string& value_)=0;
93 
97  virtual void clearAttribute(
98  const std::string& name_)=0;
99 
106  virtual void setUserAccessRight(
107  const std::string& username_)=0;
108 
111  virtual void clearUserAccessRight(
112  const std::string& username_)=0;
113 
115  virtual void clearUserAccessRights()=0;
116 
118  virtual void done()=0;
119 };
120 
121 }//namespace
122 #endif
123 
124 
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
Definition: index.hpp:38
virtual void clearUserAccessRights()=0
Clear the user rights for all users.
virtual void addSearchIndexStructure(const std::string &struct_, const IndexRange &source_, const IndexRange &sink_)=0
Add a structure (relation of ordinal position ranges) in the the document for retrieval.
virtual void setUserAccessRight(const std::string &username_)=0
Allow a user to access the document.
Numeric types used for local and global indices.
virtual void addSearchIndexTerm(const std::string &type_, const std::string &value_, const Index &position_)=0
Add one occurrence of a term to the search index excluding all features of this type previously added...
virtual void addForwardIndexTerm(const std::string &type_, const std::string &value_, const Index &position_)=0
Add one occurrence of a term to the forward index excluding all features of this type previously adde...
virtual void clearForwardIndexTerm(const std::string &type_)=0
Clear all previous occurrencies of a term type in a document in the forward index.
virtual void clearUserAccessRight(const std::string &username_)=0
Disallow a user to access the document.
virtual void clearSearchIndexTerm(const std::string &type_)=0
Clear all previous occurrencies of a term type in a document in the search index. ...
virtual void done()=0
Closing the document definition.
virtual ~StorageDocumentUpdateInterface()
Destructor.
Definition: storageDocumentUpdateInterface.hpp:25
virtual void setAttribute(const std::string &name_, const std::string &value_)=0
Define an attribute (string) of the document.
virtual void setMetaData(const std::string &name_, const NumericVariant &value_)=0
Define a meta data element of the document by name.
virtual void clearAttribute(const std::string &name_)=0
Delete an attribute (string) of the document.
Object to declare the items for an update of a document in the storage.
Definition: storageDocumentUpdateInterface.hpp:21
virtual void clearSearchIndexStructure(const std::string &struct_)=0
Clear all previous occurrencies of a structure in a document in the search index. ...