Java Doc for CmsSearchField.java in  » Content-Management-System » opencms » org » opencms » search » fields » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » opencms » org.opencms.search.fields 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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  floatBOOST_DEFAULT
     Th default boost factor (1.0), used in case no boost has been set for a field.
final public static  StringFIELD_CATEGORY
     Name of the field that contains the (optional) category of the document (hardcoded).
final public static  StringFIELD_CONTENT
     Name of the field that usually contains the complete content of the document (optional).
final public static  StringFIELD_DATE_CREATED
     Name of the field that contains the document creation date (hardcoded).
final public static  StringFIELD_DATE_LASTMODIFIED
     Name of the field that contains the document last modification date (hardcoded).
final public static  StringFIELD_DESCRIPTION
     Name of the field that usually contains the value of the "Description" property of the document (optional).
final public static  StringFIELD_KEYWORDS
     Name of the field that usually contains the value of the "Keywords" property of the document (optional).
final public static  StringFIELD_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  StringFIELD_PATH
     Name of the field that contains the document root path in the VFS (hardcoded).
final public static  StringFIELD_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  StringFIELD_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  StringFIELD_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  StringFIELD_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  StringFIELD_TYPE
     Name of the field that contains the type of the document.
final public static  StringIGNORE_DISPLAY_NAME
     Value of m_displayName if field should not be displayed.
final public static  StringSTR_TOKENIZED
     Constant for the "tokenized" index setting.
final public static  StringSTR_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)
    

Method Summary
public  voidaddMapping(CmsSearchFieldMapping mapping)
    
public  FieldcreateField(String content)
     Creates a Lucene field from the configuration and the provided content.

If no valid content is provided (ie.

public  booleanequals(Object obj)
    
public  floatgetBoost()
     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.

public  StringgetBoostDisplay()
    
public  StringgetDefaultValue()
    
public  StringgetDisplayName()
    
public  StringgetDisplayNameForConfiguration()
    
public  StringgetIndexed()
    
public  ListgetMappings()
    
public  StringgetName()
    
public  inthashCode()
    
public  booleanisDisplayed()
    
public  booleanisInExcerpt()
    
public  booleanisInExcerptAndStored()
    
public  booleanisIndexed()
    
public  booleanisStored()
    
public  booleanisTokenized()
    
public  booleanisTokenizedAndIndexed()
    
public  voidsetBoost(float boost)
     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.

public  voidsetBoost(String boost)
    
public  voidsetBoostDisplay(String boost)
    
public  voidsetDefaultValue(String defaultValue)
    
public  voidsetDisplayName(String displayName)
     Sets the display name.
public  voidsetDisplayNameForConfiguration(String displayNameForConfiguration)
    
public  voidsetDisplayed(boolean displayed)
    
public  voidsetInExcerpt(boolean excerpt)
    
public  voidsetInExcerpt(String excerpt)
    
public  voidsetIndexed(boolean indexed)
    
public  voidsetIndexed(String indexed)
     Controls if the content of this field is indexed (and possibly tokenized) in the Lucene index from a String parameter.

This sets the values for CmsSearchField.isIndexed() as well as CmsSearchField.isTokenizedAndIndexed() .

The parameter can have the following values:

  • "true" or "tokenized": The field is indexed and tokenized.
public  voidsetName(String name)
    
public  voidsetStored(boolean stored)
    
public  voidsetStored(String stored)
    
public  voidsetTokenized(boolean tokenized)
    

Field Detail
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.




Constructor Detail
CmsSearchField
public CmsSearchField()(Code)
Creates a new search field configuration.




CmsSearchField
public CmsSearchField(String name, String displayName, boolean isStored, boolean isIndexed)(Code)
Creates a new search field configuration.

The field will be tokenized if it is indexed. The field will not be in the excerpt. The boost value is the default, that is no special boost is used. There is no default value.


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 and in the excerpt, see CmsSearchField.setStored(boolean)
Parameters:
  isIndexed - controls if the field is indexed and tokenized, see CmsSearchField.setIndexed(boolean)




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)





Method Detail
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




equals
public boolean equals(Object obj)(Code)
Two fields are equal if the name of the Lucene field is equal.


See Also:   java.lang.Object.equals(java.lang.Object)




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




getIndexed
public String getIndexed()(Code)
Returns the String value state of this field if it is indexed (and possibly tokenized) in the Lucene index.

the String value state of this field if it is indexed (and possibly tokenized) in the Lucene index
See Also:   CmsSearchField.isTokenizedAndIndexed()
See Also:   CmsSearchField.isIndexed()




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




hashCode
public int hashCode()(Code)
The hash code for a field is based only on the field name.


See Also:   java.lang.Object.hashCode




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




setBoost
public void setBoost(String boost)(Code)
Sets the boost factor for this field from a String value.


Parameters:
  boost - the boost factor to set
See Also:   CmsSearchField.setBoost(float)




setBoostDisplay
public void setBoostDisplay(String boost)(Code)
Sets the boost factor of this field (only for display use).


Parameters:
  boost - the boost factor to set
See Also:   CmsSearchField.setBoost(String)




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)




setIndexed
public void setIndexed(String indexed)(Code)
Controls if the content of this field is indexed (and possibly tokenized) in the Lucene index from a String parameter.

This sets the values for CmsSearchField.isIndexed() as well as CmsSearchField.isTokenizedAndIndexed() .

The parameter can have the following values:

  • "true" or "tokenized": The field is indexed and tokenized.
  • "false": The field is not indexed and not tokenized.
  • "untokenized": The field is indexed but not tokenized.

Parameters:
  indexed - the index setting to use
See Also:   CmsSearchField.setIndexed(boolean)
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)




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.