KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > bean > query > SimpleLuceneQuery


1 /*
2   Copyright 1999-2004 The Apache Software Foundation
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15 */

16
17 package org.apache.cocoon.bean.query;
18
19 import java.io.IOException JavaDoc;
20 import java.util.List JavaDoc;
21 import org.apache.cocoon.components.search.LuceneCocoonSearcher;
22 import org.apache.cocoon.ProcessingException;
23
24 /**
25  * The interface of a query bean.
26  * <p>
27  * This component defines an interface for searching.
28  * The idea is to abstract the process of searching into a Bean to be manipulated by CForms.
29  * </p>
30  *
31  * @version CVS $Id: SimpleLuceneQuery.java 202255 2005-06-28 17:45:25Z vgritsenko $
32  */

33 public interface SimpleLuceneQuery {
34
35     /**
36      * The AND_BOOL name of this bean.
37      * <p>
38      * The value representing a Boolean AND operation.
39      * ie. <code>and</code>
40      * </p>
41      */

42     public static final String JavaDoc AND_BOOL = "and";
43
44     /**
45      * The OR_BOOL name of this bean.
46      * <p>
47      * The value representing a Boolean OR operation.
48      * ie. <code>or</code>
49      * </p>
50      */

51     public static final String JavaDoc OR_BOOL = "or";
52
53     /**
54      * Gets the Bean to perform it's query
55      * <p>
56      * The searcher specifies which LuceneCocoonSearcher to use for this search
57      * It needs to have been initialised properly before use
58      * </p>
59      *
60      * @param searcher The <code>LuceneCocoonSearcher</code> to use for this search
61      * @return a List of Maps, each representing a Hit.
62      * @exception ProcessingException thrown by the searcher
63      * @exception IOException thrown when the searcher's directory cannot be found
64      */

65     public List JavaDoc search (LuceneCocoonSearcher searcher) throws IOException JavaDoc, ProcessingException;
66
67 }
68
Popular Tags