Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2007 Daniel Spiewak
  * Licensed under the Apache License, Version 2.0 (the "License"); 
  * you may not use this file except in compliance with the License. 
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 * See the License for the specific language governing permissions and
 * limitations under the License.

Used to tag methods as being full-text searchable within a Lucene index. This annotation is only relevant when used in conjunction with an instance of SearchableEntityManager. Otherwise, it is ignored by ActiveObjects. Example:

public interface Post extends Entity {
     public String getTitle();
     public void setTitle(String title);
     public String getBody();
     public void setBody(String body);
 // ...
 SearchableEntityManager manager = ...;, "my search string");    // returns search results as Post[]

At the moment, it is impossible to specify the Lucene field and type which will be used in the index. By default, tablename.fieldname is utilized to determine the Lucene field. More features are planned for this annotation in future.

Daniel Spiewak
See also:
public @interface Searchable {}
New to GrepCode? Check out our FAQ X