You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Bill Tschumy <bi...@otherwise.com> on 2004/07/09 00:32:28 UTC

Where's the search(Query query, Sort sort) method of Searcher

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