|
a/src/query/recollq.cpp |
|
b/src/query/recollq.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: recollq.cpp,v 1.18 2008-09-29 08:59:20 dockes Exp $ (C) 2006 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: recollq.cpp,v 1.19 2008-09-29 11:33:55 dockes Exp $ (C) 2006 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
219 |
|
219 |
|
220 |
if (!sd) {
|
220 |
if (!sd) {
|
221 |
cerr << "Query string interpretation failed: " << reason << endl;
|
221 |
cerr << "Query string interpretation failed: " << reason << endl;
|
222 |
return 1;
|
222 |
return 1;
|
223 |
}
|
223 |
}
|
|
|
224 |
sd->setStemlang("english");
|
224 |
|
225 |
|
225 |
RefCntr<Rcl::SearchData> rq(sd);
|
226 |
RefCntr<Rcl::SearchData> rq(sd);
|
226 |
Rcl::Query query(&rcldb);
|
227 |
Rcl::Query query(&rcldb);
|
227 |
if (op_flags & OPT_S) {
|
228 |
if (op_flags & OPT_S) {
|
228 |
query.setSortBy(sortfield, (op_flags & OPT_D) ? false : true);
|
229 |
query.setSortBy(sortfield, (op_flags & OPT_D) ? false : true);
|
229 |
}
|
230 |
}
|
230 |
query.setQuery(rq, Rcl::Query::QO_STEM);
|
231 |
query.setQuery(rq);
|
231 |
int cnt = query.getResCnt();
|
232 |
int cnt = query.getResCnt();
|
232 |
if (!(op_flags & OPT_b)) {
|
233 |
if (!(op_flags & OPT_b)) {
|
233 |
cout << "Recoll query: " << rq->getDescription() << endl;
|
234 |
cout << "Recoll query: " << rq->getDescription() << endl;
|
234 |
if (cnt <= limit)
|
235 |
if (cnt <= limit)
|
235 |
cout << cnt << " results" << endl;
|
236 |
cout << cnt << " results" << endl;
|