about analyzer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

about analyzer

nani-2
Hai,
 
In the indexfile  method from the indexer.java file from sample chapter
in lucene in action page no. 14, In this statement
doc.add(Field.Text("contents", new FileReader(f)));  // Index file
content
 Indexing the file content and added the document to the lucent index,
which is already tokenized, I want know where it is tokenized exactly,
because I want use my own analyzer to the text, where should I add my
own analyzer.
 
Thanks in advance
nani
 
 
 
Reply | Threaded
Open this post in threaded view
|

RE: about analyzer

Koji Sekiguchi-4
You can add your own analyzer either when you create an IndexWriter
instance:

IndexWriter writer = new IndexWriter( directory, YOUR-OWN-ANALYZER, true
);

or when you add a document:

writer.addDocument( doc, YOUR-OWN-ANALYZER );

regards,

Koji


> -----Original Message-----
> From: Madhu Satyanarayana Panitini
> [mailto:[hidden email]]
> Sent: Monday, September 12, 2005 11:05 PM
> To: [hidden email]
> Subject: about analyzer
>
>
> Hai,
>  
> In the indexfile  method from the indexer.java file from
> sample chapter
> in lucene in action page no. 14, In this statement
> doc.add(Field.Text("contents", new FileReader(f)));  // Index file
> content
>  Indexing the file content and added the document to the lucent index,
> which is already tokenized, I want know where it is tokenized exactly,
> because I want use my own analyzer to the text, where should I add my
> own analyzer.
>  
> Thanks in advance
> nani
>  
>  
>  
>