| java.lang.Object org.opencms.search.fields.CmsSearchField
CmsSearchField | public class CmsSearchField (Code) | | An individual field configuration in a search index.
author: Alexander Kandzior version: $Revision: 1.6 $ since: 7.0.0 |
Field Summary | |
final public static float | BOOST_DEFAULT Th default boost factor (1.0), used in case no boost has been set for a field. | final public static String | FIELD_CATEGORY Name of the field that contains the (optional) category of the document (hardcoded). | final public static String | FIELD_CONTENT Name of the field that usually contains the complete content of the document (optional). | final public static String | FIELD_DATE_CREATED Name of the field that contains the document creation date (hardcoded). | final public static String | FIELD_DATE_LASTMODIFIED Name of the field that contains the document last modification date (hardcoded). | final public static String | FIELD_DESCRIPTION Name of the field that usually contains the value of the "Description" property of the document (optional). | final public static String | FIELD_KEYWORDS Name of the field that usually contains the value of the "Keywords" property of the document (optional). | final public static String | FIELD_META Name of the field that usually combines all document "meta" information,
that is the values of the "Title", "Keywords" and "Description" properties (optional). | final public static String | FIELD_PATH Name of the field that contains the document root path in the VFS (hardcoded). | final public static String | FIELD_PRIORITY Name of the field that contains the (optional) document priority,
which can be used to boost the document in the result list (hardcoded). | final public static String | FIELD_ROOT Name of the field that contains a special format of the document root path in the VFS for optimized searches (hardcoded). | final public static String | FIELD_TITLE Name of the field that usually contains the value of the "Title" property of the document
as a keyword used for sorting and also for retrieving the title text (optional).
Please note: This field should NOT be used for searching. | final public static String | FIELD_TITLE_UNSTORED Name of the field that usually contains the value of the "Title" property of the document
in an analyzed form used for searching in the title (optional). | final public static String | FIELD_TYPE Name of the field that contains the type of the document. | final public static String | IGNORE_DISPLAY_NAME Value of m_displayName if field should not be displayed. | final public static String | STR_TOKENIZED Constant for the "tokenized" index setting. | final public static String | STR_UN_TOKENIZED Constant for the "untokenized" index setting. |
Constructor Summary | |
public | CmsSearchField() | public | CmsSearchField(String name, String displayName, boolean isStored, boolean isIndexed) Creates a new search field configuration.
The field will be tokenized if it is indexed.
The field will not be in the excerpt. | public | CmsSearchField(String name, String displayName, boolean isStored, boolean isIndexed, boolean isTokenized, boolean isInExcerpt, float boost, String defaultValue) |
BOOST_DEFAULT | final public static float BOOST_DEFAULT(Code) | | Th default boost factor (1.0), used in case no boost has been set for a field.
|
FIELD_CATEGORY | final public static String FIELD_CATEGORY(Code) | | Name of the field that contains the (optional) category of the document (hardcoded).
|
FIELD_CONTENT | final public static String FIELD_CONTENT(Code) | | Name of the field that usually contains the complete content of the document (optional).
|
FIELD_DATE_CREATED | final public static String FIELD_DATE_CREATED(Code) | | Name of the field that contains the document creation date (hardcoded).
|
FIELD_DATE_LASTMODIFIED | final public static String FIELD_DATE_LASTMODIFIED(Code) | | Name of the field that contains the document last modification date (hardcoded).
|
FIELD_DESCRIPTION | final public static String FIELD_DESCRIPTION(Code) | | Name of the field that usually contains the value of the "Description" property of the document (optional).
|
FIELD_KEYWORDS | final public static String FIELD_KEYWORDS(Code) | | Name of the field that usually contains the value of the "Keywords" property of the document (optional).
|
FIELD_META | final public static String FIELD_META(Code) | | Name of the field that usually combines all document "meta" information,
that is the values of the "Title", "Keywords" and "Description" properties (optional).
|
FIELD_PATH | final public static String FIELD_PATH(Code) | | Name of the field that contains the document root path in the VFS (hardcoded).
|
FIELD_PRIORITY | final public static String FIELD_PRIORITY(Code) | | Name of the field that contains the (optional) document priority,
which can be used to boost the document in the result list (hardcoded).
|
FIELD_ROOT | final public static String FIELD_ROOT(Code) | | Name of the field that contains a special format of the document root path in the VFS for optimized searches (hardcoded).
|
FIELD_TITLE | final public static String FIELD_TITLE(Code) | | Name of the field that usually contains the value of the "Title" property of the document
as a keyword used for sorting and also for retrieving the title text (optional).
Please note: This field should NOT be used for searching. Use
CmsSearchField.FIELD_TITLE_UNSTORED instead.
|
FIELD_TITLE_UNSTORED | final public static String FIELD_TITLE_UNSTORED(Code) | | Name of the field that usually contains the value of the "Title" property of the document
in an analyzed form used for searching in the title (optional).
|
FIELD_TYPE | final public static String FIELD_TYPE(Code) | | Name of the field that contains the type of the document.
|
IGNORE_DISPLAY_NAME | final public static String IGNORE_DISPLAY_NAME(Code) | | Value of m_displayName if field should not be displayed.
|
STR_TOKENIZED | final public static String STR_TOKENIZED(Code) | | Constant for the "tokenized" index setting.
|
STR_UN_TOKENIZED | final public static String STR_UN_TOKENIZED(Code) | | Constant for the "untokenized" index setting.
|
CmsSearchField | public CmsSearchField()(Code) | | Creates a new search field configuration.
|
CmsSearchField | public CmsSearchField(String name, String displayName, boolean isStored, boolean isIndexed, boolean isTokenized, boolean isInExcerpt, float boost, String defaultValue)(Code) | | Creates a new search field configuration.
Parameters: name - the name of the field, see CmsSearchField.setName(String) Parameters: displayName - the display name of this field, see CmsSearchField.setDisplayName(String) Parameters: isStored - controls if the field is stored, see CmsSearchField.setStored(boolean) Parameters: isIndexed - controls if the field is indexed, see CmsSearchField.setIndexed(boolean) Parameters: isTokenized - controls if the field is tokenized, see CmsSearchField.setStored(boolean) Parameters: isInExcerpt - controls if the field is in the excerpt, see CmsSearchField.isInExcerptAndStored() Parameters: boost - the boost factor for the field, see CmsSearchField.setBoost(float) Parameters: defaultValue - the default value for the field, see CmsSearchField.setDefaultValue(String) |
addMapping | public void addMapping(CmsSearchFieldMapping mapping)(Code) | | Adds a new field mapping to the internal list of mappings.
Parameters: mapping - the mapping to add |
createField | public Field createField(String content)(Code) | | Creates a Lucene field from the configuration and the provided content.
If no valid content is provided (ie. the content is either null or
only whitespace), then no field is created and null is returned.
Parameters: content - the content to create the field with a Lucene field created from the configuration and the provided conten |
getBoost | public float getBoost()(Code) | | Returns the boost factor of this field.
The boost factor is a Lucene function that controls the "importance" of a field in the
search result ranking. The default is 1.0 . A lower boost factor will make the field
less important for the result ranking, a higher value will make it more important.
the boost factor of this field |
getBoostDisplay | public String getBoostDisplay()(Code) | | Returns the boost factor of thsi field as String value for display use.
the boost factor of thsi field as String value for display use |
getDefaultValue | public String getDefaultValue()(Code) | | Returns the default value to use if no content for this field was collected.
In case no default is configured, null is returned.
the default value to use if no content for this field was collected |
getDisplayName | public String getDisplayName()(Code) | | Returns the display name of the field.
the display name of the field |
getDisplayNameForConfiguration | public String getDisplayNameForConfiguration()(Code) | | Returns the displayNameForConfiguration.
the displayNameForConfiguration |
getMappings | public List getMappings()(Code) | | Returns the mappings for this field.
the mappings for this field |
getName | public String getName()(Code) | | Returns the name of this field in the Lucene search index.
the name of this field in the Lucene search index |
isDisplayed | public boolean isDisplayed()(Code) | | Returns true if the field should be displayed.
returns true if the field should be displayed otherwise false |
isInExcerpt | public boolean isInExcerpt()(Code) | | Returns true if this fields content is used in the search result excerpt.
true if this fields content is used in the search result excerpt See Also: CmsSearchField.isStored() |
isInExcerptAndStored | public boolean isInExcerptAndStored()(Code) | | Returns true if this fields content is used in the search result excerpt.
A field can only be used in the excerpt if it is stored, see
CmsSearchField.isStored() .
true if this fields content is used in the search result excerpt See Also: CmsSearchField.isStored() |
isIndexed | public boolean isIndexed()(Code) | | Returns the indexed.
the indexed |
isStored | public boolean isStored()(Code) | | Returns true if the content of this field is stored in the Lucene index.
Please refer to the Lucene documentation about
org.apache.lucene.document.Field.Store for the concept behind stored and unstored fields.
true if the content of this field is stored in the Lucene index See Also: CmsSearchField.isTokenizedAndIndexed() |
isTokenized | public boolean isTokenized()(Code) | | Returns true if the content of this field is tokenized in the Lucene index.
Please refer to the Lucene documentation about
org.apache.lucene.document.Field.Index for the concept behind tokenized and untokenized fields.
true if the content of this field is tokenized in the Lucene index |
isTokenizedAndIndexed | public boolean isTokenizedAndIndexed()(Code) | | Returns true if the content of this field is tokenized in the Lucene index.
A field can only be tokenized if it is also indexed, see
CmsSearchField.isIndexed() .
Please refer to the Lucene documentation about
org.apache.lucene.document.Field.Index for the concept behind tokenized and untokenized fields.
true if the content of this field is tokenized in the Lucene index See Also: CmsSearchField.isStored() See Also: CmsSearchField.isIndexed() |
setBoost | public void setBoost(float boost)(Code) | | Sets the boost factor for this field.
The boost factor is a Lucene function that controls the "importance" of a field in the
search result ranking. The default is 1.0 . A lower boost factor will make the field
less important for the result ranking, a higher value will make it more important.
Use with caution: You should only use this if you fully understand the concept behind
Lucene boost factors. Otherwise it is likley that your result rankings will be worse then with
the default values.
Parameters: boost - the boost factor to set |
setDefaultValue | public void setDefaultValue(String defaultValue)(Code) | | Sets the default value to use if no content for this field was collected.
Parameters: defaultValue - the default value to set |
setDisplayName | public void setDisplayName(String displayName)(Code) | | Sets the display name. If the given name equals IGNORE_DISPLAY_NAME the field is not displayed.
Parameters: displayName - the display name to set |
setDisplayNameForConfiguration | public void setDisplayNameForConfiguration(String displayNameForConfiguration)(Code) | | Sets the displayNameForConfiguration.
Parameters: displayNameForConfiguration - the displayNameForConfiguration to set |
setDisplayed | public void setDisplayed(boolean displayed)(Code) | | Controls if the field is displayed or not.
Parameters: displayed - if true the field is displayed |
setInExcerpt | public void setInExcerpt(boolean excerpt)(Code) | | Controls if this fields content is used in the search result excerpt.
Parameters: excerpt - if true , then this fields content is used in the search excerpt |
setInExcerpt | public void setInExcerpt(String excerpt)(Code) | | Controls if this fields content is used in the search result excerpt.
Parameters: excerpt - if "true" , then this fields content is used in the search excerpt See Also: CmsSearchField.setInExcerpt(boolean) |
setIndexed | public void setIndexed(boolean indexed)(Code) | | Controls if the content of this field is indexed (and possibly tokenized) in the Lucene index.
Parameters: indexed - the indexed to set See Also: CmsSearchField.setTokenized(boolean) |
setName | public void setName(String name)(Code) | | Sets the name of this field in the Lucene search index.
Parameters: name - the name to set |
setStored | public void setStored(boolean stored)(Code) | | Controls if the content of this field is stored in the Lucene index.
Please refer to the Lucene documentation about
org.apache.lucene.document.Field.Store for the concept behind stored and unstored fields.
Parameters: stored - if true , then the field content is stored See Also: CmsSearchField.setTokenized(boolean) |
setStored | public void setStored(String stored)(Code) | | Controls if the content of this field is stored in the Lucene index from a String parameter.
Parameters: stored - if "true" , then the field content is stored See Also: CmsSearchField.setStored(boolean) |
setTokenized | public void setTokenized(boolean tokenized)(Code) | | Controls if the content of this field is tokenized in the Lucene index.
Please refer to the Lucene documentation about
org.apache.lucene.document.Field.Index for the concept behind tokenized and untokenized fields.
Parameters: tokenized - if true , then the field content is tokenized See Also: CmsSearchField.setStored(boolean) |
|
|