strus  0.17
storageDocumentInterface.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_INTERFACE_HPP_INCLUDED
11 #define _STRUS_STORAGE_DOCUMENT_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 
31  virtual void addSearchIndexTerm(
32  const std::string& type_,
33  const std::string& value_,
34  const Index& position_)=0;
35 
41  virtual void addSearchIndexStructure(
42  const std::string& struct_,
43  const IndexRange& source_,
44  const IndexRange& sink_)=0;
45 
51  virtual void addForwardIndexTerm(
52  const std::string& type_,
53  const std::string& value_,
54  const Index& position_)=0;
55 
61  virtual void setMetaData(
62  const std::string& name_,
63  const NumericVariant& value_)=0;
64 
69  virtual void setAttribute(
70  const std::string& name_,
71  const std::string& value_)=0;
72 
79  virtual void setUserAccessRight(
80  const std::string& username_)=0;
81 
83  virtual void done()=0;
84 };
85 
86 }//namespace
87 #endif
88 
89 
virtual void done()=0
Closing the document definition.
int32_t Index
Number type generally used for locally counted indices.
Definition: index.hpp:29
Definition: index.hpp:38
Numeric types used for local and global indices.
Object to declare all items for one insert/replace of a document in the storage.
Definition: storageDocumentInterface.hpp:21
virtual ~StorageDocumentInterface()
Destructor.
Definition: storageDocumentInterface.hpp:25
virtual void setUserAccessRight(const std::string &username_)=0
Allow a user to access the document.
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 for summarization of the document.
virtual void setAttribute(const std::string &name_, const std::string &value_)=0
Define a string attribute of the document.
virtual void addSearchIndexTerm(const std::string &type_, const std::string &value_, const Index &position_)=0
Add one occurrence of a term in the document for retrieval.
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 setMetaData(const std::string &name_, const NumericVariant &value_)=0
Define a meta data element of the document by name.