From: <Kp...@us...> - 2009-06-20 23:02:28
|
Revision: 15514 http://jedit.svn.sourceforge.net/jedit/?rev=15514&view=rev Author: Kpouer Date: 2009-06-20 23:02:26 +0000 (Sat, 20 Jun 2009) Log Message: ----------- added filetype to documents Modified Paths: -------------- plugins/LucenePlugin/trunk/src/gatchan/jedit/lucene/IndexImpl.java Modified: plugins/LucenePlugin/trunk/src/gatchan/jedit/lucene/IndexImpl.java =================================================================== --- plugins/LucenePlugin/trunk/src/gatchan/jedit/lucene/IndexImpl.java 2009-06-20 22:50:39 UTC (rev 15513) +++ plugins/LucenePlugin/trunk/src/gatchan/jedit/lucene/IndexImpl.java 2009-06-20 23:02:26 UTC (rev 15514) @@ -36,6 +36,7 @@ import org.gjt.sp.jedit.io.VFSFileFilter; import org.gjt.sp.jedit.io.VFSManager; import org.gjt.sp.jedit.jEdit; +import org.gjt.sp.jedit.MiscUtilities; import org.gjt.sp.util.IOUtilities; import org.gjt.sp.util.Log; @@ -211,6 +212,12 @@ Document doc = new Document(); doc.add(new Field("path", file.getPath(), Field.Store.NO, Field.Index.ANALYZED)); doc.add(new Field("_path", file.getPath(), Field.Store.YES, Field.Index.NOT_ANALYZED)); + String extension = MiscUtilities.getFileExtension(file.getPath()); + if (extension.length() != 0) + { + doc.add(new Field("filetype", extension.substring(1), Field.Store.NO, Field.Index.NOT_ANALYZED)); + } + return doc; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |