public class LuceneCategorySearchEngineScoring
extends java.lang.Object
LuceneCategorySearchEngine
.
To override this class and provide your own implementation :
LuceneCategorySearchEngineScoring
public class MyLuceneCategorySearchEngineScoring extends com.jalios.jcms.search.LuceneCategorySearchEngineScoring { public float getPublicationNewScore(QueryHandler qh, QueryResultSet resultSet, Category cat, float catScore, float maxCatScore, Publication pub, float pubScore, float maxPubScore, boolean isNewResult) { return isNewResult ? 42f : pubScore; } }
hook.cat-search-engine.scoring.class: com.example.jcmsplugin.search.MyLuceneCategorySearchEngineScoring
Constructor and Description |
---|
LuceneCategorySearchEngineScoring() |
Modifier and Type | Method and Description |
---|---|
float |
getPublicationNewScore(QueryHandler qh,
QueryResultSet resultSet,
Category cat,
float catScore,
float maxCatScore,
Publication pub,
float pubScore,
float maxPubScore,
boolean isNewResult)
This method is called by the LuceneCategorySearchEngine when searching full text
in category, it is used to compute the new score of the Publication (previously
found or not by the LucenePublicationSearchEngine).
|
public float getPublicationNewScore(QueryHandler qh, QueryResultSet resultSet, Category cat, float catScore, float maxCatScore, Publication pub, float pubScore, float maxPubScore, boolean isNewResult)
qh
- the QueryHandler that was used for this search.resultSet
- the QueryResultSet currently computed.cat
- the Category found.catScore
- the lucene score of the Category.maxCatScore
- the highest category score
(does not change during all calls to this method in a same query).pub
- the Publication that will be added/replaced in
the resultSet with the returned score.pubScore
- the score already available for this publication
(0.0f if isNewResult
is false).maxPubScore
- the highest publication score
(does not change during all calls to this method in a same query).isNewResult
- if true, the given publication was found for the
first time by searching in this category, otherwise the given publication
had already been added (through text search in publications or with a
previous category).Copyright © 2001-2018 Jalios SA. All Rights Reserved.