196 * |
196 * |
197 * '$quad<4.0,10,60.154023,24.887724,0.0,0.0>(pizza)' |
197 * '$quad<4.0,10,60.154023,24.887724,0.0,0.0>(pizza)' |
198 * |
198 * |
199 * The same as above, but now it looks for the term pizza in the field |
199 * The same as above, but now it looks for the term pizza in the field |
200 * specified to the query parser as a default search field. |
200 * specified to the query parser as a default search field. |
|
201 * |
|
202 * |
|
203 * 6 Prefix query |
|
204 * ------------ |
|
205 * |
|
206 * |
|
207 * |
|
208 * '$Prefix(QRY)' |
|
209 * |
|
210 * these two have the same meaning, namely, dump all documents that |
|
211 * adhere the actual criteria given by QRY. In fact, these are |
|
212 * resolved as plain, clucene queries. In other words, these for query |
|
213 * syntaxes are equivalent: |
|
214 * |
|
215 * '$Prefix(QRY)' |
|
216 * |
|
217 * The reason dump query is made special by delegating tasks to plain |
|
218 * clucene query is that clients may have easier time to construct |
|
219 * query strings. For instance, the first term might be a word the |
|
220 * user entered or '*' if she entered nothing, and depending on |
|
221 * whether there is some extra search criteria (like '_appclass:'root |
|
222 * file media jpg') can be concatenated at will. That is, the two |
|
223 * parts of a query string can be independently constructed based on |
|
224 * two unrelated variables (1: whether the user has entered anything, |
|
225 * 2: what context / extra criteria we have). |
|
226 * |
201 */ |
227 */ |
202 |
228 |
203 |
229 |
204 namespace Cpix |
230 namespace Cpix |
205 { |
231 { |
215 // from qrytype/dumpqrytype.cpp |
241 // from qrytype/dumpqrytype.cpp |
216 IQryType * CreateDumpQryType(); |
242 IQryType * CreateDumpQryType(); |
217 |
243 |
218 // from qrytype/quadqrytype.cpp |
244 // from qrytype/quadqrytype.cpp |
219 IQryType * CreateQuadQryType(); |
245 IQryType * CreateQuadQryType(); |
|
246 |
|
247 // from qrytype/prefixqrytype.cpp |
|
248 IQryType * CreatePrefixQryType(); |
220 |
249 |
221 |
250 |
222 bool StartsWith(const wchar_t * qryStr, |
251 bool StartsWith(const wchar_t * qryStr, |
223 wchar_t wc) |
252 wchar_t wc) |
224 { |
253 { |
269 { Cpix::CLUCENE_QRYTYPEID, &Cpix::CreateCLuceneQryType }, |
298 { Cpix::CLUCENE_QRYTYPEID, &Cpix::CreateCLuceneQryType }, |
270 { Cpix::DUMP_QRYTYPEID, &Cpix::CreateDumpQryType }, |
299 { Cpix::DUMP_QRYTYPEID, &Cpix::CreateDumpQryType }, |
271 { L"address", &Cpix::CreateAddressQryType }, |
300 { L"address", &Cpix::CreateAddressQryType }, |
272 { L"terms", &Cpix::CreateTermsQryType }, |
301 { L"terms", &Cpix::CreateTermsQryType }, |
273 { L"quad", &Cpix::CreateQuadQryType }, |
302 { L"quad", &Cpix::CreateQuadQryType }, |
|
303 { L"prefix", &Cpix::CreatePrefixQryType }, |
274 |
304 |
275 // TODO more search plugins here |
305 // TODO more search plugins here |
276 |
306 |
277 { NULL, NULL } |
307 { NULL, NULL } |
278 }; |
308 }; |