lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xavier Lembo <...@spotk.net>
Subject tried to access field org.apache.lucene.analysis.Token.termText from class org.apache.lucene.analysis.StopFilter
Date Mon, 20 Jun 2005 08:18:15 GMT
Hi list,

i'm facing an exception that i don't understand when trying to index a
source with the StandardAlayzer

everything works fine when i use my french AnalyserFr() , but exception
is raised when using the StandardAnalyzer

Can somebody help me find the cause of this error because i really have
no idea where to search to solve this problem?

Thanks

Xavier


------------------------------------------------------------
here is the exception:

java.lang.IllegalAccessError: tried to access field
org.apache.lucene.analysis.Token.termText from class
org.apache.lucene.analysis.StopFilter
at org.apache.lucene.analysis.StopFilter.next(StopFilter.java:99)
at
org.apache.lucene.index.DocumentWriter.invertDocument(DocumentWriter.java:155)
at
org.apache.lucene.index.DocumentWriter.addDocument(DocumentWriter.java:84)
at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:410)
at org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:396)
at org.elix.indexer.VeilleIndexer.newIndexVeille(Unknown Source)

and here is the code i use to index my document:

------------------------------------------------------------
if (langage.equals("fr")){
	analyzer = new AnalyserFr();
	logger.debug("Indexation de la veille en utilisant les stemmers FR ");
   }
else {
	analyzer =	new StandardAnalyzer();
	logger.debug("Indexation de la veille en utilisant le stemmers EN
Standard ");
}

IndexWriter writer = null;
try {
	writer = new IndexWriter(indexPath, analyzer, createIndex);
				logger.info("Ajout de la veille: " + 						rs.getString("titre"));
			
//On recupere le champ content du document arrivé pour y ajouter un boost
Field content = doc.getField("sourcecontent");
content.setBoost(bcontent);
				
// on ajoute les colonnes utilisées au document lucene en detachant la
construction
//des champs afin de pouvoir leur assigner un boost

Field ftitre = Field.Text("titre",titre);
ftitre.setBoost(btitre);
Field fresume= Field.Text("resume", resume);
fresume.setBoost(bresume);
Field fdetail= Field.Text("detail", detail);
				
Field fkeywords = Field.Keyword("keywords", keywords);
fkeywords.setBoost(bkeywords);
				
doc.add(Field.Keyword("veille_id", id));
doc.add(Field.Keyword("theme_id", theme_id));
doc.add(Field.Keyword("themeLeft", Functions.padString(themeLeft, "0", 6)));
doc.add(Field.Keyword("secteur_id", secteur_id));
doc.add(Field.Keyword("secteurLeft", Functions.padString(secteurLeft,
"0", 6)));
doc.add(fkeywords);
doc.add(Field.Keyword("indexDate", new Date()));
doc.add(ftitre);
doc.add(fresume);
doc.add(fdetail);

				
//Ajout d'un champ contenant tous les textes
doc.add(Field.UnStored("allcontent", fkeywords + " " + ftitre + " " +
fresume +  " " + fdetail +  " " + content));

// On ajoute notre document a l'index
writer.addDocument(doc);
writer.optimize();
writer.close();

}  catch(Exception ee){
	throw ee;
}
finally{
	 writer.close();
}
--------------------------------------------------------------------------


---------------------------------------------------------------------
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