|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jalios.jcms.policy.AbstractPolicyFilter
com.jalios.jcms.policy.BasicLuceneSearchEnginePolicyFilter
public class BasicLuceneSearchEnginePolicyFilter
This class allow developers to put hooks to change lucene search engine mechanism behaviour. To get more information about the current request in hooks, the method Channel#getCurrentJcmsContext() must be called.
Field Summary | |
---|---|
static String |
REVISION
|
Fields inherited from class com.jalios.jcms.policy.AbstractPolicyFilter |
---|
order |
Constructor Summary | |
---|---|
BasicLuceneSearchEnginePolicyFilter()
|
Method Summary | |
---|---|
void |
filterCategoryDocument(org.apache.lucene.document.Document doc,
Category cat,
String lang)
This method is called when the given Category is being index in the given language, just before writing the Document into the index. |
void |
filterFileDocument(org.apache.lucene.document.Document doc,
File file)
This method is called when the given File is being index, just before writing the Document into the index. |
void |
filterMemberDocument(org.apache.lucene.document.Document doc,
Member mbr)
This method is called when the given Member is being index, just before writing the Document into the index. |
void |
filterPublicationDocument(org.apache.lucene.document.Document doc,
Publication pub,
String lang)
This method is called when the given Publication is being index in the given language, just before writing the Document into the index. |
org.apache.lucene.analysis.Analyzer |
getAnalyzer(String lang,
boolean isIndexing,
org.apache.lucene.analysis.Analyzer analyser)
Return the Lucene Analyzer to use for a given language. |
float |
getCategoryBoost(Category cat,
String lang,
float jcms)
Return the boost that should be apply to the lucene Document
that will be created for the given Category . |
float |
getFieldBoost(Category cat,
String lang,
String fieldName,
String fieldValue,
float jcms)
Return the boost that should be apply to the lucene Field
that will be created for the given Category 's field. |
float |
getFieldBoost(Publication pub,
String lang,
String fieldName,
String fieldValue,
float jcms)
Return the boost that should be apply to the lucene Field
that will be created for the given Publication 's field. |
String[] |
getLanguageStopWords(String lang,
String[] jcms)
|
HashSet<String> |
getLanguageStopWordsSet(String lang,
HashSet<String> jcms)
|
float |
getPublicationBoost(Publication pub,
String lang,
float jcms)
Return the boost that should be apply to the lucene Document
that will be created for the given Publication . |
boolean |
init(Plugin plugin)
Initialize the component with the given plugin configuration |
Methods inherited from class com.jalios.jcms.policy.AbstractPolicyFilter |
---|
compareTo, equals, getOrder, setOrder |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
public static final String REVISION
Constructor Detail |
---|
public BasicLuceneSearchEnginePolicyFilter()
Method Detail |
---|
public boolean init(Plugin plugin)
PluginComponent
init
in interface PluginComponent
plugin
- the calling plugin
PluginComponent.init(Plugin)
public String[] getLanguageStopWords(String lang, String[] jcms)
getLanguageStopWords
in interface LuceneSearchEnginePolicyFilter
public HashSet<String> getLanguageStopWordsSet(String lang, HashSet<String> jcms)
getLanguageStopWordsSet
in interface LuceneSearchEnginePolicyFilter
public org.apache.lucene.analysis.Analyzer getAnalyzer(String lang, boolean isIndexing, org.apache.lucene.analysis.Analyzer analyser)
LuceneSearchEnginePolicyFilter
getAnalyzer
in interface LuceneSearchEnginePolicyFilter
lang
- the ISO-639 code of the language analyzedisIndexing
- true if the returned anallyzer is to be used
for indexing, false in any other case (e.g. during search etc..)
You may want to use this parameter to change the behaviour of your
analyzer during those case (for example, synonym analyzer must
generate synonyms only when indexing, not during search).analyser
- the internal Analyzer, created by JCMS, that should be
returned if you do not want to return a customize analyzer
LuceneSearchEnginePolicyFilter.getAnalyzer(String, boolean, Analyzer)
public float getPublicationBoost(Publication pub, String lang, float jcms)
LuceneSearchEnginePolicyFilter
Document
that will be created for the given Publication
. Document
boost factor implicitly sets the starting boost of
all fields to the specified value, Field-specific boosts are multiplied by
the starting value, giving the final value of the field boost factor.
getPublicationBoost
in interface LuceneSearchEnginePolicyFilter
pub
- the Publication indexedlang
- the indexed languagejcms
- the jcms internal boost
LuceneSearchEnginePolicyFilter.getPublicationBoost(Publication, String, float)
public float getFieldBoost(Publication pub, String lang, String fieldName, String fieldValue, float jcms)
LuceneSearchEnginePolicyFilter
Field
that will be created for the given Publication
's field. Publication
's field of type array (int[]
,
long[]
, String[]
, etc) this method will only be
called once. As we are creating appendable lucene Field
in those
case, calling the boost only for the first creationg prevent boost to multiplied
as many times as there elements in the array.
getFieldBoost
in interface LuceneSearchEnginePolicyFilter
pub
- the publication indexedlang
- the indexed languagefieldName
- the indexed field's namefieldValue
- the String value of the indexed field)jcms
- the jcms internal boost
LuceneSearchEnginePolicyFilter.getFieldBoost(Publication, String, String, String, float)
public float getCategoryBoost(Category cat, String lang, float jcms)
LuceneSearchEnginePolicyFilter
Document
that will be created for the given Category
.
getCategoryBoost
in interface LuceneSearchEnginePolicyFilter
cat
- the Category indexedlang
- the indexed languagejcms
- the jcms internal boost
LuceneSearchEnginePolicyFilter.getCategoryBoost(Category, String, float)
public float getFieldBoost(Category cat, String lang, String fieldName, String fieldValue, float jcms)
LuceneSearchEnginePolicyFilter
Field
that will be created for the given Category
's field. Category
's field of type array (int[]
,
long[]
, String[]
, etc) this method will only be
called once. As we are creating appendable lucene Field
in those
case, calling the boost only for the first creationg prevent boost to multiplied
as many times as there elements in the array (Synonyms being a good examples).
getFieldBoost
in interface LuceneSearchEnginePolicyFilter
cat
- the Category indexedlang
- the indexed languagefieldName
- the indexed field's namefieldValue
- the String value of the indexed field)jcms
- the jcms internal boost
LuceneSearchEnginePolicyFilter.getFieldBoost(Category, String, String, String, float)
public void filterPublicationDocument(org.apache.lucene.document.Document doc, Publication pub, String lang)
LuceneSearchEnginePolicyFilter
filterPublicationDocument
in interface LuceneSearchEnginePolicyFilter
doc
- the lucene Document that was created by JCMS search enginepub
- the Publication
being indexedlang
- the indexed languageLuceneSearchEnginePolicyFilter.filterPublicationDocument(Document, Publication, String)
public void filterCategoryDocument(org.apache.lucene.document.Document doc, Category cat, String lang)
LuceneSearchEnginePolicyFilter
filterCategoryDocument
in interface LuceneSearchEnginePolicyFilter
doc
- the lucene Document that was created by JCMS search enginecat
- the Category
being indexedlang
- the indexed languageLuceneSearchEnginePolicyFilter.filterCategoryDocument(Document, Category, String)
public void filterFileDocument(org.apache.lucene.document.Document doc, File file)
LuceneSearchEnginePolicyFilter
filterFileDocument
in interface LuceneSearchEnginePolicyFilter
doc
- the lucene Document that was created by JCMS search enginefile
- the File
being indexedLuceneSearchEnginePolicyFilter.filterFileDocument(Document, java.io.File)
public void filterMemberDocument(org.apache.lucene.document.Document doc, Member mbr)
LuceneSearchEnginePolicyFilter
filterMemberDocument
in interface LuceneSearchEnginePolicyFilter
doc
- the lucene Document that was created by JCMS search enginembr
- the Member
being indexedLuceneSearchEnginePolicyFilter.filterMemberDocument(Document, Member)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |