2 Copyright (C) 2007-2008 Sebastian Trueg <trueg@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this library; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef _SOPRANO_STRIGI_INDEXER_H_
21 #define _SOPRANO_STRIGI_INDEXER_H_
23 #include <strigi/indexwriter.h>
24 #include <strigi/analysisresult.h>
25 #include <strigi/analyzerconfiguration.h>
30 class IndexFilterModel
;
38 class IndexWriter
: public Strigi::IndexWriter
41 IndexWriter( ::Soprano::Model
* );
47 * Delete the entries with the given paths from the index.
49 * @param entries the paths of the files that should be deleted
51 void deleteEntries( const std::vector
<std::string
>& entries
);
54 * Delete all indexed documents from the index.
56 void deleteAllEntries();
58 void initWriterData( const Strigi::FieldRegister
& );
59 void releaseWriterData( const Strigi::FieldRegister
& );
61 void startAnalysis( const AnalysisResult
* );
62 void addText( const AnalysisResult
*, const char* text
, int32_t length
);
63 void addValue( const AnalysisResult
*, const RegisteredField
* field
,
64 const std::string
& value
);
65 void addValue( const AnalysisResult
*, const RegisteredField
* field
,
66 const unsigned char* data
, uint32_t size
);
67 void addValue( const AnalysisResult
*, const RegisteredField
* field
,
69 void addValue( const AnalysisResult
*, const RegisteredField
* field
,
71 void addValue( const AnalysisResult
*, const RegisteredField
* field
,
73 void addTriplet( const std::string
& subject
,
74 const std::string
& predicate
, const std::string
& object
);
75 void addValue( const AnalysisResult
*, const RegisteredField
* field
,
76 const std::string
& name
, const std::string
& value
);
77 void finishAnalysis( const AnalysisResult
* );
86 uint
qHash( const std::string
& s
);