01: /*
02: Licensed to the Apache Software Foundation (ASF) under one or more
03: contributor license agreements. See the NOTICE file distributed with
04: this work for additional information regarding copyright ownership.
05: The ASF licenses this file to You under the Apache License, Version 2.0
06: (the "License"); you may not use this file except in compliance with
07: the License. You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: */
17:
18: package org.apache.cocoon.bean.query;
19:
20: import java.io.IOException;
21: import java.util.List;
22: import org.apache.cocoon.components.search.LuceneCocoonSearcher;
23: import org.apache.cocoon.ProcessingException;
24:
25: /**
26: * The interface of a query bean.
27: * <p>
28: * This component defines an interface for searching.
29: * The idea is to abstract the process of searching into a Bean to be manipulated by CForms.
30: * </p>
31: *
32: * @version CVS $Id: SimpleLuceneQuery.java 433543 2006-08-22 06:22:54Z crossley $
33: */
34: public interface SimpleLuceneQuery {
35:
36: /**
37: * The AND_BOOL name of this bean.
38: * <p>
39: * The value representing a Boolean AND operation.
40: * ie. <code>and</code>
41: * </p>
42: */
43: public static final String AND_BOOL = "and";
44:
45: /**
46: * The OR_BOOL name of this bean.
47: * <p>
48: * The value representing a Boolean OR operation.
49: * ie. <code>or</code>
50: * </p>
51: */
52: public static final String OR_BOOL = "or";
53:
54: /**
55: * Gets the Bean to perform it's query
56: * <p>
57: * The searcher specifies which LuceneCocoonSearcher to use for this search
58: * It needs to have been initialised properly before use
59: * </p>
60: *
61: * @param searcher The <code>LuceneCocoonSearcher</code> to use for this search
62: * @return a List of Maps, each representing a Hit.
63: * @exception ProcessingException thrown by the searcher
64: * @exception IOException thrown when the searcher's directory cannot be found
65: */
66: public List search(LuceneCocoonSearcher searcher)
67: throws IOException, ProcessingException;
68:
69: }
|