portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r479708 - in /portals/jetspeed-2/trunk: .classpath components/search/pom.xml components/search/src/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java core-build.xml pom.xml
Date Mon, 27 Nov 2006 18:07:20 GMT
Author: taylor
Date: Mon Nov 27 10:07:19 2006
New Revision: 479708

URL: http://svn.apache.org/viewvc?view=rev&rev=479708
Log:
http://issues.apache.org/jira/browse/JS2-603
Upgrade Search component to lucene 2.0.0
contribution from Evangelos Vlachogiannis
I modified the jar name to lucene-core-2.0.0.jar, as that is what the Lucene team name it
in their distribution

Modified:
    portals/jetspeed-2/trunk/.classpath
    portals/jetspeed-2/trunk/components/search/pom.xml
    portals/jetspeed-2/trunk/components/search/src/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
    portals/jetspeed-2/trunk/core-build.xml
    portals/jetspeed-2/trunk/pom.xml

Modified: portals/jetspeed-2/trunk/.classpath
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/.classpath?view=diff&rev=479708&r1=479707&r2=479708
==============================================================================
--- portals/jetspeed-2/trunk/.classpath (original)
+++ portals/jetspeed-2/trunk/.classpath Mon Nov 27 10:07:19 2006
@@ -89,7 +89,7 @@
 	<classpathentry kind="var" path="MAVEN_REPO/aopalliance/jars/aopalliance-1.0.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/jstl/jars/jstl-1.0.6.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/org.apache.pluto/jars/pluto-1.0.1.jar"/>
-	<classpathentry kind="var" path="MAVEN_REPO/lucene/jars/lucene-1.4.1.jar"/>
+	<classpathentry kind="var" path="MAVEN_REPO/lucene/jars/lucene-core-2.0.0.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/nekohtml/jars/nekohtml-0.9.3.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/oro/jars/oro-2.0.7.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/commons-codec/jars/commons-codec-1.3.jar"/>
@@ -116,5 +116,6 @@
 	<classpathentry kind="var" path="MAVEN_REPO/taglibs/jars/random-1.0.2.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/jmx/jars/jmxri-1.2.1.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/javolution/jars/javolution-4.0.2.jar"/>
+	<classpathentry kind="var" path="MAVEN_REPO/org.apache.portals.bridges/jars/portals-bridges-velocity-1.0.1-dev.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: portals/jetspeed-2/trunk/components/search/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/search/pom.xml?view=diff&rev=479708&r1=479707&r2=479708
==============================================================================
--- portals/jetspeed-2/trunk/components/search/pom.xml (original)
+++ portals/jetspeed-2/trunk/components/search/pom.xml Mon Nov 27 10:07:19 2006
@@ -55,7 +55,7 @@
         </dependency>
         <dependency>
             <groupId>lucene</groupId>
-            <artifactId>lucene</artifactId>
+            <artifactId>lucene-core</artifactId>
         </dependency>
 
     </dependencies>

Modified: portals/jetspeed-2/trunk/components/search/src/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/search/src/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java?view=diff&rev=479708&r1=479707&r2=479708
==============================================================================
--- portals/jetspeed-2/trunk/components/search/src/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/search/src/java/org/apache/jetspeed/search/lucene/SearchEngineImpl.java
Mon Nov 27 10:07:19 2006
@@ -157,36 +157,36 @@
 
             // Populate document from the parsed object
             if (parsedObject.getKey() != null)
-            {
-                doc.add(Field.Keyword(ParsedObject.FIELDNAME_KEY, parsedObject.getKey()));
+            {                
+                doc.add(new Field(ParsedObject.FIELDNAME_KEY, parsedObject.getKey(), Field.Store.YES,
Field.Index.UN_TOKENIZED));
             }
             if (parsedObject.getType() != null)
             {
-                doc.add(Field.Text(ParsedObject.FIELDNAME_TYPE, parsedObject.getType()));
+                doc.add(new Field(ParsedObject.FIELDNAME_TYPE, parsedObject.getType(), Field.Store.YES,
Field.Index.TOKENIZED));
             }
             if (parsedObject.getTitle() != null)
             {
-                doc.add(Field.Text(ParsedObject.FIELDNAME_TITLE, parsedObject.getTitle()));
+                doc.add(new Field(ParsedObject.FIELDNAME_TITLE, parsedObject.getTitle(),
Field.Store.YES, Field.Index.TOKENIZED));
             }
             if (parsedObject.getDescription() != null)
             {
-                doc.add(Field.Text(ParsedObject.FIELDNAME_DESCRIPTION, parsedObject.getDescription()));
+                doc.add(new Field(ParsedObject.FIELDNAME_DESCRIPTION, parsedObject.getDescription(),
Field.Store.YES, Field.Index.TOKENIZED));
             }
             if (parsedObject.getContent() != null)
             {
-                doc.add(Field.Text(ParsedObject.FIELDNAME_CONTENT, parsedObject.getContent()));
+                doc.add(new Field(ParsedObject.FIELDNAME_CONTENT, parsedObject.getContent(),
Field.Store.YES, Field.Index.TOKENIZED));
             }
             if (parsedObject.getLanguage() != null)
             {
-                doc.add(Field.Text(ParsedObject.FIELDNAME_LANGUAGE, parsedObject.getLanguage()));
  
+                doc.add(new Field(ParsedObject.FIELDNAME_LANGUAGE, parsedObject.getLanguage(),
Field.Store.YES, Field.Index.TOKENIZED));
             }
             if (parsedObject.getURL() != null)
             {
-                doc.add(Field.Text(ParsedObject.FIELDNAME_URL, parsedObject.getURL().toString()));
+                doc.add(new Field(ParsedObject.FIELDNAME_URL, parsedObject.getURL().toString(),
Field.Store.YES, Field.Index.TOKENIZED));
             }
             if(parsedObject.getClassName() != null)
             {
-                doc.add(Field.Text(ParsedObject.FIELDNAME_CLASSNAME, parsedObject.getClassName()));
+                doc.add(new Field(ParsedObject.FIELDNAME_CLASSNAME, parsedObject.getClassName(),
Field.Store.YES, Field.Index.TOKENIZED));
             }
             
             String[] keywordArray = parsedObject.getKeywords();
@@ -195,7 +195,7 @@
             	for(int i=0; i<keywordArray.length; ++i)
             	{
             		String keyword = keywordArray[i];
-            		doc.add(Field.Keyword(ParsedObject.FIELDNAME_KEYWORDS, keyword));
+            		doc.add(new Field(ParsedObject.FIELDNAME_KEYWORDS, keyword, Field.Store.YES,
Field.Index.UN_TOKENIZED));
             	}
             }
 
@@ -284,7 +284,7 @@
                 {
                     term = new Term(ParsedObject.FIELDNAME_KEY, parsedObject.getKey());
                     // Remove the document from search index
-                    int rc = indexReader.delete(term);
+                    int rc = indexReader.deleteDocuments(term);
                     //logger.info("Attempted to delete '" + term.toString() + "' from index,
documents deleted = " + rc);
                     //System.out.println("Attempted to delete '" + term.toString() + "' from
index, documents deleted = " + rc);
                     result = rc > 0;
@@ -403,7 +403,10 @@
         Query query= null;
         try
         {
-            query = MultiFieldQueryParser.parse(queryString, searchFields, analyzer);
+        	String s[] = new String[searchFields.length];
+        	for(int i=0;i<s.length;i++)
+        		s[i] = queryString;
+            query = MultiFieldQueryParser.parse(s, searchFields, analyzer);
 //          Query query = QueryParser.parse(searchString, ParsedObject.FIELDNAME_CONTENT,
analyzer);
         }
         catch (ParseException e)
@@ -567,11 +570,11 @@
                                 {
                                     if(type == TEXT)
                                     {
-                                        doc.add(Field.Text(key.toString(), value.toString()));
+                                        doc.add(new Field(key.toString(), value.toString(),
Field.Store.YES, Field.Index.UN_TOKENIZED));
                                     }
                                     else
                                     {
-                                        doc.add(Field.Keyword(key.toString(), value.toString()));
+                                        doc.add(new Field(key.toString(), value.toString(),
Field.Store.YES, Field.Index.UN_TOKENIZED));
                                     }
                                 }
                             }
@@ -580,11 +583,11 @@
                         {
                             if(type == TEXT)
                             {
-                                doc.add(Field.Text(key.toString(), values.toString()));
+                                doc.add(new Field(key.toString(), values.toString(), Field.Store.YES,
Field.Index.UN_TOKENIZED));
                             }
                             else
                             {
-                                doc.add(Field.Keyword(key.toString(), values.toString()));
+                                doc.add(new Field(key.toString(), values.toString(), Field.Store.YES,
Field.Index.UN_TOKENIZED));
                             }
                         }
                     }

Modified: portals/jetspeed-2/trunk/core-build.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/core-build.xml?view=diff&rev=479708&r1=479707&r2=479708
==============================================================================
--- portals/jetspeed-2/trunk/core-build.xml (original)
+++ portals/jetspeed-2/trunk/core-build.xml Mon Nov 27 10:07:19 2006
@@ -98,8 +98,9 @@
 		
 		<!-- jakarta commons and other misc. jakarta projects -->
 		<dependency>
-			<id>lucene</id>
-			<version>1.4.1</version>
+			<id>lucene-core</id>            
+            <groupId>lucene</groupId>
+			<version>2.0.0</version>
 			<properties>
 	          <war.bundle>true</war.bundle>
 	        </properties>

Modified: portals/jetspeed-2/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/pom.xml?view=diff&rev=479708&r1=479707&r2=479708
==============================================================================
--- portals/jetspeed-2/trunk/pom.xml (original)
+++ portals/jetspeed-2/trunk/pom.xml Mon Nov 27 10:07:19 2006
@@ -171,7 +171,7 @@
         <jaxen.version>1.0-FCS</jaxen.version>
         <jdom.version>1.0</jdom.version>
         <log4j.version>1.2.8</log4j.version>
-        <lucene.version>1.4.1</lucene.version>
+        <lucene.version>2.0.0</lucene.version>
         <myfaces.version>1.1.0</myfaces.version>
         <nekohtml.version>0.9.5</nekohtml.version>
         <ojb.version>1.0.3</ojb.version>
@@ -184,7 +184,7 @@
         <org.apache.portals.bridges.jsf.version>1.0</org.apache.portals.bridges.jsf.version>
         <org.apache.portals.bridges.perl.version>1.0</org.apache.portals.bridges.perl.version>
         <org.apache.portals.bridges.php.version>1.0</org.apache.portals.bridges.php.version>
-        <org.apache.portals.bridges.velocity.version>1.0</org.apache.portals.bridges.velocity.version>
+        <org.apache.portals.bridges.velocity.version>1.0.1-dev</org.apache.portals.bridges.velocity.version>
         <org.springframework.version>1.1.5</org.springframework.version>
         <oro.version>2.0.7</oro.version>
         <portlet-api.version>1.0</portlet-api.version>
@@ -575,7 +575,7 @@
             <!-- Jakarta -->
             <dependency>
                 <groupId>lucene</groupId>
-                <artifactId>lucene</artifactId>
+                <artifactId>lucene-core</artifactId>
                 <version>${lucene.version}</version>
             </dependency>
             <dependency>



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


Mime
View raw message