01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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.compass.annotations;
18:
19: import java.lang.annotation.ElementType;
20: import java.lang.annotation.Retention;
21: import java.lang.annotation.RetentionPolicy;
22: import java.lang.annotation.Target;
23:
24: /**
25: * <p>Specifies a {@link org.compass.annotations.Searchable} class field/property that dynamically
26: * controls boost value of the class mapped based on its value.
27: *
28: * <p>The value of the field should be allowed to be converted to a float value.
29: *
30: * @author kimchy
31: */
32: @Target({ElementType.METHOD,ElementType.FIELD})
33: @Retention(RetentionPolicy.RUNTIME)
34: public @interface SearchableBoostProperty {
35:
36: /**
37: * The default value if this property is null.
38: */
39: float defaultValue() default 1.0f;
40:
41: /**
42: * The converter lookup name that will be used to convert the
43: * field/property into a float boost value.
44: */
45: String converter() default "";
46:
47: /**
48: * The property accessor that will be fetch and write the property value.
49: *
50: * <p>It is automatically set based on where the annotation is used, but can be
51: * explicitly set. Compass also supports custom property accessors, registered
52: * under a custom name, which can then be used here as well.
53: */
54: String accessor() default "";
55: }
|