Author: metskem
Date: Mon Jan 24 18:37:31 2011
New Revision: 1062915
URL: http://svn.apache.org/viewvc?rev=1062915&view=rev
Log:
2.8.5-svn-5
* Extended the list of lucene searchable file suffixes, we now do
".txt", ".ini", ".xml", ".html", "htm", ".mm", ".htm", ".xhtml",
".java", ".c", ".cpp",
".php", ".asm", ".sh", ".properties", ".kml", ".gpx", ".loc"
Modified:
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/search/LuceneSearchProvider.java
Modified: incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog?rev=1062915&r1=1062914&r2=1062915&view=diff
==============================================================================
--- incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog (original)
+++ incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/ChangeLog Mon Jan 24 18:37:31
2011
@@ -1,3 +1,11 @@
+2011-01-24 Harry Metske <[email protected]>
+
+ * 2.8.5-svn-5
+
+ * Extended the list of lucene searchable file suffixes, we now do
+ ".txt", ".ini", ".xml", ".html", "htm", ".mm", ".htm", ".xhtml",
".java", ".c", ".cpp",
+ ".php", ".asm", ".sh", ".properties", ".kml", ".gpx", ".loc"
+
2010-12-12 Harry Metske <[email protected]>
* 2.8.5-svn-4
Modified:
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java?rev=1062915&r1=1062914&r2=1062915&view=diff
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
(original)
+++
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/Release.java
Mon Jan 24 18:37:31 2011
@@ -77,7 +77,7 @@ public final class Release
* <p>
* If the build identifier is empty, it is not added.
*/
- public static final String BUILD = "4";
+ public static final String BUILD = "5";
/**
* This is the generic version string you should use
Modified:
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/search/LuceneSearchProvider.java
URL:
http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/search/LuceneSearchProvider.java?rev=1062915&r1=1062914&r2=1062915&view=diff
==============================================================================
---
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/search/LuceneSearchProvider.java
(original)
+++
incubator/jspwiki/branches/JSPWIKI_2_8_BRANCH/src/com/ecyrd/jspwiki/search/LuceneSearchProvider.java
Mon Jan 24 18:37:31 2011
@@ -84,6 +84,11 @@ public class LuceneSearchProvider implem
* Number of page updates before we optimize the index.
*/
public static final int LUCENE_OPTIMIZE_COUNT = 10;
+ /** These attachment file suffixes will be indexed. */
+ public static final String[] SEARCHABLE_FILE_SUFFIXES = new String[] {
".txt", ".ini", ".xml", ".html", "htm", ".mm", ".htm",
+
".xhtml", ".java", ".c", ".cpp", ".php", ".asm", ".sh",
+
".properties", ".kml", ".gpx", ".loc" };
+
protected static final String LUCENE_ID = "id";
protected static final String LUCENE_PAGE_CONTENTS = "contents";
protected static final String LUCENE_AUTHOR = "author";
@@ -320,7 +325,7 @@ public class LuceneSearchProvider implem
* @param att Attachment to get content for. Filename extension is used to
determine the type of the attachment.
* @return String representing the content of the file.
* FIXME This is a very simple implementation of some text-based
attachment, mainly used for testing.
- * This should be replaced /moved to Attachment search providers or some
other 'plugable' wat to search attachments
+ * This should be replaced /moved to Attachment search providers or some
other 'pluggable' wat to search attachments
*/
protected String getAttachmentContent( Attachment att )
{
@@ -329,10 +334,16 @@ public class LuceneSearchProvider implem
String filename = att.getFileName();
- if(filename.endsWith(".txt") ||
- filename.endsWith(".xml") ||
- filename.endsWith(".ini") ||
- filename.endsWith(".html"))
+ boolean searchSuffix = false;
+ for( String suffix : SEARCHABLE_FILE_SUFFIXES )
+ {
+ if( filename.endsWith( suffix ) )
+ {
+ searchSuffix = true;
+ }
+ }
+
+ if( searchSuffix )
{
InputStream attStream;