lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peyman Faratin <pey...@robustlinks.com>
Subject Re: Upgrading from 3.6.1 to 4.3.0 and Custom collector
Date Tue, 18 Jun 2013 13:04:35 GMT
Hi Adrien

thank you very much. It worked. 

have a good day

On Jun 18, 2013, at 5:35 AM, Adrien Grand <jpountz@gmail.com> wrote:

> Hi,
> 
> You didn't say specifically what your problem is so I assume it is
> with the following method:
> 
> On Tue, Jun 18, 2013 at 4:37 AM, Peyman Faratin <peymanfaratin@gmail.com> wrote:
>>                  public void setNextReader(IndexReader reader, int docBase) throws
IOException{
>>                        this.docBase = docBase;
>>                        store = FieldCache.DEFAULT.getStrings(reader,"title");
>>                  }
> 
> setNextReader now takes an AtomicReaderContext as an argument and
> FieldCache.getStrings is now FieldCache.getTerms, so this would give
> something like
> 
> private BinaryDocValues store;
> 
> public void setNextReader(AtomicReaderContext ctx) throws IOException{
>    this.docBase = ctx.docBase;
>    this.store = FieldCache.DEFAULT.getTerms(ctx.reader(), "title");
> }
> 
> public void collect(int doc) throws IOException {
>    BytesRef page = new BytesRef();
>    store.get(doc, page);
>    if (page.bytes != BinaryDocValues.MISSING) {
>        outLinks.add(page.utf8ToString());
>    }
> }
> 
> --
> Adrien
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message