From dev-return-38891-archive-asf-public=cust-asf.ponee.io@ignite.apache.org Mon Sep 10 22:23:25 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 77BAC180656 for ; Mon, 10 Sep 2018 22:23:24 +0200 (CEST) Received: (qmail 5117 invoked by uid 500); 10 Sep 2018 20:23:23 -0000 Mailing-List: contact dev-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list dev@ignite.apache.org Received: (qmail 5104 invoked by uid 99); 10 Sep 2018 20:23:22 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Sep 2018 20:23:22 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 49E04C811C for ; Mon, 10 Sep 2018 20:23:22 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.244 X-Spam-Level: ** X-Spam-Status: No, score=2.244 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FROM_EXCESS_BASE64=0.105, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qreHwC2K-6ib for ; Mon, 10 Sep 2018 20:23:19 +0000 (UTC) Received: from mail-lf1-f51.google.com (mail-lf1-f51.google.com [209.85.167.51]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 036DB5F4A9 for ; Mon, 10 Sep 2018 20:23:19 +0000 (UTC) Received: by mail-lf1-f51.google.com with SMTP id i7-v6so18546600lfh.5 for ; Mon, 10 Sep 2018 13:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=yhjUXbvld1m+PDr/AWxveyLAY7/cSxeWFgFS6W+XGuY=; b=mnS4it/thN1jRtzrqiLV0sRzf2pM+YiunXbvFw1N2k4cxDOhyQZAQINnlVuONcU0L6 D96U8bGvuVFlO46QwGE9P452HZzKks+ameiuDoKSLIAJnenej/l38SfSiczNYVQV0f4G lc6t6tfLfEB4Z2QtsQvp+ApTAKbbQ7SrnSKMKt268r1P7ScN3Xi38qANUHtfT4TSGiZ/ OUPTuiV+uwT7KRFUnJO5TOn89LpLcQlQh977dficcOesVfKzzTLXCvasasETjjs6HCZv c07nqoakYs8oXjCOY89VxndDHI5bVQzpciE/IFS5eu7VBWpd7B7uZYwmh2E4K7WLJvlI q8oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=yhjUXbvld1m+PDr/AWxveyLAY7/cSxeWFgFS6W+XGuY=; b=S+D8JHd+AXkXmYSNxtLECzS/g12JUPxcpJhy0sSkLq3BKmusemvKBDJWL5QQKDiuh6 k2IGsmbGVRXDq62KZdQNq13hoG5S1tj9mJ39v1VjwUgJiOD3dqQh4wcz7hN6aopan1fM zXHtOmF/3b1wx3gKkAWxdxL15w9kzLWEIDWn1JvBxdg01L6IQ9HP1ro7tC4wtEUZFw2g 760r86vJhW7SkRmBq80I7nTmEbjhkUKcXDqvZ0DjwwgnHQ7PGDlsD7rmYnvdVipPvWf8 yv6Cng4c+WxIwbC5CiHnGCEpRV+8Yr5Xawt3r3YrKTLq6gTYHp16vg13IabQRiPkKcCo SH2w== X-Gm-Message-State: APzg51AqgLm+qMZJWUKTxIWEWffQqt13w4KG23+rPsMAKkWh6eyZWNod V9ftmrAD0rS4bzh9uZP4olJm021ixHiCY50Xh+t1lQ== X-Google-Smtp-Source: ANB0VdZJwXYCeCm0LwMq73lfPzo+Pv+SJQ0m2UwVOzD09kfvTlXYwOmGPqGxd4WhxKF5woKdAQEf5E178zu+Cy3sTMY= X-Received: by 2002:a19:17e5:: with SMTP id 98-v6mr13656677lfx.48.1536610997814; Mon, 10 Sep 2018 13:23:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?VMOibSBOZ3V54buFbiBN4bqhbmg=?= Date: Tue, 11 Sep 2018 03:23:03 +0700 Message-ID: Subject: Re: IGNITE-7482 Cursor in TextQuery fetches all data in first call to next() or hasNext() To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="000000000000aecb0b05758a2075" --000000000000aecb0b05758a2075 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, I just registered. Here is my jira account: nguyenmanhtam123@gmail.com Thank you, Tamnm On Mon, Sep 10, 2018 at 3:25 PM Alexey Goncharuk wrote: > Hi, > > Please send your jira account ID so we can add you to the contributors > list. Then you will be able to assign tickets to yourself and contribute = to > the project according to the process. > > You can get more info here: > > https://cwiki.apache.org/confluence/display/IGNITE/Development+Process > https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute > > --AG > > =D0=BF=D0=BD, 10 =D1=81=D0=B5=D0=BD=D1=82. 2018 =D0=B3. =D0=B2 9:16, T=C3= =A2m Nguy=E1=BB=85n M=E1=BA=A1nh : > > > Hi, > > I have not been assigned yet. But i really want to. > > > > On Fri, Sep 7, 2018 at 4:13 PM Ilya Kasnacheev < > ilya.kasnacheev@gmail.com> > > wrote: > > > > > Hello! > > > > > > Can you please frame it as Github pull request as per our process? Do > you > > > have ticket for that? > > > > > > Regards, > > > -- > > > Ilya Kasnacheev > > > > > > > > > =D0=BF=D1=82, 7 =D1=81=D0=B5=D0=BD=D1=82. 2018 =D0=B3. =D0=B2 5:08, T= =C3=A2m Nguy=E1=BB=85n M=E1=BA=A1nh < > nguyenmanhtam123@gmail.com > > >: > > > > > > > > > > > > > > > > > modules\indexing\src\main\java\org\apache\ignite\internal\processors\quer= y\h2\opt\GridLuceneIndex.java > > > > ```java > > > > /* > > > > * Licensed to the Apache Software Foundation (ASF) under one or mo= re > > > > * contributor license agreements. See the NOTICE file distributed > > with > > > > * this work for additional information regarding copyright > ownership. > > > > * The ASF licenses this file to You under the Apache License, > Version > > > 2.0 > > > > * (the "License"); you may not use this file except in compliance > with > > > > * the License. You may obtain a copy of the License at > > > > * > > > > * http://www.apache.org/licenses/LICENSE-2.0 > > > > * > > > > * Unless required by applicable law or agreed to in writing, > software > > > > * distributed under the License is distributed on an "AS IS" BASIS= , > > > > * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or > > > implied. > > > > * See the License for the specific language governing permissions > and > > > > * limitations under the License. > > > > */ > > > > > > > > package org.apache.ignite.internal.processors.query.h2.opt; > > > > > > > > import java.io.IOException; > > > > import java.util.Collection; > > > > import java.util.concurrent.atomic.AtomicLong; > > > > import org.apache.ignite.IgniteCheckedException; > > > > import org.apache.ignite.internal.GridKernalContext; > > > > import org.apache.ignite.internal.processors.cache.CacheObject; > > > > import > org.apache.ignite.internal.processors.cache.CacheObjectContext; > > > > import > > > > org.apache.ignite.internal.processors.cache.version.GridCacheVersio= n; > > > > import > > > > org.apache.ignite.internal.processors.query.GridQueryIndexDescripto= r; > > > > import > > > org.apache.ignite.internal.processors.query.GridQueryTypeDescriptor; > > > > import org.apache.ignite.internal.util.GridAtomicLong; > > > > import org.apache.ignite.internal.util.GridCloseableIteratorAdapter= ; > > > > import org.apache.ignite.internal.util.lang.GridCloseableIterator; > > > > import > org.apache.ignite.internal.util.offheap.unsafe.GridUnsafeMemory; > > > > import org.apache.ignite.internal.util.typedef.internal.U; > > > > import org.apache.ignite.lang.IgniteBiTuple; > > > > import org.apache.ignite.spi.indexing.IndexingQueryFilter; > > > > import org.apache.ignite.spi.indexing.IndexingQueryCacheFilter; > > > > import org.apache.lucene.analysis.standard.StandardAnalyzer; > > > > import org.apache.lucene.document.Document; > > > > import org.apache.lucene.document.Field; > > > > import org.apache.lucene.document.LongField; > > > > import org.apache.lucene.document.StoredField; > > > > import org.apache.lucene.document.StringField; > > > > import org.apache.lucene.document.TextField; > > > > import org.apache.lucene.index.DirectoryReader; > > > > import org.apache.lucene.index.IndexReader; > > > > import org.apache.lucene.index.IndexWriter; > > > > import org.apache.lucene.index.IndexWriterConfig; > > > > import org.apache.lucene.index.Term; > > > > import org.apache.lucene.queryparser.classic.MultiFieldQueryParser; > > > > import org.apache.lucene.search.BooleanClause; > > > > import org.apache.lucene.search.BooleanQuery; > > > > import org.apache.lucene.search.IndexSearcher; > > > > import org.apache.lucene.search.NumericRangeQuery; > > > > import org.apache.lucene.search.Query; > > > > import org.apache.lucene.search.ScoreDoc; > > > > import org.apache.lucene.search.TopDocs; > > > > import org.apache.lucene.util.BytesRef; > > > > import org.h2.util.JdbcUtils; > > > > import org.jetbrains.annotations.Nullable; > > > > > > > > import static > > > > > org.apache.ignite.internal.processors.query.QueryUtils.KEY_FIELD_NAME; > > > > import static > > > > > org.apache.ignite.internal.processors.query.QueryUtils.VAL_FIELD_NAME; > > > > > > > > /** > > > > * Lucene fulltext index. > > > > */ > > > > public class GridLuceneIndex implements AutoCloseable { > > > > /** Field name for string representation of value. */ > > > > public static final String VAL_STR_FIELD_NAME =3D "_gg_val_str_= _"; > > > > > > > > /** Field name for value version. */ > > > > public static final String VER_FIELD_NAME =3D "_gg_ver__"; > > > > > > > > /** Field name for value expiration time. */ > > > > public static final String EXPIRATION_TIME_FIELD_NAME =3D > > > > "_gg_expires__"; > > > > > > > > /** */ > > > > private final String cacheName; > > > > > > > > /** */ > > > > private final GridQueryTypeDescriptor type; > > > > > > > > /** */ > > > > private final IndexWriter writer; > > > > > > > > /** */ > > > > private final String[] idxdFields; > > > > > > > > /** */ > > > > private final AtomicLong updateCntr =3D new GridAtomicLong(); > > > > > > > > /** */ > > > > private final GridLuceneDirectory dir; > > > > > > > > /** */ > > > > private final GridKernalContext ctx; > > > > > > > > /** > > > > * Constructor. > > > > * > > > > * @param ctx Kernal context. > > > > * @param cacheName Cache name. > > > > * @param type Type descriptor. > > > > * @throws IgniteCheckedException If failed. > > > > */ > > > > public GridLuceneIndex(GridKernalContext ctx, @Nullable String > > > > cacheName, GridQueryTypeDescriptor type) > > > > throws IgniteCheckedException { > > > > this.ctx =3D ctx; > > > > this.cacheName =3D cacheName; > > > > this.type =3D type; > > > > > > > > dir =3D new GridLuceneDirectory(new GridUnsafeMemory(0)); > > > > > > > > try { > > > > writer =3D new IndexWriter(dir, new IndexWriterConfig(n= ew > > > > StandardAnalyzer())); > > > > } > > > > catch (IOException e) { > > > > throw new IgniteCheckedException(e); > > > > } > > > > > > > > GridQueryIndexDescriptor idx =3D type.textIndex(); > > > > > > > > if (idx !=3D null) { > > > > Collection fields =3D idx.fields(); > > > > > > > > idxdFields =3D new String[fields.size() + 1]; > > > > > > > > fields.toArray(idxdFields); > > > > } > > > > else { > > > > assert type.valueTextIndex() || type.valueClass() =3D= =3D > > > > String.class; > > > > > > > > idxdFields =3D new String[1]; > > > > } > > > > > > > > idxdFields[idxdFields.length - 1] =3D VAL_STR_FIELD_NAME; > > > > } > > > > > > > > /** > > > > * @return Cache object context. > > > > */ > > > > private CacheObjectContext objectContext() { > > > > if (ctx =3D=3D null) > > > > return null; > > > > > > > > return > > > > ctx.cache().internalCache(cacheName).context().cacheObjectContext()= ; > > > > } > > > > > > > > /** > > > > * Stores given data in this fulltext index. > > > > * > > > > * @param k Key. > > > > * @param v Value. > > > > * @param ver Version. > > > > * @param expires Expiration time. > > > > * @throws IgniteCheckedException If failed. > > > > */ > > > > @SuppressWarnings("ConstantConditions") > > > > public void store(CacheObject k, CacheObject v, GridCacheVersio= n > > ver, > > > > long expires) throws IgniteCheckedException { > > > > CacheObjectContext coctx =3D objectContext(); > > > > > > > > Object key =3D k.isPlatformType() ? k.value(coctx, false) := k; > > > > Object val =3D v.isPlatformType() ? v.value(coctx, false) := v; > > > > > > > > Document doc =3D new Document(); > > > > > > > > boolean stringsFound =3D false; > > > > > > > > if (type.valueTextIndex() || type.valueClass() =3D=3D > > String.class) { > > > > doc.add(new TextField(VAL_STR_FIELD_NAME, val.toString(= ), > > > > Field.Store.YES)); > > > > > > > > stringsFound =3D true; > > > > } > > > > > > > > for (int i =3D 0, last =3D idxdFields.length - 1; i < last;= i++) > { > > > > Object fieldVal =3D type.value(idxdFields[i], key, val)= ; > > > > > > > > if (fieldVal !=3D null) { > > > > doc.add(new TextField(idxdFields[i], > > fieldVal.toString(), > > > > Field.Store.YES)); > > > > > > > > stringsFound =3D true; > > > > } > > > > } > > > > > > > > BytesRef keyByteRef =3D new BytesRef(k.valueBytes(coctx)); > > > > > > > > try { > > > > final Term term =3D new Term(KEY_FIELD_NAME, keyByteRef= ); > > > > > > > > if (!stringsFound) { > > > > writer.deleteDocuments(term); > > > > > > > > return; // We did not find any strings to be indexe= d, > > > will > > > > not store data at all. > > > > } > > > > > > > > doc.add(new StringField(KEY_FIELD_NAME, keyByteRef, > > > > Field.Store.YES)); > > > > > > > > if (type.valueClass() !=3D String.class) > > > > doc.add(new StoredField(VAL_FIELD_NAME, > > > > v.valueBytes(coctx))); > > > > > > > > doc.add(new StoredField(VER_FIELD_NAME, > > > > ver.toString().getBytes())); > > > > > > > > doc.add(new LongField(EXPIRATION_TIME_FIELD_NAME, > expires, > > > > Field.Store.YES)); > > > > > > > > // Next implies remove than add atomically operation. > > > > writer.updateDocument(term, doc); > > > > } > > > > catch (IOException e) { > > > > throw new IgniteCheckedException(e); > > > > } > > > > finally { > > > > updateCntr.incrementAndGet(); > > > > } > > > > } > > > > > > > > /** > > > > * Removes entry for given key from this index. > > > > * > > > > * @param key Key. > > > > * @throws IgniteCheckedException If failed. > > > > */ > > > > public void remove(CacheObject key) throws > IgniteCheckedException { > > > > try { > > > > writer.deleteDocuments(new Term(KEY_FIELD_NAME, > > > > new BytesRef(key.valueBytes(objectContext())))); > > > > } > > > > catch (IOException e) { > > > > throw new IgniteCheckedException(e); > > > > } > > > > finally { > > > > updateCntr.incrementAndGet(); > > > > } > > > > } > > > > > > > > /** > > > > * Runs lucene fulltext query over this index. > > > > * > > > > * @param qry Query. > > > > * @param filters Filters over result. > > > > * @param pageSize Size of batch > > > > * @return Query result. > > > > * @throws IgniteCheckedException If failed. > > > > */ > > > > public GridCloseableIterator> > > query(String > > > > qry, IndexingQueryFilter filters, int pageSize) throws > > > > IgniteCheckedException { > > > > IndexReader reader; > > > > > > > > try { > > > > long updates =3D updateCntr.get(); > > > > > > > > if (updates !=3D 0) { > > > > writer.commit(); > > > > > > > > updateCntr.addAndGet(-updates); > > > > } > > > > > > > > //We can cache reader\searcher and change this to > > > > 'openIfChanged' > > > > reader =3D DirectoryReader.open(writer, true); > > > > } > > > > catch (IOException e) { > > > > throw new IgniteCheckedException(e); > > > > } > > > > > > > > IndexSearcher searcher; > > > > > > > > Query query; > > > > > > > > try { > > > > searcher =3D new IndexSearcher(reader); > > > > > > > > MultiFieldQueryParser parser =3D new > > > > MultiFieldQueryParser(idxdFields, > > > > writer.getAnalyzer()); > > > > > > > > // parser.setAllowLeadingWildcard(true); > > > > > > > > // Filter expired items. > > > > Query filter =3D > > > > NumericRangeQuery.newLongRange(EXPIRATION_TIME_FIELD_NAME, > > > > U.currentTimeMillis(), > > > > null, false, false); > > > > > > > > query =3D new BooleanQuery.Builder() > > > > .add(parser.parse(qry), BooleanClause.Occur.MUST) > > > > .add(filter, BooleanClause.Occur.FILTER) > > > > .build(); > > > > } > > > > catch (Exception e) { > > > > U.closeQuiet(reader); > > > > > > > > throw new IgniteCheckedException(e); > > > > } > > > > > > > > IndexingQueryCacheFilter fltr =3D null; > > > > > > > > if (filters !=3D null) > > > > fltr =3D filters.forCache(cacheName); > > > > > > > > return new It<>(reader, searcher, query, fltr, pageSize); > > > > } > > > > > > > > /** {@inheritDoc} */ > > > > @Override public void close() { > > > > U.closeQuiet(writer); > > > > U.close(dir, ctx.log(GridLuceneIndex.class)); > > > > } > > > > > > > > /** > > > > * Key-value iterator over fulltext search result. > > > > */ > > > > private class It extends > > > > GridCloseableIteratorAdapter> { > > > > private final int BatchPosBeforeHead =3D -1; > > > > > > > > /** */ > > > > private static final long serialVersionUID =3D 0L; > > > > > > > > /** */ > > > > private final int pageSize; > > > > > > > > /** */ > > > > private final IndexReader reader; > > > > > > > > /** */ > > > > private final Query query; > > > > > > > > /** */ > > > > private final IndexSearcher searcher; > > > > > > > > /** current batch docs*/ > > > > private ScoreDoc[] batch; > > > > > > > > /** current position in batch*/ > > > > private int batchPos =3D BatchPosBeforeHead; > > > > > > > > /** */ > > > > private final IndexingQueryCacheFilter filters; > > > > > > > > /** */ > > > > private IgniteBiTuple curr; > > > > > > > > /** */ > > > > private CacheObjectContext coctx; > > > > > > > > /** > > > > * Constructor. > > > > * > > > > * @param reader Reader. > > > > * @param searcher Searcher. > > > > * @param filters Filters over result. > > > > * @throws IgniteCheckedException if failed. > > > > */ > > > > private It(IndexReader reader, IndexSearcher searcher, Quer= y > > > query, > > > > IndexingQueryCacheFilter filters, int pageSize) > > > > throws IgniteCheckedException { > > > > this.reader =3D reader; > > > > this.searcher =3D searcher; > > > > this.filters =3D filters; > > > > this.query =3D query; > > > > this.pageSize =3D pageSize; > > > > > > > > coctx =3D objectContext(); > > > > > > > > findNext(); > > > > } > > > > > > > > /** > > > > * @param bytes Bytes. > > > > * @param ldr Class loader. > > > > * @return Object. > > > > * @throws IgniteCheckedException If failed. > > > > */ > > > > @SuppressWarnings("unchecked") > > > > private Z unmarshall(byte[] bytes, ClassLoader ldr) > throws > > > > IgniteCheckedException { > > > > if (coctx =3D=3D null) // For tests. > > > > return (Z)JdbcUtils.deserialize(bytes, null); > > > > > > > > return > > > (Z)coctx.kernalContext().cacheObjects().unmarshal(coctx, > > > > bytes, ldr); > > > > } > > > > > > > > /** > > > > * Finds next element. > > > > * > > > > * @throws IgniteCheckedException If failed. > > > > */ > > > > @SuppressWarnings("unchecked") > > > > private void findNext() throws IgniteCheckedException { > > > > curr =3D null; > > > > > > > > if(isClosed()) > > > > throw new IgniteCheckedException("Iterator already > > > > closed"); > > > > > > > > if (shouldRequestNextBatch()) { > > > > try { > > > > requestNextBatch(); > > > > } catch (IOException e) { > > > > close(); > > > > throw new IgniteCheckedException(e); > > > > } > > > > } > > > > > > > > if(batch =3D=3D null) > > > > return; > > > > > > > > while (batchPos < batch.length) { > > > > Document doc; > > > > ScoreDoc scoreDoc =3Dbatch[batchPos++]; > > > > > > > > try { > > > > doc =3D searcher.doc(scoreDoc.doc); > > > > } > > > > catch (IOException e) { > > > > throw new IgniteCheckedException(e); > > > > } > > > > > > > > ClassLoader ldr =3D null; > > > > > > > > if (ctx !=3D null && ctx.deploy().enabled()) > > > > ldr =3D > > > > > ctx.cache().internalCache(cacheName).context().deploy().globalLoader(); > > > > > > > > K k =3D > > > unmarshall(doc.getBinaryValue(KEY_FIELD_NAME).bytes, > > > > ldr); > > > > > > > > if (filters !=3D null && !filters.apply(k)) > > > > continue; > > > > > > > > V v =3D type.valueClass() =3D=3D String.class ? > > > > (V)doc.get(VAL_STR_FIELD_NAME) : > > > > > > > > this.unmarshall(doc.getBinaryValue(VAL_FIELD_NAME).bytes, ldr); > > > > > > > > assert v !=3D null; > > > > > > > > curr =3D new IgniteBiTuple<>(k, v); > > > > > > > > break; > > > > } > > > > } > > > > > > > > private boolean shouldRequestNextBatch() { > > > > if(batch =3D=3D null){ > > > > // should request for first batch > > > > return (batchPos =3D=3D BatchPosBeforeHead) ; > > > > } else { > > > > // should request when reached to the end of batch > > > > return (batchPos =3D=3D batch.length); > > > > } > > > > } > > > > > > > > private void requestNextBatch() throws IOException { > > > > TopDocs docs; > > > > > > > > if (batch =3D=3D null) { > > > > docs =3D searcher.search(query, pageSize); > > > > } else { > > > > docs =3D searcher.searchAfter(batch[batch.length - = 1], > > > query, > > > > pageSize); > > > > } > > > > > > > > if(docs.scoreDocs.length =3D=3D0) { > > > > batch =3D null; > > > > }else{ > > > > batch =3D docs.scoreDocs; > > > > } > > > > > > > > batchPos =3D 0; > > > > } > > > > > > > > /** {@inheritDoc} */ > > > > @Override protected IgniteBiTuple onNext() throws > > > > IgniteCheckedException { > > > > IgniteBiTuple res =3D curr; > > > > > > > > findNext(); > > > > > > > > return res; > > > > } > > > > > > > > /** {@inheritDoc} */ > > > > @Override protected boolean onHasNext() throws > > > > IgniteCheckedException { > > > > return curr !=3D null; > > > > } > > > > > > > > /** {@inheritDoc} */ > > > > @Override protected void onClose() throws > > IgniteCheckedException > > > { > > > > U.closeQuiet(reader); > > > > } > > > > } > > > > } > > > > ``` > > > > > > > > On Fri, Sep 7, 2018 at 9:02 AM T=C3=A2m Nguy=E1=BB=85n M=E1=BA=A1nh= < > > > nguyenmanhtam123@gmail.com > > > > > > > > > wrote: > > > > > > > > > Hi, > > > > > > > > > > I tried to implement iterator for GridLuceneInde, could you pleas= e > > help > > > > to > > > > > review ? > > > > > > > > > > -- > > > > > Thanks & Best Regards > > > > > > > > > > Tam, Nguyen Manh > > > > > > > > > > > > > > > > > > -- > > > > Thanks & Best Regards > > > > > > > > Tam, Nguyen Manh > > > > > > > > > > > > > -- > > Thanks & Best Regards > > > > Tam, Nguyen Manh > > > --=20 Thanks & Best Regards Tam, Nguyen Manh --000000000000aecb0b05758a2075--