KickJava   Java API By Example, From Geeks To Geeks.

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


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 org.apache.lucene.analysis.Analyzer;
20 import org.apache.lucene.search.Query;
21
22
23
24 /**
25  * The interface of a criterion 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: SimpleLuceneCriterion.java 202255 2005-06-28 17:45:25Z vgritsenko $
32  */

33 public interface SimpleLuceneCriterion {
34
35     /**
36      * The ANY_FIELD name of this bean.
37      * <p>
38      * The value representing a query on any field in the index.
39      * ie. <code>any</code>
40      * </p>
41      */

42     public static final String JavaDoc ANY_FIELD = "any";
43     
44     /**
45      * The ANY_MATCH name of this bean.
46      * <p>
47      * The value representing a match on any of the terms in this criterion.
48      * ie. <code>any</code>
49      * </p>
50      */

51     public static final String JavaDoc ANY_MATCH = "any";
52     
53     /**
54      * The ALL_MATCH name of this bean.
55      * <p>
56      * The value representing a match on all of the terms in this criterion.
57      * ie. <code>all</code>
58      * </p>
59      */

60     public static final String JavaDoc ALL_MATCH = "all";
61     
62     /**
63      * The LIKE_MATCH name of this bean.
64      * <p>
65      * The value representing a fuzzy match on any of the terms in this criterion.
66      * ie. <code>like</code>
67      * </p>
68      */

69     public static final String JavaDoc LIKE_MATCH = "like";
70     
71     /**
72      * The NOT_MATCH name of this bean.
73      * <p>
74      * The value representing a prohibition on any of the terms in this criterion.
75      * ie. <code>like</code>
76      * </p>
77      */

78     public static final String JavaDoc NOT_MATCH = "not";
79     
80     /**
81      * The PHRASE_MATCH name of this bean.
82      * <p>
83      * The value representing a phrase match using all of the terms in this criterion.
84      * ie. <code>like</code>
85      * </p>
86      */

87     public static final String JavaDoc PHRASE_MATCH = "phrase";
88
89     /**
90      * Gets the <code>org.apache.lucene.search.Query</code> from the Criterion
91      * <p>
92      * The analyzer specifies which <code>org.apache.lucene.analysis.Analyzer</code> to use for this search
93      * </p>
94      *
95      * @param analyzer The <code>org.apache.lucene.analysis.Analyzer</code> to use to extract the Terms from this Criterion
96      */

97     public Query getQuery (Analyzer analyzer);
98
99     /**
100      * Gets the prohibited status from the Criterion
101      */

102     public boolean isProhibited ();
103     
104 }
105
Popular Tags