1717
1818package org .apache .ignite .internal .processors .query .h2 .opt ;
1919
20- import java .io .FileInputStream ;
21- import java .io .IOException ;
22- import java .io .InputStream ;
23- import java .net .URL ;
24- import java .nio .charset .Charset ;
25- import java .nio .charset .StandardCharsets ;
26- import java .sql .SQLException ;
27- import java .util .Collection ;
28- import java .util .HashSet ;
29- import java .util .Iterator ;
30- import java .util .Map ;
31- import java .util .Set ;
32- import java .util .concurrent .atomic .AtomicLong ;
33-
3420import org .apache .ignite .IgniteCheckedException ;
3521import org .apache .ignite .cache .FullTextLucene ;
36- import org .apache .ignite .cache .FullTextQueryIndex ;
37- import org .apache .ignite .cache .LuceneConfiguration ;
3822import org .apache .ignite .cache .LuceneIndexAccess ;
39- import org .apache .ignite .cache .QueryIndex ;
40- import org .apache .ignite .cache .query .TextQuery ;
4123import org .apache .ignite .internal .GridKernalContext ;
4224import org .apache .ignite .internal .processors .cache .CacheObject ;
4325import org .apache .ignite .internal .processors .cache .CacheObjectContext ;
44- import org .apache .ignite .internal .processors .cache .query .ScoredCacheEntry ;
4526import org .apache .ignite .internal .processors .cache .GridCacheAdapter ;
27+ import org .apache .ignite .internal .processors .cache .query .ScoredCacheEntry ;
4628import org .apache .ignite .internal .processors .cache .version .GridCacheVersion ;
47- import org .apache .ignite .internal .processors .query .GridQueryIndexDescriptor ;
4829import org .apache .ignite .internal .processors .query .GridQueryTypeDescriptor ;
49- import org .apache .ignite .internal .processors .query .QueryUtils ;
50- import org .apache .ignite .internal .util .GridAtomicLong ;
30+ import org .apache .ignite .internal .processors .query .QueryIndexDescriptorImpl ;
5131import org .apache .ignite .internal .util .GridCloseableIteratorAdapter ;
5232import org .apache .ignite .internal .util .lang .GridCloseableIterator ;
53- import org .apache .ignite .internal .util .offheap .unsafe .GridUnsafeMemory ;
54- import org .apache .ignite .internal .util .typedef .X ;
5533import org .apache .ignite .internal .util .typedef .internal .U ;
5634import org .apache .ignite .lang .IgniteBiTuple ;
57- import org .apache .ignite .spi .indexing .IndexingQueryFilter ;
5835import org .apache .ignite .spi .indexing .IndexingQueryCacheFilter ;
59- import org .apache .lucene .analysis .Analyzer ;
60- import org .apache .lucene .analysis .standard .StandardAnalyzer ;
61- import org .apache .lucene .document .BinaryDocValuesField ;
62- import org .apache .lucene .document .Document ;
63- import org .apache .lucene .document .Field ;
64- import org .apache .lucene .document .FieldType ;
65- import org .apache .lucene .document .LongPoint ;
66- import org .apache .lucene .document .StoredField ;
67- import org .apache .lucene .document .StringField ;
68- import org .apache .lucene .document .TextField ;
69-
70-
36+ import org .apache .ignite .spi .indexing .IndexingQueryFilter ;
37+ import org .apache .lucene .document .*;
7138import org .apache .lucene .index .Term ;
7239import org .apache .lucene .queryparser .classic .MultiFieldQueryParser ;
7340import org .apache .lucene .queryparser .classic .QueryParser .Operator ;
74- import org .apache .lucene .search .BooleanClause ;
75- import org .apache .lucene .search .BooleanQuery ;
76- import org .apache .lucene .search .IndexSearcher ;
77- import org .apache .lucene .search .Query ;
78- import org .apache .lucene .search .ScoreDoc ;
79- import org .apache .lucene .search .Sort ;
80- import org .apache .lucene .search .SortField ;
81- import org .apache .lucene .search .TermQuery ;
82- import org .apache .lucene .search .TopDocs ;
41+ import org .apache .lucene .search .*;
8342import org .apache .lucene .util .BytesRef ;
8443import org .h2 .util .JdbcUtils ;
8544import org .jetbrains .annotations .Nullable ;
86- import org .apache .ignite .internal .processors .query .QueryIndexDescriptorImpl ;
45+
46+ import java .io .IOException ;
47+ import java .util .Map ;
8748
8849import static org .apache .ignite .internal .processors .query .QueryUtils .KEY_FIELD_NAME ;
89- import static org .apache .ignite .internal .processors .query .QueryUtils .VAL_FIELD_NAME ;
9050
9151
9252
@@ -330,12 +290,12 @@ else if(item.startsWith("author:")){
330290
331291 if (orderBy !=null ){
332292 String [] sorts = orderBy .split ("," );
333- Sort sortObj = new Sort ();
293+
334294 SortField [] sf = new SortField [sorts .length ];
335295 for (int j =0 ;j <sorts .length ;j ++){
336296 sf [j ] = new SortField (sorts [j ],SortField .Type .DOUBLE ,true );
337297 }
338- sortObj . setSort (sf );
298+ Sort sortObj = new Sort (sf );
339299 docs = searcher .search (query .build (), limit , sortObj );
340300 }
341301 else {
@@ -344,7 +304,6 @@ else if(item.startsWith("author:")){
344304 }
345305 catch (Exception e ) {
346306 //U.closeQuiet(indexAccess.reader);
347-
348307 throw new IgniteCheckedException (e );
349308 }
350309
@@ -391,7 +350,6 @@ private class It<K, V> extends GridCloseableIteratorAdapter<IgniteBiTuple<K, V>
391350 /**
392351 * Constructor.
393352 *
394- * @param reader Reader.
395353 * @param searcher Searcher.
396354 * @param docs Docs.
397355 * @param filters Filters over result.
@@ -415,7 +373,6 @@ private It(IndexSearcher searcher, ScoreDoc[] docs, IndexingQueryCacheFilter fil
415373 * @return Object.
416374 * @throws IgniteCheckedException If failed.
417375 */
418- @ SuppressWarnings ("unchecked" )
419376 private <Z > Z unmarshall (byte [] bytes , ClassLoader ldr ) throws IgniteCheckedException {
420377 if (coctx == null ) // For tests.
421378 return (Z )JdbcUtils .deserialize (bytes , null );
@@ -428,7 +385,6 @@ private <Z> Z unmarshall(byte[] bytes, ClassLoader ldr) throws IgniteCheckedExce
428385 *
429386 * @throws IgniteCheckedException If failed.
430387 */
431- @ SuppressWarnings ("unchecked" )
432388 private void findNext () throws IgniteCheckedException {
433389 curr = null ;
434390 ClassLoader ldr = null ;
@@ -445,9 +401,8 @@ private void findNext() throws IgniteCheckedException {
445401 float score ;
446402
447403 try {
448- doc = searcher .doc ( docs [idx ].doc );
404+ doc = searcher .storedFields (). document ( docs [idx ].doc );
449405 score = docs [idx ].score ;
450-
451406 idx ++;
452407 }
453408 catch (IOException e ) {
0 commit comments