equal
deleted
inserted
replaced
17 #include "clucene/document/document.h" |
17 #include "clucene/document/document.h" |
18 #include "clucene/search/sort.h" |
18 #include "clucene/search/sort.h" |
19 #include "clucene/util/voidlist.h" |
19 #include "clucene/util/voidlist.h" |
20 #include "clucene/search/explanation.h" |
20 #include "clucene/search/explanation.h" |
21 #include "clucene/search/similarity.h" |
21 #include "clucene/search/similarity.h" |
|
22 |
|
23 //#ifdef USE_HIGHLIGHTER |
|
24 #include "CLucene/highlighter/SimpleFragmenter.h" |
|
25 #include "CLucene/highlighter/SimpleHTMLFormatter.h" |
|
26 #include "CLucene/analysis/standard/StandardAnalyzer.h" |
|
27 #define LCPIX_HL_EXCERPT_FIELD L"_hlexcerpt" |
|
28 #define LCPIX_EXCERPT_FIELD L"_excerpt" |
|
29 #if defined (__SYMBIAN32__) |
|
30 #include <e32std.h> |
|
31 #endif |
|
32 //#endif |
22 |
33 |
23 CL_NS_DEF(search) |
34 CL_NS_DEF(search) |
24 |
35 |
25 //predefine classes |
36 //predefine classes |
26 class Scorer; |
37 class Scorer; |
157 |
168 |
158 HitDoc* first; // head of LRU cache |
169 HitDoc* first; // head of LRU cache |
159 HitDoc* last; // tail of LRU cache |
170 HitDoc* last; // tail of LRU cache |
160 int32_t numDocs; // number cached |
171 int32_t numDocs; // number cached |
161 int32_t maxDocs; // max to cache |
172 int32_t maxDocs; // max to cache |
162 |
173 //#ifdef USE_HIGHLIGHTER |
|
174 CL_NS2(search,highlight)::SimpleHTMLFormatter hl_formatter; |
|
175 |
|
176 CL_NS2(search,highlight)::SimpleFragmenter hl_frag; |
|
177 #if defined (__SYMBIAN32__) |
|
178 TLanguage lang; |
|
179 #endif |
|
180 //#endif |
163 public: |
181 public: |
164 Hits(Searcher* s, Query* q, Filter* f, const Sort* sort=NULL); |
182 Hits(Searcher* s, Query* q, Filter* f, const Sort* sort=NULL); |
165 ~Hits(); |
183 ~Hits(); |
166 |
184 |
167 /** Returns the total number of hits available in this set. */ |
185 /** Returns the total number of hits available in this set. */ |
189 HitDoc* getHitDoc(const size_t n); |
207 HitDoc* getHitDoc(const size_t n); |
190 |
208 |
191 void addToFront(HitDoc* hitDoc); |
209 void addToFront(HitDoc* hitDoc); |
192 |
210 |
193 void remove(const HitDoc* hitDoc); |
211 void remove(const HitDoc* hitDoc); |
|
212 |
|
213 /* Get the tokenstream for Highlighting. |
|
214 * @ text Text to be analyzed |
|
215 * @ result wchar double pointer to return highlighted text |
|
216 * @ firstline Flag for checking first line or Excerpt field. |
|
217 */ |
|
218 void getHighlightedText(CL_NS(document)::Document* document); |
194 |
219 |
195 }; |
220 }; |
196 |
221 |
197 /** The interface for search implementations. |
222 /** The interface for search implementations. |
198 * |
223 * |
275 * |
300 * |
276 * <p>Applications should usually call {@link |
301 * <p>Applications should usually call {@link |
277 * Searcher#search(Query,Filter,Sort)} instead. |
302 * Searcher#search(Query,Filter,Sort)} instead. |
278 */ |
303 */ |
279 virtual TopFieldDocs* _search(Query* query, Filter* filter, const int32_t n, const Sort* sort) = 0; |
304 virtual TopFieldDocs* _search(Query* query, Filter* filter, const int32_t n, const Sort* sort) = 0; |
|
305 |
280 }; |
306 }; |
281 |
307 |
282 |
308 |
283 |
309 |
284 /** An abstract base class for search implementations. |
310 /** An abstract base class for search implementations. |