|
a/src/query/recollq.cpp |
|
b/src/query/recollq.cpp |
|
... |
|
... |
117 |
" -A : output the document abstracts\n"
|
117 |
" -A : output the document abstracts\n"
|
118 |
" -S fld : sort by field <fld>\n"
|
118 |
" -S fld : sort by field <fld>\n"
|
119 |
" -D : sort descending\n"
|
119 |
" -D : sort descending\n"
|
120 |
" -s stemlang : set stemming language to use (must exist in index...)\n"
|
120 |
" -s stemlang : set stemming language to use (must exist in index...)\n"
|
121 |
" Use -s \"\" to turn off stem expansion\n"
|
121 |
" Use -s \"\" to turn off stem expansion\n"
|
|
|
122 |
" -T <synonyms file>: use the parameter (Thesaurus) for word expansion"
|
122 |
" -i <dbdir> : additional index, several can be given\n"
|
123 |
" -i <dbdir> : additional index, several can be given\n"
|
123 |
" -e use url encoding (%xx) for urls\n"
|
124 |
" -e use url encoding (%xx) for urls\n"
|
124 |
" -F <field name list> : output exactly these fields for each result.\n"
|
125 |
" -F <field name list> : output exactly these fields for each result.\n"
|
125 |
" The field values are encoded in base64, output in one line and \n"
|
126 |
" The field values are encoded in base64, output in one line and \n"
|
126 |
" separated by one space character. This is the recommended format \n"
|
127 |
" separated by one space character. This is the recommended format \n"
|
|
... |
|
... |
146 |
#define OPT_a 0x2
|
147 |
#define OPT_a 0x2
|
147 |
#define OPT_b 0x4
|
148 |
#define OPT_b 0x4
|
148 |
#define OPT_c 0x8
|
149 |
#define OPT_c 0x8
|
149 |
#define OPT_D 0x10
|
150 |
#define OPT_D 0x10
|
150 |
#define OPT_d 0x20
|
151 |
#define OPT_d 0x20
|
151 |
#define OPT_f 0x40
|
152 |
#define OPT_e 0x40
|
152 |
#define OPT_i 0x80
|
153 |
#define OPT_F 0x80
|
153 |
#define OPT_l 0x100
|
154 |
#define OPT_f 0x100
|
154 |
#define OPT_m 0x200
|
155 |
#define OPT_i 0x200
|
155 |
#define OPT_n 0x400
|
156 |
#define OPT_l 0x400
|
156 |
#define OPT_o 0x800
|
157 |
#define OPT_m 0x800
|
157 |
#define OPT_P 0x1000
|
158 |
#define OPT_N 0x1000
|
158 |
#define OPT_Q 0x2000
|
159 |
#define OPT_n 0x2000
|
159 |
#define OPT_q 0x4000
|
160 |
#define OPT_o 0x4000
|
160 |
#define OPT_S 0x8000
|
161 |
#define OPT_P 0x8000
|
161 |
#define OPT_s 0x10000
|
162 |
#define OPT_Q 0x10000
|
|
|
163 |
#define OPT_q 0x20000
|
|
|
164 |
#define OPT_S 0x40000
|
|
|
165 |
#define OPT_s 0x80000
|
|
|
166 |
#define OPT_T 0x100000
|
162 |
#define OPT_t 0x20000
|
167 |
#define OPT_t 0x200000
|
163 |
#define OPT_e 0x40000
|
|
|
164 |
#define OPT_F 0x80000
|
|
|
165 |
#define OPT_N 0x100000
|
|
|
166 |
|
168 |
|
167 |
int recollq(RclConfig **cfp, int argc, char **argv)
|
169 |
int recollq(RclConfig **cfp, int argc, char **argv)
|
168 |
{
|
170 |
{
|
169 |
string a_config;
|
171 |
string a_config;
|
170 |
string sortfield;
|
172 |
string sortfield;
|
171 |
string stemlang("english");
|
173 |
string stemlang("english");
|
172 |
list<string> extra_dbs;
|
174 |
list<string> extra_dbs;
|
173 |
string sf;
|
175 |
string sf;
|
174 |
vector<string> fields;
|
176 |
vector<string> fields;
|
175 |
|
177 |
string syngroupsfn;
|
|
|
178 |
|
176 |
int firstres = 0;
|
179 |
int firstres = 0;
|
177 |
int maxcount = 2000;
|
180 |
int maxcount = 2000;
|
178 |
thisprog = argv[0];
|
181 |
thisprog = argv[0];
|
179 |
argc--; argv++;
|
182 |
argc--; argv++;
|
180 |
|
183 |
|
|
... |
|
... |
233 |
argc--; goto b1;
|
236 |
argc--; goto b1;
|
234 |
case 's': op_flags |= OPT_s; if (argc < 2) Usage();
|
237 |
case 's': op_flags |= OPT_s; if (argc < 2) Usage();
|
235 |
stemlang = *(++argv);
|
238 |
stemlang = *(++argv);
|
236 |
argc--; goto b1;
|
239 |
argc--; goto b1;
|
237 |
case 't': op_flags |= OPT_t; break;
|
240 |
case 't': op_flags |= OPT_t; break;
|
|
|
241 |
case 'T': op_flags |= OPT_T; if (argc < 2) Usage();
|
|
|
242 |
syngroupsfn = *(++argv);
|
|
|
243 |
argc--; goto b1;
|
238 |
default: Usage(); break;
|
244 |
default: Usage(); break;
|
239 |
}
|
245 |
}
|
240 |
b1: argc--; argv++;
|
246 |
b1: argc--; argv++;
|
241 |
}
|
247 |
}
|
242 |
endopts:
|
248 |
endopts:
|
|
... |
|
... |
265 |
cerr << "Can't add index: " << *it << endl;
|
271 |
cerr << "Can't add index: " << *it << endl;
|
266 |
exit(1);
|
272 |
exit(1);
|
267 |
}
|
273 |
}
|
268 |
}
|
274 |
}
|
269 |
}
|
275 |
}
|
270 |
|
276 |
if (!syngroupsfn.empty()) {
|
|
|
277 |
if (!rcldb.setSynGroupsFile(syngroupsfn)) {
|
|
|
278 |
cerr << "Can't use synonyms file: " << syngroupsfn << endl;
|
|
|
279 |
exit(1);
|
|
|
280 |
}
|
|
|
281 |
}
|
|
|
282 |
|
271 |
if (!rcldb.open(Rcl::Db::DbRO)) {
|
283 |
if (!rcldb.open(Rcl::Db::DbRO)) {
|
272 |
cerr << "Cant open database in " << rclconfig->getDbDir() <<
|
284 |
cerr << "Cant open database in " << rclconfig->getDbDir() <<
|
273 |
" reason: " << rcldb.getReason() << endl;
|
285 |
" reason: " << rcldb.getReason() << endl;
|
274 |
exit(1);
|
286 |
exit(1);
|
275 |
}
|
287 |
}
|