lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Tschumy <b...@otherwise.com>
Subject Where's the search(Query query, Sort sort) method of Searcher
Date Thu, 08 Jul 2004 22:32:28 GMT
I'm trying to do a search and sort the results using a Sort object.  
The 1.4-final API says that Searcher has the following method.

Hits search(Query query,  Sort sort)

However, when I try to use it in the code below:

         IndexSearcher is = new IndexSearcher(fsDir);
         Query query = QueryParser.parse("Nuggets", "creator", new 
StandardAnalyzer());
         Hits hits = is.search(query, new Sort("created"));

I get the following compile error:

     [javac] Compiling 18 source files to /Users/bill/Nuggets/classes
     [javac] 
/Users/bill/Nuggets/src/com/otherwise/nuggets/MySearcher.java:44: 
cannot resolve symbol
     [javac] symbol  : method search 
(org.apache.lucene.search.Query,org.apache.lucene.search.Sort)
     [javac] location: class org.apache.lucene.search.IndexSearcher
     [javac]             hits = is.search(query, new Sort("created"));
     [javac]                      ^

If I do the same call without the Sort object it compiles just fine.

This seems to be indicating the search(Query, Sort) method is not in 
the jar file.  Either the API is in error (doubtful) or I'm doing 
something really stupid (likely).  Can someone explain which it is?
-- 
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message