You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2002/03/08 05:12:14 UTC
cvs commit: xml-cocoon2/src/java/org/apache/cocoon/generation SearchGenerator.java
vgritsenko 02/03/07 20:12:14
Modified: src/java/org/apache/cocoon/generation SearchGenerator.java
Log:
fix bug reported by Everton, Dan [Dan.Everton@Australia.Boeing.com]
Revision Changes Path
1.8 +4 -7 xml-cocoon2/src/java/org/apache/cocoon/generation/SearchGenerator.java
Index: SearchGenerator.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/SearchGenerator.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SearchGenerator.java 22 Feb 2002 07:03:51 -0000 1.7
+++ SearchGenerator.java 8 Mar 2002 04:12:14 -0000 1.8
@@ -74,8 +74,6 @@
import org.apache.lucene.search.Hits;
import org.apache.lucene.store.Directory;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
@@ -121,7 +119,7 @@
*
* @author <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
* @author <a href="mailto:vgritsenko@apache.org">Vadim Gritsenko</a>
- * @version CVS $Id: SearchGenerator.java,v 1.7 2002/02/22 07:03:51 cziegeler Exp $
+ * @version CVS $Id: SearchGenerator.java,v 1.8 2002/03/08 04:12:14 vgritsenko Exp $
*/
public class SearchGenerator extends ComposerGenerator
implements Contextualizable, Initializable, Disposable
@@ -482,8 +480,7 @@
// Analyzer analyzer = LuceneCocoonHelper.getAnalyzer("org.apache.lucene.analysis.standard.StandardAnalyzer");
// lcs.setAnalyzer(analyzer);
- param_name = par.getParameter(INDEX_PARAM, INDEX_PARAM_DEFAULT);
- String index_file_name = param_name;
+ String index_file_name = par.getParameter(INDEX_PARAM, INDEX_PARAM_DEFAULT);
if (request.getParameter(INDEX_PARAM) != null) {
index_file_name = request.getParameter(INDEX_PARAM);
}
@@ -496,13 +493,13 @@
// get queryString
// always try lookup the start index from the request params
- startIndex = null;
param_name = par.getParameter(QUERY_STRING_PARAM, QUERY_STRING_PARAM_DEFAULT);
if (request.getParameter(param_name) != null) {
queryString = request.getParameter(param_name);
}
// get startIndex
+ startIndex = null;
param_name = par.getParameter(START_INDEX_NEXT_PARAM, START_INDEX_NEXT_PARAM_DEFAULT);
if (request.getParameter(param_name) != null) {
startIndex = createInteger(request.getParameter(param_name));
@@ -793,7 +790,7 @@
Analyzer analyzer = LuceneCocoonHelper.getAnalyzer("org.apache.lucene.analysis.standard.StandardAnalyzer");
lcs.setAnalyzer(analyzer);
// get the directory where the index resides
- Directory directory = LuceneCocoonHelper.getDirectory(new File(workDir, "index"), false);
+ Directory directory = LuceneCocoonHelper.getDirectory(index, false);
lcs.setDirectory(directory);
hits = lcs.search(queryString, LuceneXMLIndexer.BODY_FIELD);
} catch (IOException ioe) {
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org