2 Copyright (C) 2007-2008 Sebastian Trueg <trueg@kde.org>
4 This program 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 STRIGI_SOPRANO_INDEX_READER_H
21 #define STRIGI_SOPRANO_INDEX_READER_H
23 #include <strigi/indexreader.h>
28 class IndexFilterModel
;
37 class IndexReader
: public Strigi::IndexReader
40 IndexReader( ::Soprano::Model
* );
43 int32_t countHits( const Query
& query
);
44 std::vector
<IndexedDocument
> query( const Query
&, int off
, int max
);
45 void getHits( const Strigi::Query
& query
,
46 const std::vector
<std::string
>& fields
,
47 const std::vector
<Strigi::Variant::Type
>& types
,
48 std::vector
<std::vector
<Strigi::Variant
> >& result
,
51 void getChildren( const std::string
& parent
,
52 std::map
<std::string
, time_t>& children
);
54 int32_t countDocuments();
57 time_t mTime( const std::string
& uri
);
58 std::vector
<std::string
> fieldNames();
59 std::vector
<std::pair
<std::string
,uint32_t> > histogram( const std::string
& query
,
60 const std::string
& fieldname
,
61 const std::string
& labeltype
);
62 int32_t countKeywords( const std::string
& keywordprefix
,
63 const std::vector
<std::string
>& fieldnames
);
64 std::vector
<std::string
> keywords( const std::string
& keywordmatch
,
65 const std::vector
<std::string
>& fieldnames
,
66 uint32_t max
, uint32_t offset
);