org.apache.blur.analysis.type
Class CustomFieldTypeDefinition

java.lang.Object
  extended by org.apache.blur.analysis.FieldTypeDefinition
      extended by org.apache.blur.analysis.type.CustomFieldTypeDefinition
Direct Known Subclasses:
BaseSpatialFieldTypeDefinition, ExampleType

public abstract class CustomFieldTypeDefinition
extends FieldTypeDefinition


Constructor Summary
CustomFieldTypeDefinition()
           
 
Method Summary
 boolean checkSupportForCustomQuery()
          By returning true this type will create Query objects from FieldTypeDefinition.getCustomQuery(String) method where the entire string from the query parser is passed to the method.
 boolean checkSupportForFuzzyQuery()
          Custom query types do not support FuzzyQuery.
 boolean checkSupportForPrefixQuery()
          Custom query types do not support PrefixQuery.
 boolean checkSupportForRegexQuery()
          Custom query types do not support RegexQuery.
 boolean checkSupportForSorting()
           
 boolean checkSupportForWildcardQuery()
          Custom query types do not support WildcardQuery.
 org.apache.lucene.analysis.Analyzer getAnalyzerForIndex(String fieldName)
          The getAnalyzerForIndex(String) should never be called for a CustomFieldTypeDefinition because this type will create the IndexableField objects from the FieldTypeDefinition.getFieldsForColumn(String, Column) method or FieldTypeDefinition.getFieldsForSubColumn(String, Column, String) method.
 org.apache.lucene.analysis.Analyzer getAnalyzerForQuery(String fieldName)
          A KeywordAnalyzer is used to parse all the queries for CustomFieldTypeDefinition types.
 org.apache.lucene.search.SortField getSortField(boolean reverse)
           
 boolean isNumeric()
          Checks whether this type is numeric or not.
 
Methods inherited from class org.apache.blur.analysis.FieldTypeDefinition
configure, getAlternateFieldNames, getColumnName, getCustomQuery, getFamily, getFieldsForColumn, getFieldsForSubColumn, getFieldType, getName, getProperties, getSubColumnName, isFieldLessIndexed, isSortEnable, setColumnName, setFamily, setFieldLessIndexed, setFieldType, setProperties, setSortEnable, setSubColumnName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomFieldTypeDefinition

public CustomFieldTypeDefinition()
Method Detail

getAnalyzerForIndex

public org.apache.lucene.analysis.Analyzer getAnalyzerForIndex(String fieldName)
The getAnalyzerForIndex(String) should never be called for a CustomFieldTypeDefinition because this type will create the IndexableField objects from the FieldTypeDefinition.getFieldsForColumn(String, Column) method or FieldTypeDefinition.getFieldsForSubColumn(String, Column, String) method.

Specified by:
getAnalyzerForIndex in class FieldTypeDefinition
Parameters:
fieldName - the field name to get the analyzer, this could be the base field name or the alternative.
Returns:
the Analyzer.
Throws:
@{@link - RuntimeException}.

getAnalyzerForQuery

public final org.apache.lucene.analysis.Analyzer getAnalyzerForQuery(String fieldName)
A KeywordAnalyzer is used to parse all the queries for CustomFieldTypeDefinition types. That means that your query string must contain all the parts of your query to be passed to the FieldTypeDefinition.getCustomQuery(String) method.

Specified by:
getAnalyzerForQuery in class FieldTypeDefinition
Parameters:
fieldName - the field name to get the analyzer, this could be the base field name or the alternative.
Returns:
KeywordAnalyzer.

checkSupportForFuzzyQuery

public final boolean checkSupportForFuzzyQuery()
Custom query types do not support FuzzyQuery.

Specified by:
checkSupportForFuzzyQuery in class FieldTypeDefinition
Returns:
false.

checkSupportForWildcardQuery

public final boolean checkSupportForWildcardQuery()
Custom query types do not support WildcardQuery.

Specified by:
checkSupportForWildcardQuery in class FieldTypeDefinition
Returns:
false.

checkSupportForPrefixQuery

public final boolean checkSupportForPrefixQuery()
Custom query types do not support PrefixQuery.

Specified by:
checkSupportForPrefixQuery in class FieldTypeDefinition
Returns:
false.

checkSupportForRegexQuery

public final boolean checkSupportForRegexQuery()
Custom query types do not support RegexQuery.

Specified by:
checkSupportForRegexQuery in class FieldTypeDefinition
Returns:
false.

isNumeric

public final boolean isNumeric()
Checks whether this type is numeric or not. If so you need this type to be numeric please extend NumericFieldTypeDefinition instead of this class.

Specified by:
isNumeric in class FieldTypeDefinition
Returns:
false.

checkSupportForCustomQuery

public final boolean checkSupportForCustomQuery()
By returning true this type will create Query objects from FieldTypeDefinition.getCustomQuery(String) method where the entire string from the query parser is passed to the method. FieldTypeDefinition.getCustomQuery(String) method (true). If you want to use the getAnalyzerForIndex(String) method to create your query, please extend TextFieldTypeDefinition or FieldTypeDefinition.

Specified by:
checkSupportForCustomQuery in class FieldTypeDefinition
Returns:
true.

checkSupportForSorting

public boolean checkSupportForSorting()
Specified by:
checkSupportForSorting in class FieldTypeDefinition

getSortField

public org.apache.lucene.search.SortField getSortField(boolean reverse)
Specified by:
getSortField in class FieldTypeDefinition


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.