public class LuceneIndexItemRule
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTENT_TYPE_HTML_XML
Content type "htmlxml" which will index only real content, no HTML/XML tag code
|
static java.lang.String |
CONTENT_TYPE_PLAINTEXT
Content type "plaintext" which will be indexed unparsed
|
static java.lang.String |
EXPRESSION_WILDCARD
Wildcard for item name patterns
|
static java.lang.String |
INDEX_TYPE_FULLTEXT
Indexing type "fulltext"
|
static java.lang.String |
INDEX_TYPE_KEYWORD
Indexing type "keyword"
|
static java.lang.String |
INDEX_TYPE_NO_INDEX
Indexing type "noindex" - Meaning that items applying to this rule will not be indexed
|
Constructor and Description |
---|
LuceneIndexItemRule() |
Modifier and Type | Method and Description |
---|---|
static void |
addDefaultRule(org.dom4j.Element lucene)
adds the default rule to the lucene.itemrules element
|
boolean |
equals(java.lang.Object obj) |
float |
getBoost()
returns the boost value of this rule
|
java.lang.String |
getContentType()
Returns the content type of indexing as constant CONTENT_TYPE_...
|
static LuceneIndexItemRule |
getDefaultRule()
Returns the default rule for newly created databases
|
java.lang.String |
getIndexType()
Returns the indexing type as constant INDEX_TYPE...
|
java.lang.String |
getItemExpression()
Returns the item name pattern
|
java.lang.String |
getItemExpressionClearWildcard()
Returns the item name pattern name without eventually trailing text after the wildcard
|
static java.util.List |
getRules(org.dom4j.Element lucene)
get rules from configfile element lucene
|
static java.util.List<LuceneIndexItemRule> |
getRules(java.util.List<de.innovationgate.wga.config.LuceneIndexItemRule> rules)
get rules from configbean list
|
boolean |
hasWildcard()
Determines if the rule item name pattern has a wildcard
|
boolean |
isDefaultRule()
Determines if this rule is a default rule that will apply to all items not taken by other rules
|
boolean |
isSortable()
Returns if searches should be sortable by items applying to this rule
|
java.lang.String |
parseItemValue(java.lang.String value)
Parses an items value according to the content type of this rule
|
static void |
saveRules(org.dom4j.Element lucene,
java.util.List rules)
Saves rules to lucene configuration in wga.xml
|
void |
setBoost(float boost)
sets the boost value for this rule
|
void |
setContentType(java.lang.String contentType)
Sets the content type for indexing.
|
void |
setIndexType(java.lang.String indexType)
Sets the indexing type.
|
void |
setItemExpression(java.lang.String itemExpression)
Sets the item name pattern.
|
void |
setSortable(boolean sortable)
Sets if searches should be sortable by items applying to this rule
|
public static final java.lang.String EXPRESSION_WILDCARD
public static final java.lang.String INDEX_TYPE_KEYWORD
public static final java.lang.String INDEX_TYPE_FULLTEXT
public static final java.lang.String INDEX_TYPE_NO_INDEX
public static final java.lang.String CONTENT_TYPE_PLAINTEXT
public static final java.lang.String CONTENT_TYPE_HTML_XML
public static java.util.List getRules(org.dom4j.Element lucene)
lucene
- configfile elementpublic static java.util.List<LuceneIndexItemRule> getRules(java.util.List<de.innovationgate.wga.config.LuceneIndexItemRule> rules)
public static void saveRules(org.dom4j.Element lucene, java.util.List rules)
lucene
- The lucene configuration elementrules
- List of LuceneIndexItemRule
objects to be savedpublic static LuceneIndexItemRule getDefaultRule()
public static void addDefaultRule(org.dom4j.Element lucene)
lucene
- luceneElementpublic boolean hasWildcard()
public boolean isDefaultRule()
public java.lang.String getContentType()
public void setContentType(java.lang.String contentType)
contentType
- public java.lang.String getIndexType()
public void setIndexType(java.lang.String indexType)
indexType
- public java.lang.String getItemExpression()
public java.lang.String getItemExpressionClearWildcard()
public void setItemExpression(java.lang.String itemExpression)
EXPRESSION_WILDCARD
.itemExpression
- public boolean isSortable()
public void setSortable(boolean sortable)
sortable
- public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String parseItemValue(java.lang.String value)
value
- The item valuepublic float getBoost()
public void setBoost(float boost)
boost
- java.lang.IllegalArgumentException
- if boost is <=0