lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r387575 - in /lucene/java/trunk/contrib: memory/src/java/org/apache/lucene/index/memory/ memory/src/test/org/apache/lucene/index/memory/ queries/src/java/org/apache/lucene/search/similar/ swing/src/java/org/apache/lucene/swing/models/
Date Tue, 21 Mar 2006 16:26:13 GMT
Author: yonik
Date: Tue Mar 21 08:26:10 2006
New Revision: 387575

URL: http://svn.apache.org/viewcvs?rev=387575&view=rev
Log:
more deprecation fixes

Modified:
    lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
    lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
    lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java
    lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
    lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java

Modified: lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java?rev=387575&r1=387574&r2=387575&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
(original)
+++ lucene/java/trunk/contrib/memory/src/java/org/apache/lucene/index/memory/MemoryIndex.java
Tue Mar 21 08:26:10 2006
@@ -1030,8 +1030,11 @@
 		protected void doClose() {
 			if (DEBUG) System.err.println("MemoryIndexReader.doClose");
 		}
-	
-		// lucene <= 1.4.3
+
+    
+
+
+    // lucene <= 1.4.3
 		public Collection getFieldNames() {
 			if (DEBUG) System.err.println("MemoryIndexReader.getFieldNames");
 			return getFieldNames(true);

Modified: lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java?rev=387575&r1=387574&r2=387575&view=diff
==============================================================================
--- lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
(original)
+++ lucene/java/trunk/contrib/memory/src/test/org/apache/lucene/index/memory/MemoryIndexTest.java
Tue Mar 21 08:26:10 2006
@@ -350,12 +350,7 @@
 	
 	private Document createDocument(String content) {
 		Document doc = new Document();
-		{ // lucene-1.4.3
-			doc.add(Field.UnStored(FIELD_NAME, content));
-		}
-//		{ // lucene >= 1.9
-//			doc.add(new Field(FIELD_NAME, content, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.WITH_POSITIONS));
-//		}
+		doc.add(new Field(FIELD_NAME, content, Field.Store.NO, Field.Index.TOKENIZED, Field.TermVector.WITH_POSITIONS));
 		return doc;
 	}
 	
@@ -374,8 +369,7 @@
 		IndexWriter writer = null;
 		try {
 			writer = new IndexWriter(dir, analyzer, true);
-			writer.maxFieldLength = Integer.MAX_VALUE; // ensure large files are scored correctly
-//			writer.setMaxFieldLength(Integer.MAX_VALUE);
+			writer.setMaxFieldLength(Integer.MAX_VALUE);
 			writer.addDocument(doc);
 			writer.optimize();
 			return dir;

Modified: lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java?rev=387575&r1=387574&r2=387575&view=diff
==============================================================================
--- lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java
(original)
+++ lucene/java/trunk/contrib/queries/src/java/org/apache/lucene/search/similar/SimilarityQueries.java
Tue Mar 21 08:26:10 2006
@@ -105,7 +105,7 @@
 			TermQuery tq = new TermQuery( new Term( field, word));
 			try
 			{
-				tmp.add( tq, false, false);
+				tmp.add( tq, BooleanClause.Occur.SHOULD);
 			}
 			catch( BooleanQuery.TooManyClauses too)
 			{

Modified: lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java?rev=387575&r1=387574&r2=387575&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
(original)
+++ lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/ListSearcher.java
Tue Mar 21 08:26:10 2006
@@ -121,9 +121,9 @@
                 //this will allow us to retrive the results later
                 //and map this list model's row to a row in the decorated
                 //list model
-                document.add(new Field(ROW_NUMBER, "" + row, true, true, true));
+                document.add(new Field(ROW_NUMBER, "" + row, Field.Store.YES, Field.Index.TOKENIZED));
                 //add the string representation of the row to the index
-                document.add(new Field(FIELD_NAME, String.valueOf(listModel.getElementAt(row)).toLowerCase(),
true, true, true));
+                document.add(new Field(FIELD_NAME, String.valueOf(listModel.getElementAt(row)).toLowerCase(),
Field.Store.YES, Field.Index.TOKENIZED));
                 writer.addDocument(document);
             }
             writer.optimize();
@@ -161,7 +161,8 @@
             //build a query based on the fields, searchString and cached analyzer
             //NOTE: This is an area for improvement since the MultiFieldQueryParser
             // has some weirdness.
-            Query query = MultiFieldQueryParser.parse(searchString, fields, analyzer);
+            MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, analyzer);
+            Query query =parser.parse(searchString);
             //run the search
             Hits hits = is.search(query);
             //reset this list model with the new results

Modified: lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java?rev=387575&r1=387574&r2=387575&view=diff
==============================================================================
--- lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java
(original)
+++ lucene/java/trunk/contrib/swing/src/java/org/apache/lucene/swing/models/TableSearcher.java
Tue Mar 21 08:26:10 2006
@@ -176,14 +176,14 @@
                 //this will allow us to retrive the results later
                 //and map this table model's row to a row in the decorated
                 //table model
-                document.add(new Field(ROW_NUMBER, "" + row, true, true, true));
+                document.add(new Field(ROW_NUMBER, "" + row, Field.Store.YES, Field.Index.TOKENIZED));
                 //iterate through all columns
                 //index the value keyed by the column name
                 //NOTE: there could be a problem with using column names with spaces
                 for (int column=0; column < tableModel.getColumnCount(); column++){
                     String columnName = tableModel.getColumnName(column);
                     String columnValue = String.valueOf(tableModel.getValueAt(row, column)).toLowerCase();
-                    document.add(new Field(columnName, columnValue, true, true, true));
+                    document.add(new Field(columnName, columnValue, Field.Store.YES, Field.Index.TOKENIZED));
                 }
                 writer.addDocument(document);
             }
@@ -246,7 +246,8 @@
             //build a query based on the fields, searchString and cached analyzer
             //NOTE: This is an area for improvement since the MultiFieldQueryParser
             // has some weirdness.
-            Query query = MultiFieldQueryParser.parse(searchString, fields, analyzer);
+            MultiFieldQueryParser parser = new MultiFieldQueryParser(fields, analyzer);
+            Query query = parser.parse(searchString);
             //run the search
             Hits hits = is.search(query);
             //reset this table model with the new results



Mime
View raw message