lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Pieper <j-pie...@gmx.net>
Subject Re: Changes at Field.Text()
Date Thu, 05 Oct 2006 21:39:57 GMT
Oh, I didnĀ“t know if it is a -dev or -user question. So i decided for
the wrong one. Sorry.

-- Jan

> Field( String, String, Field.Store.YES, Field.Index.TOKENIZED ) is the
> equivalent of the old Field.Text( String, String ) which was deprecated
> in 1.9 and removed in 2.0.
>
> This is really a java-user question.
>
> -----Original Message-----
> From: Jan Pieper [mailto:j-pieper@gmx.net] 
> Sent: Thursday, October 05, 2006 1:34 PM
> To: java-dev@lucene.apache.org
> Subject: Changes at Field.Text()
>
> I am new to Java and Lucene and I bought a book about Java Lucene and 
> there is
> an example which does not function because Field.Text(String, String) is
> deprecated now. What I have to do now?
>
> Here is the code:
> ------------------------------------------------------------------------
> --------
> import org.apache.lucene.*;
> import org.apache.lucene.analysis.*;
> import org.apache.lucene.document.*;
> import org.apache.lucene.index.*;
> import org.apache.lucene.analysis.standard.*;
>
> class CreateIndex
> {
>     public static void main(String[] args) throws Exception
>     {
>          String[] text = {
>              "This is only a small test",
>              "This is another small test"
>          };
>
>          String indexDir = "index/test";
>          Analyzer analyser = new StandardAnalyzer();
>          boolean create = true;
>          IndexWriter writer = new IndexWriter(indexDir, analyser,
> create);
>
>          for(int i=0; i<text.length; i++)
>          {
>              Document document = new Document();
>              document.add(Field.Text("textfield", text[i]));
>              writer.addDocument(document);
>          }
>
>          writer.close();
>     }
> }
> ------------------------------------------------------------------------
> --------
>
> -- Jan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
>
>   


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


Mime
View raw message