Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / nepomuk / strigibackend / sopranoindexreader.h
blob3a3cd71cd7af3fcd8e0e829a9ce2fc0cc1478874
1 /*
2 $Id: sourceheader 511311 2006-02-19 14:51:05Z trueg $
4 This file is part of the Strigi project.
5 Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of
10 the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this library; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
23 #ifndef STRIGI_SOPRANO_INDEX_READER_H
24 #define STRIGI_SOPRANO_INDEX_READER_H
26 #include <strigi/indexreader.h>
28 namespace Soprano {
29 class Model;
30 namespace Index {
31 class IndexFilterModel;
35 namespace Strigi {
37 class Query;
39 namespace Soprano {
40 class IndexReader : public Strigi::IndexReader
42 public:
43 IndexReader( ::Soprano::Model* );
44 ~IndexReader();
46 int32_t countHits( const Query& query );
47 std::vector<IndexedDocument> query( const Query&, int off, int max );
48 void getHits( const Strigi::Query& query,
49 const std::vector<std::string>& fields,
50 const std::vector<Strigi::Variant::Type>& types,
51 std::vector<std::vector<Strigi::Variant> >& result,
52 int off, int max );
54 void getChildren( const std::string& parent,
55 std::map<std::string, time_t>& children );
57 int32_t countDocuments();
58 int32_t countWords();
59 int64_t indexSize();
60 time_t mTime( const std::string& uri );
61 std::vector<std::string> fieldNames();
62 std::vector<std::pair<std::string,uint32_t> > histogram( const std::string& query,
63 const std::string& fieldname,
64 const std::string& labeltype );
65 int32_t countKeywords( const std::string& keywordprefix,
66 const std::vector<std::string>& fieldnames);
67 std::vector<std::string> keywords( const std::string& keywordmatch,
68 const std::vector<std::string>& fieldnames,
69 uint32_t max, uint32_t offset );
71 private:
72 class Private;
73 Private* d;
78 #endif