HighlightOptions
Leave feedback
On this page
Inheritance: java.lang.Object, com.groupdocs.search.options.TextOptions
All Implemented Interfaces: com.groupdocs.search.options.IHighlightOptions
public class HighlightOptions extends TextOptions implements IHighlightOptions
Provides options for highlighting found terms.
Learn more
| Constructor | Description |
|---|---|
| HighlightOptions() | Initializes a new instance of the HighlightOptions class. |
| HighlightOptions(Object data) | Initializes a new instance of the TextOptions class. |
| Method | Description |
|---|---|
| getTermsBefore() | Gets the maximum number of words in a text snippet before highlighted word. |
| setTermsBefore(int value) | Sets the maximum number of words in a text snippet before highlighted word. |
| getTermsAfter() | Gets the maximum number of words in a text snippet after highlighted word. |
| setTermsAfter(int value) | Sets the maximum number of words in a text snippet after highlighted word. |
| getTermsTotal() | Gets the maximum number of words in a text snippet. |
| setTermsTotal(int value) | Sets the maximum number of words in a text snippet. |
| getUseInlineStyles() | Gets a value indicating whether inline styles are used to highlight occurrences. |
| setUseInlineStyles(boolean value) | Sets a value indicating whether inline styles are used to highlight occurrences. |
| getHighlightColor() | Gets a color that is used to highlight occurrences. |
| setHighlightColor(Color value) | Sets a color that is used to highlight occurrences. |
| getTermHighlightStartTag() | Gets the start tag of the highlighting of the found word. |
| setTermHighlightStartTag(String value) | Sets the start tag of the highlighting of the found word. |
| getTermHighlightEndTag() | Gets the end tag of the highlighting of the found word. |
| setTermHighlightEndTag(String value) | Sets the end tag of the highlighting of the found word. |
public HighlightOptions()
Initializes a new instance of the HighlightOptions class.
public HighlightOptions(Object data)
Initializes a new instance of the TextOptions class.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| data | java.lang.Object | The serialized data. |
public int getTermsBefore()
Gets the maximum number of words in a text snippet before highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .
Returns: int - The maximum number of words in a text snippet before highlighted word.
public void setTermsBefore(int value)
Sets the maximum number of words in a text snippet before highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int | The maximum number of words in a text snippet before highlighted word. |
public int getTermsAfter()
Gets the maximum number of words in a text snippet after highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .
Returns: int - The maximum number of words in a text snippet after highlighted word.
public void setTermsAfter(int value)
Sets the maximum number of words in a text snippet after highlighted word. The value must be in the range from 0 to 10000. The default value is 7 .
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int | The maximum number of words in a text snippet after highlighted word. |
public int getTermsTotal()
Gets the maximum number of words in a text snippet. The value must be in the range from 0 to 10000. The default value is 21 .
Returns: int - The maximum number of words in a text snippet.
public void setTermsTotal(int value)
Sets the maximum number of words in a text snippet. The value must be in the range from 0 to 10000. The default value is 21 .
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | int | The maximum number of words in a text snippet. |
public boolean getUseInlineStyles()
Gets a value indicating whether inline styles are used to highlight occurrences. The default value is true .
Returns: boolean - A value indicating whether inline styles are used to highlight occurrences.
public void setUseInlineStyles(boolean value)
Sets a value indicating whether inline styles are used to highlight occurrences. The default value is true .
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | boolean | A value indicating whether inline styles are used to highlight occurrences. |
public Color getHighlightColor()
Gets a color that is used to highlight occurrences. The default value is #FFD800.
Returns: Color - A color that is used to highlight occurrences.
public void setHighlightColor(Color value)
Sets a color that is used to highlight occurrences. The default value is #FFD800.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | Color | A color that is used to highlight occurrences. |
public String getTermHighlightStartTag()
Gets the start tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.
Returns: java.lang.String - The start tag of the highlighting of the found word.
public void setTermHighlightStartTag(String value)
Sets the start tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String | The start tag of the highlighting of the found word. |
public String getTermHighlightEndTag()
Gets the end tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.
Returns: java.lang.String - The end tag of the highlighting of the found word.
public void setTermHighlightEndTag(String value)
Sets the end tag of the highlighting of the found word. This tag is used only when highlighting in plain text. The default value is an empty string.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | java.lang.String | The end tag of the highlighting of the found word. |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.