Author: pwang
Date: 2010-12-17 17:13:45 -0800 (Fri, 17 Dec 2010)
New Revision: 23238

Modified:
   
core3/search-impl/trunk/src/main/java/org/cytoscape/search/internal/util/CustomMultiFieldQueryParser.java
Log:
Removed depreciated code

Modified: 
core3/search-impl/trunk/src/main/java/org/cytoscape/search/internal/util/CustomMultiFieldQueryParser.java
===================================================================
--- 
core3/search-impl/trunk/src/main/java/org/cytoscape/search/internal/util/CustomMultiFieldQueryParser.java
   2010-12-18 01:11:50 UTC (rev 23237)
+++ 
core3/search-impl/trunk/src/main/java/org/cytoscape/search/internal/util/CustomMultiFieldQueryParser.java
   2010-12-18 01:13:45 UTC (rev 23238)
@@ -40,18 +40,16 @@
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.BooleanQuery;
 import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.util.NumericUtils;
 import org.apache.lucene.queryParser.ParseException;
-//import org.apache.lucene.document.NumberTools;
-//import org.apache.lucene.util.NumericUtils;
 import org.apache.lucene.util.Version;
-//import org.apache.lucene.search.RangeQuery;
+import org.apache.lucene.search.NumericRangeQuery;
 import org.apache.lucene.index.Term;
-
 import org.cytoscape.search.internal.util.AttributeFields;
 import org.cytoscape.search.internal.util.NumberUtils;
-import org.apache.lucene.search.NumericRangeQuery;
 
 
+
 /**
  * This custom MultiFieldQueryParser is used to parse queries containing 
numerical values.
  * Lucene treats all attribute field values as strings. During indexing, 
numerical values were transformed
@@ -74,7 +72,8 @@
                if (attrFields.getType(field) == Integer.class) {
                        try {
                                int num1 = Integer.parseInt(queryText);
-                               return super.getFieldQuery(field, 
NumberUtils.long2sortableStr(num1));
+                               //return super.getFieldQuery(field, 
NumberTools.longToString(num1));
+                               return super.getFieldQuery(field, 
NumericUtils.longToPrefixCoded(num1));
                        } catch (NumberFormatException e) {
                                // Do nothing. When using a 
MultiFieldQueryParser, queryText is
                                // searched in each one of the fields. This 
exception occurs
@@ -91,12 +90,12 @@
                                // .double2sortableStr(num1));
                                
                                Query q = 
NumericRangeQuery.newDoubleRange(field, num1, num1, true, true);
-
                                return q;
                                
-                               //return new NumericRangeQuery(new Term(field, 
NumberUtils.double2sortableStr(num1)),
-                               //              new Term(field, 
NumberUtils.double2sortableStr(num1)), 
-                               //              true);
+                               //return new RangeQuery(new Term(field, 
NumberUtils
+                               //              .double2sortableStr(num1)), new 
Term(field, NumberUtils
+                               //              .double2sortableStr(num1)), 
true);
+                               
                        } catch (NumberFormatException e) {
                                // Do nothing. When using a 
MultiFieldQueryParser, queryText is
                                // searched in each one of the fields. This 
exception occurs

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to