You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Mark Miller <ma...@gmail.com> on 2013/04/04 04:00:31 UTC

[ANNOUNCE] Apache Lucene 4.2.1 released

April 2013, Apache Lucene™ 4.2.1 available

The Lucene PMC is pleased to announce the release of Apache Lucene 4.2.1.

Apache Lucene is a high-performance, full-featured text search engine
library written entirely in Java. It is a technology suitable for nearly
any application that requires full-text search, especially cross-platform.

This release contains numerous bug fixes, optimizations, and
improvements, some of which are highlighted below. The release
is available for immediate download at:
   http://lucene.apache.org/core/mirrors-core-latest-redir.html

See the CHANGES.txt file included with the release for a full list of
details.

Lucene 4.2.1 Release Highlights:

* Lucene 4.2.1 includes 9 bug fixes and 3 optimizations, including a
  fix for a serious bug that could result in the loss of an index.

Please read CHANGES.txt for a full list of changes.

Please report any feedback to the mailing lists
(http://lucene.apache.org/core/discussion.html)

Note: The Apache Software Foundation uses an extensive mirroring network
for distributing releases.  It is possible that the mirror you are using
may not have replicated the release yet.  If that is the case, please
try another mirror.  This also goes for Maven access.

Happy searching,
Lucene/Solr developers

Re: How to convert TermDocs and TermEnum ??

Posted by Michael McCandless <lu...@mikemccandless.com>.
Hi,

Have a look at MIGRATE.txt?

Mike McCandless

http://blog.mikemccandless.com


On Mon, May 20, 2013 at 10:54 AM, A. Lotfi <ma...@yahoo.com> wrote:
> Hi,
>
> I found some difficulties converting from old API to the newest one :
>
> import org.apache.lucene.index.TermDocs;   // does not exist
> import org.apache.lucene.index.TermEnum;  // does not exist
>
> I tried the migration doc, but could not figure it out, here my code :
>
>  private List<Short>[] loadFieldValues(IndexReader reader) throws IOException {
>
>         List<Short>[] retArray = new List[reader.maxDoc()];
>         TermEnum termEnum = reader.terms (new Term (GEO_LOC));
>         try {
>             do {
>                 Term term = termEnum.term();
>                 if (term==null || term.field() != GEO_LOC) break;
>                 TermDocs td = reader.termDocs(term);
>                 String value = term.text();
>                .......
>                ...........
>
>                 td.close();
>             } while (termEnum.next());
>
>         } finally {
>             termEnum.close();
>         }
>         return retArray;
>     }
>
> I will appreciate your help.
> thanks

How to convert TermDocs and TermEnum ??

Posted by "A. Lotfi" <ma...@yahoo.com>.
Hi,

I found some difficulties converting from old API to the newest one :

import org.apache.lucene.index.TermDocs;   // does not exist
import org.apache.lucene.index.TermEnum;  // does not exist

I tried the migration doc, but could not figure it out, here my code :

 private List<Short>[] loadFieldValues(IndexReader reader) throws IOException {
       
        List<Short>[] retArray = new List[reader.maxDoc()];
        TermEnum termEnum = reader.terms (new Term (GEO_LOC));
        try {
            do {
                Term term = termEnum.term();
                if (term==null || term.field() != GEO_LOC) break;
                TermDocs td = reader.termDocs(term);
                String value = term.text();
               .......
               ...........

                td.close();
            } while (termEnum.next());
            
        } finally {
            termEnum.close();
        }
        return retArray;
    }

I will appreciate your help.
thanks

Re: DocsEnum <--- IndexReader.?

Posted by Michael McCandless <lu...@mikemccandless.com>.
Hmm MIGRATE is supposed to cover this ... try searching in
MIGRATE.html for "How you obtain the enums has changed"?


Mike McCandless

http://blog.mikemccandless.com


On Tue, Apr 30, 2013 at 10:10 AM, A. Lotfi <ma...@yahoo.com> wrote:
>
>
>  Hi,
> I am trying  to migrate some code from version 2.9.0 to 4.2.1, I have this method :
>
>  public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
>             OpenBitSet result = new OpenBitSet(reader.maxDoc());
>             TermDocs td = reader.termDocs();   <----- This line has error
>             try {
>                 td.seek(term);
>                 int[] arr = new int[BUFFER_SIZE];
>                 int[] freq = new int[BUFFER_SIZE];
>                 for (;;) {
>                     int num = td.read(arr, freq);
>                     if (num == 0)
>                         break;
>                     for (int j = 0; j < num; j++) {
>                         result.fastSet(arr[j]);
>                     }
>                 }
>
>             } finally {
>                 td.close();
>             }
>             return result;
>         }
>
> The line that has error said :
>  The method termDocs() is undefined for the type IndexReader
>
> I found this doc about migrating :
> http://lucene.apache.org/core/4_0_0/MIGRATE.html
>
>
> But IndexReader does not have a method that return the new class  DocsEnum ( that renamed TermDocs).
> Thanks, your help is appreciated.
>
> Abdel

DocsEnum <--- IndexReader.?

Posted by "A. Lotfi" <ma...@yahoo.com>.

 Hi,
I am trying  to migrate some code from version 2.9.0 to 4.2.1, I have this method :

 public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
            OpenBitSet result = new OpenBitSet(reader.maxDoc());
            TermDocs td = reader.termDocs();   <----- This line has error
            try {
                td.seek(term);
                int[] arr = new int[BUFFER_SIZE];
                int[] freq = new int[BUFFER_SIZE];
                for (;;) {
                    int num = td.read(arr, freq);
                    if (num == 0)
                        break;
                    for (int j = 0; j < num; j++) {
                        result.fastSet(arr[j]);
                    }
                }

            } finally {
                td.close();
            }
            return result;
        }

The line that has error said :
 The method termDocs() is undefined for the type IndexReader

I found this doc about migrating :
http://lucene.apache.org/core/4_0_0/MIGRATE.html


But IndexReader does not have a method that return the new class  DocsEnum ( that renamed TermDocs).
Thanks, your help is appreciated.

Abdel

BufferedTokenStream @Deprecated

Posted by "A. Lotfi" <ma...@yahoo.com>.
Hi,

I was told to migrate an old Lucene project from version :
2.9.1 to  4.2.1

As soon as I changed the jars, I got lot of errors , one of them :
The import org.apache.solr.analysis.BufferedTokenStream cannot be resolved

for this line :
import org.apache.solr.analysis.BufferedTokenStream;


in the new API it said :

@Deprecated public abstract class BufferedTokenStream extends TokenFilter

BufferedTokenStream used to have a method called read().

Can you please help me on how to fix this problem ?
Thanks, your help is appreciated. 
Majid

The nature of promises is that they remain immune to changing circumstances.
Frank Underwood, ‘House of Cards’

How to migrate from 2.9.1 to 4.2.1 ?

Posted by "A. Lotfi" <ma...@yahoo.com>.
Hi,We an application that index and search using solr lucene, we want to migrate to the latest version.Should I start buy changing the jars ?if so, how to find out if there are other jar dependent ?thanks







where is Lucence3.6 demo located in the download ?

Posted by "A. Lotfi" <ma...@yahoo.com>.
Hi,
I am new here trying to learn Lucence, I went to this page :
http://lucene.apache.org/core/3_6_1/api/core/index.html


In the bottom of the page it said :
To demonstrate these, try something like:
> java -cp lucene.jar:lucene-demo.jar:lucene-analyzers-common.jar org.apache.lucene.demo.IndexFiles rec.food.recipes/soups 
>adding rec.food.recipes/soups/abalone-chowder 
>  [ ... ]
>> java -cp lucene.jar:lucene-demo.jar:lucene-analyzers-common.jar org.apache.lucene.demo.SearchFiles 
 
I downloaded Lucence 3.6, don't know where to do the above demo.

Thanks, your help is appreciated.
Majid