2
* Copyright (c) 2012 Mark Liversedge (liversedge@gmail.com)
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the Free
6
* Software Foundation; either version 2 of the License, or (at your option)
9
* This program is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc., 51
16
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26
#include "MainWindow.h"
27
#include "RideMetadata.h"
28
#include "SummaryMetrics.h"
32
#include "CLucene/index/IndexModifier.h"
34
using namespace lucene::analysis;
35
using namespace lucene::index;
36
using namespace lucene::document;
37
using namespace lucene::queryParser;
38
using namespace lucene::search;
39
using namespace lucene::store;
41
class Lucene : public QObject
46
Lucene(QObject *parent, MainWindow *main);
49
// Create/Delete Metrics
50
bool importRide(SummaryMetrics *summaryMetrics, RideFile *ride, QColor color, unsigned long, bool);
51
bool deleteRide(QString);
52
void optimise(); // for optimising the index once updated
54
QStringList &files() { return filenames; }
60
int search(QString query); // run query and return number of results found
63
void results(QStringList);
70
lucene::analysis::standard::StandardAnalyzer analyzer;
73
Hits *hits; // null when no results
74
QStringList filenames;