10 #ifndef _STRUS_ANALYZER_DOCUMENT_HPP_INCLUDED
11 #define _STRUS_ANALYZER_DOCUMENT_HPP_INCLUDED
12 #include "strus/numericVariant.hpp"
31 #if __cplusplus >= 201103L
38 :m_subdoctypename(o.m_subdoctypename)
39 ,m_metadata(o.m_metadata)
40 ,m_attributes(o.m_attributes)
41 ,m_searchIndexTerms(o.m_searchIndexTerms)
42 ,m_forwardIndexTerms(o.m_forwardIndexTerms){}
48 const std::vector<DocumentAttribute>&
attributes()
const {
return m_attributes;}
50 const std::vector<DocumentMetaData>&
metadata()
const {
return m_metadata;}
70 void setMetaData(
const std::string& t,
const NumericVariant& v)
88 m_searchIndexTerms.insert( m_searchIndexTerms.end(), terms.begin(), terms.end());
104 m_forwardIndexTerms.insert( m_forwardIndexTerms.end(), terms.begin(), terms.end());
110 m_subdoctypename.clear();
112 m_attributes.clear();
113 m_searchIndexTerms.clear();
114 m_forwardIndexTerms.clear();
120 m_subdoctypename.swap(o.m_subdoctypename);
121 m_metadata.swap(o.m_metadata);
122 m_attributes.swap(o.m_attributes);
123 m_searchIndexTerms.swap(o.m_searchIndexTerms);
124 m_forwardIndexTerms.swap(o.m_forwardIndexTerms);
128 std::string m_subdoctypename;
129 std::vector<DocumentMetaData> m_metadata;
130 std::vector<DocumentAttribute> m_attributes;
131 std::vector<DocumentTerm> m_searchIndexTerms;
132 std::vector<DocumentTerm> m_forwardIndexTerms;
const std::vector< DocumentTerm > & forwardIndexTerms() const
Get the list of the forward index terms defined in this document.
Definition: document.hpp:54
void swap(Document &o)
Swap a document structure with another.
Definition: document.hpp:118
void addForwardIndexTerm(const std::string &t, const std::string &v, unsigned int p)
Define a forward index term of the document.
Definition: document.hpp:95
void clear()
Clear the document content.
Definition: document.hpp:108
const std::vector< DocumentTerm > & searchIndexTerms() const
Get the list of the search index terms defined in this document.
Definition: document.hpp:52
const std::string & subDocumentTypeName() const
Get the sub document type name.
Definition: document.hpp:46
Document(const Document &o)
Copy constructor.
Definition: document.hpp:37
void addForwardIndexTerms(const std::vector< DocumentTerm > &terms)
Define a list of forward index terms of the document.
Definition: document.hpp:102
void addSearchIndexTerms(const std::vector< DocumentTerm > &terms)
Define a list of search index terms of the document.
Definition: document.hpp:86
const std::vector< DocumentMetaData > & metadata() const
Get the list of the metadata defined in this document.
Definition: document.hpp:50
Structure describing a document attribute.
Definition: documentAttribute.hpp:20
Structure describing a typed document term.
const std::vector< DocumentAttribute > & attributes() const
Get the list of the attributes defined in this document.
Definition: document.hpp:48
Document()
Default constructor.
Definition: document.hpp:29
void setMetaData(const std::string &t, const NumericVariant &v)
Define a meta data element of the document.
Definition: document.hpp:70
void setSubDocumentTypeName(const std::string &n)
Set the name of the sub document type as declared in the document analyzer (empty for the main docume...
Definition: document.hpp:57
void setAttribute(const std::string &t, const std::string &v)
Define an attribute of the document.
Definition: document.hpp:62
Structure describing a typed document term.
Definition: documentTerm.hpp:21
void addSearchIndexTerm(const std::string &t, const std::string &v, unsigned int p)
Define a search index term of the document.
Definition: document.hpp:79
Structure describing a document attribute.
Structure of a document created as result of a document analysis.
Definition: document.hpp:25