Java Doc for CompassHighlighter.java in  » Search-Engine » compass-2.0 » org » compass » core » 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 » Search Engine » compass 2.0 » org.compass.core 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.compass.core.CompassHighlighter

All known Subclasses:   org.compass.core.impl.DefaultCompassHighlighter,
CompassHighlighter
public interface CompassHighlighter (Code)
A highlighter tool that can highlight hits in a given text based on an executed query.
See Also:   org.compass.core.CompassHits.highlighter(int)
author:
   kimchy

Inner Class :final public static class TextTokenizer extends Parameter



Method Summary
 Stringfragment(String propertyName)
     Returns the best highlighted fragment for the given property name / meta-data.
 Stringfragment(String propertyName, String text)
     Returns the best highlighted fragment for the given property name / meta-data.
 String[]fragments(String propertyName)
     Returns the best highlighted fragments for the given property name / meta-data.
 String[]fragments(String propertyName, String text)
     Returns the best highlighted fragments for the given property name / meta-data.
 StringfragmentsWithSeparator(String propertyName)
     Returns the best highlighted fragments for the given property name / meta-data, separated with the given separator.
 StringfragmentsWithSeparator(String propertyName, String text)
     Returns the best highlighted fragments for the given property name / meta-data, separated with the given separator.
 String[]multiResourceFragment(String propertyName)
     Returns the best highlighted fragment of each matching multi resource property name / meta-data (i.e.: when there is more then one property of the same name).
 String[]multiResourceFragment(String propertyName, String[] texts)
     Returns the best highlighted fragment of each matching multi resource property name / meta-data (i.e.: when there is more then one property of the same name).
 StringmultiResourceFragmentWithSeparator(String propertyName)
     Returns the best highlighted fragments for the given multi property name / meta-data, separated with the given separator.
 StringmultiResourceFragmentWithSeparator(String propertyName, String[] texts)
     Returns the best highlighted fragments for the given multi property name / meta-data, separated with the given separator.
 CompassHighlightersetAnalyzer(String analyzerName)
     Sets the analyzer that will be used if analysis of the text is needed (see TextTokenizer ).
Parameters:
  analyzerName - The analyzer name that will be used.
 CompassHighlightersetAnalyzer(Resource resource)
     Sets the analyzer that will be used if analysis of the text is needed (see TextTokenizer ).
 CompassHighlightersetHighlighter(String highlighterName)
     Sets the highlighter that will be used out the ones set in the configuration.
 CompassHighlightersetMaxBytesToAnalyze(int maxBytesToAnalyze)
     Sets the maximum number of bytes that will be analyzed for highlighting.
 CompassHighlightersetMaxNumFragments(int maxNumFragments)
     Sets the maximum number of fragments that can be returned or combined to a separator.
 CompassHighlightersetSeparator(String separator)
     Sets the separator string that will be used to combine different fragments in CompassHighlighter.fragmentsWithSeparator(String) .
 CompassHighlightersetTextTokenizer(CompassHighlighter.TextTokenizer textTokenizer)
     Sets how the text will be tokenized for highlighting.



Method Detail
fragment
String fragment(String propertyName) throws CompassException(Code)
Returns the best highlighted fragment for the given property name / meta-data. The highlighted text will be retrived from the index, so it must be stored.

Note, if there are more than one resource property name / meta-data with the same name, the text will be taken from the first one.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data. The best fragment text highlighted.
throws:
  CompassException -




fragment
String fragment(String propertyName, String text) throws CompassException(Code)
Returns the best highlighted fragment for the given property name / meta-data. The given text will be used for highlight. Handy when the text is not stored in the index.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data.
Parameters:
  text - The text to be highlighted. The best fragment text highlighted.
throws:
  CompassException -




fragments
String[] fragments(String propertyName) throws CompassException(Code)
Returns the best highlighted fragments for the given property name / meta-data. The highlighted text will be retrived from the index, so it must be stored.

Note, that the number of fragments will be between 0 and maxNumFragments.

Note, if there are more than one resource property name / meta-data with the same name, the text will be taken from the first one.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data. The best fragments highlighted.
throws:
  CompassException -




fragments
String[] fragments(String propertyName, String text) throws CompassException(Code)
Returns the best highlighted fragments for the given property name / meta-data. The given text will be used for highlight.

Note, that the number of fragments will be between 0 and maxNumFragments.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data.
Parameters:
  text - The text to be highlighted. The best fragments highlighted.
throws:
  CompassException -




fragmentsWithSeparator
String fragmentsWithSeparator(String propertyName) throws CompassException(Code)
Returns the best highlighted fragments for the given property name / meta-data, separated with the given separator. The highlighted text will be retrived from the index, so it must be stored.

Note, that the number of fragments will be between 0 and maxNumFragments.

Note, if there are more than one resource property name / meta-data with the same name, the text will be taken from the first one.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data. The best fragments highlighted and separated.
throws:
  CompassException -




fragmentsWithSeparator
String fragmentsWithSeparator(String propertyName, String text) throws CompassException(Code)
Returns the best highlighted fragments for the given property name / meta-data, separated with the given separator. The given text will be used for highlight.

Note, that the number of fragments will be between 0 and maxNumFragments.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data.
Parameters:
  text - The text to be highlighted. The best fragments highlighted and separated.
throws:
  CompassException -




multiResourceFragment
String[] multiResourceFragment(String propertyName) throws CompassException(Code)
Returns the best highlighted fragment of each matching multi resource property name / meta-data (i.e.: when there is more then one property of the same name). The highlighted texts will be retrived from the index, so it must be stored.

Note, that the number of returned fragments is not limited by maxNumFragments value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data. The best fragment texts highlighted.
throws:
  CompassException -




multiResourceFragment
String[] multiResourceFragment(String propertyName, String[] texts) throws CompassException(Code)
Returns the best highlighted fragment of each matching multi resource property name / meta-data (i.e.: when there is more then one property of the same name). The given texts will be used for highlight. Handy when the texts are not stored in the index.

Note, that the number of returned fragments is not limited by maxNumFragments value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data.
Parameters:
  texts - Texts to be highlighted. The best fragment texts highlighted.
throws:
  CompassException -




multiResourceFragmentWithSeparator
String multiResourceFragmentWithSeparator(String propertyName) throws CompassException(Code)
Returns the best highlighted fragments for the given multi property name / meta-data, separated with the given separator. The highlighted text will be retrived from the index, so it must be stored.

Note, that the number of separeted fragments is not limited by maxNumFragments value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data. The best fragments highlighted and separated.
throws:
  CompassException -




multiResourceFragmentWithSeparator
String multiResourceFragmentWithSeparator(String propertyName, String[] texts) throws CompassException(Code)
Returns the best highlighted fragments for the given multi property name / meta-data, separated with the given separator. The given texts will be used for highlight.

Note, that the number of fragments contained in returned string is not limited by maxNumFragments value.

The name can either be the actual resource property or meta-data value, or the path to the given resource property (alias.rProperty), or the class property (alias.cProperty) or the path to the meta-data (alias.cProperty.metaData)
Parameters:
  propertyName - The resource property name / meta-data.
Parameters:
  texts - Texts to be highlighted. The best fragments highlighted and separated.
throws:
  CompassException -




setAnalyzer
CompassHighlighter setAnalyzer(String analyzerName) throws CompassException(Code)
Sets the analyzer that will be used if analysis of the text is needed (see TextTokenizer ).
Parameters:
  analyzerName - The analyzer name that will be used. the highlighter
throws:
  CompassException -



setAnalyzer
CompassHighlighter setAnalyzer(Resource resource) throws CompassException(Code)
Sets the analyzer that will be used if analysis of the text is needed (see TextTokenizer ). Uses the resource to derive the analyzer that will be used (works also with per resource property analyzer).
Parameters:
  resource - The resource to derive the analyzer from the highlighter
throws:
  CompassException -



setHighlighter
CompassHighlighter setHighlighter(String highlighterName) throws CompassException(Code)
Sets the highlighter that will be used out the ones set in the configuration. The highlighters are groups of pre-set configurations for the sepcified highlighter. The default one is called default.
Parameters:
  highlighterName - The name of the highlighter that will be used the higlighter
throws:
  CompassException -



setMaxBytesToAnalyze
CompassHighlighter setMaxBytesToAnalyze(int maxBytesToAnalyze) throws CompassException(Code)
Sets the maximum number of bytes that will be analyzed for highlighting. If not set, will use the value configured for the chosen highlighter.
Parameters:
  maxBytesToAnalyze - The maximum number of bytes analyzed for highlighting the highlighter
throws:
  CompassException -



setMaxNumFragments
CompassHighlighter setMaxNumFragments(int maxNumFragments) throws CompassException(Code)
Sets the maximum number of fragments that can be returned or combined to a separator. If not set, will use the value configured for the chosen highlighter.
Parameters:
  maxNumFragments - The maximum number if fragments the highlighter
throws:
  CompassException -



setSeparator
CompassHighlighter setSeparator(String separator) throws CompassException(Code)
Sets the separator string that will be used to combine different fragments in CompassHighlighter.fragmentsWithSeparator(String) . If not set, will use the separator configured for the chosen highlighter.
Parameters:
  separator - The separator used the highlighter
throws:
  CompassException -



setTextTokenizer
CompassHighlighter setTextTokenizer(CompassHighlighter.TextTokenizer textTokenizer) throws CompassException(Code)
Sets how the text will be tokenized for highlighting. If not set, will use the value configured for the chosen highlighter.
Parameters:
  textTokenizer - How the text will be tokenized for highlighting the highlighter
throws:
  CompassException -



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