org.apache.lucene.gdata.search.analysis
Class GdataCategoryStrategy

java.lang.Object
  extended by org.apache.lucene.gdata.search.analysis.ContentStrategy
      extended by org.apache.lucene.gdata.search.analysis.GdataCategoryStrategy

public class GdataCategoryStrategy
extends ContentStrategy

This strategy retrieves the category term and and the scheme from a category element. The content is represented by the term which can be configured via the configuration file.

The category element has at least one attribute with the name "scheme" which is not mandatory. The term can be the default attribute "term" or the text content of the element, this is configured via the path of the field.

<category scheme="http://www.example.com/type" term="blog.post"/>

TODO extend javadoc for search info

Author:
Simon Willnauer

Field Summary
static String CATEGORY_SCHEMA_FIELD_SUFFIX
          Schema field suffix
static String CATEGORY_SCHEMA_NULL_VALUE
          the string to search a schema if no schema is specified
protected  String categoryScheme
           
protected  String categorySchemeField
           
 
Fields inherited from class org.apache.lucene.gdata.search.analysis.ContentStrategy
config, content, fieldName, index, store
 
Constructor Summary
protected GdataCategoryStrategy(IndexSchemaField fieldConfiguration)
           
 
Method Summary
 Field[] createLuceneField()
          This method creates a lucene field from the retrieved content of the entity.
 void processIndexable(Indexable<? extends Node,? extends ServerBaseEntry> indexable)
           
 
Methods inherited from class org.apache.lucene.gdata.search.analysis.ContentStrategy
getFieldStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

categoryScheme

protected String categoryScheme

categorySchemeField

protected String categorySchemeField

CATEGORY_SCHEMA_NULL_VALUE

public static final String CATEGORY_SCHEMA_NULL_VALUE
the string to search a schema if no schema is specified

See Also:
Constant Field Values

CATEGORY_SCHEMA_FIELD_SUFFIX

public static final String CATEGORY_SCHEMA_FIELD_SUFFIX
Schema field suffix

See Also:
Constant Field Values
Constructor Detail

GdataCategoryStrategy

protected GdataCategoryStrategy(IndexSchemaField fieldConfiguration)
Method Detail

processIndexable

public void processIndexable(Indexable<? extends Node,? extends ServerBaseEntry> indexable)
                      throws NotIndexableException
Specified by:
processIndexable in class ContentStrategy
Throws:
NotIndexableException
See Also:
ContentStrategy.processIndexable(org.apache.lucene.gdata.search.analysis.Indexable)

createLuceneField

public Field[] createLuceneField()
Description copied from class: ContentStrategy
This method creates a lucene field from the retrieved content of the entity. Values for Field.Index, Field.Store, the field name and the boost factor are configured in the IndexSchemaField passed by the constructor e.g the factory method. This method might be overwritten by subclasses.

Overrides:
createLuceneField in class ContentStrategy
Returns:
the Lucene Field
See Also:
ContentStrategy.createLuceneField()


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.