@StableMinor(version="12.2", sinceVersion="11.1") public class StandardDocumentPopularityProvider extends Object implements IDocumentPopularityProvider
IDocumentPopularityProvider
implementation that calculates the popularity based on the number of unique visitors a document had and its age.IDocumentPopularityProvider.DocumentPopularityKey
Modifier and Type | Field and Description |
---|---|
static PortalCache<Integer> |
UNIQUE_VISITOR_THRESHOLD_CACHE
Cache for default unique visitors threshold.
|
Constructor and Description |
---|
StandardDocumentPopularityProvider() |
Modifier and Type | Method and Description |
---|---|
Map<IDocumentPopularityProvider.DocumentPopularityKey,Double> |
calculateDocumentPopularities()
Returns a list of documents popularities.
|
double |
calculateDocumentPopularity(StandardDocument document)
Returns the popularity for the given document.
|
public static final PortalCache<Integer> UNIQUE_VISITOR_THRESHOLD_CACHE
public Map<IDocumentPopularityProvider.DocumentPopularityKey,Double> calculateDocumentPopularities() throws PortalException
IDocumentPopularityProvider
standard document's item identifier
, used as the entry's key; and a double
value, used as the document's popularity.
finite
number.0
and 1
decrease the score the document would have during a search.
A popularity of 1
does not alter the score the document would have during search. A popularity greater than 1
increase the score the document would have during search.calculateDocumentPopularities
in interface IDocumentPopularityProvider
PortalException
- if some error occur during calculation.public double calculateDocumentPopularity(StandardDocument document) throws PortalException, TransactionRequiredException, IllegalArgumentException
IDocumentPopularityProvider
finite
number.
A popularity between 0
and 1
decrease the score the document would have during a search.
A popularity of 1
does not alter the score the document would have during search. A popularity greater than 1
increase the score the document would have during search.calculateDocumentPopularity
in interface IDocumentPopularityProvider
document
- the document.PortalException
- if some error occur during calculation.TransactionRequiredException
- if there's no active transaction.IllegalArgumentException
- if the given document is null
.LumisXP 12.2.0.200122 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.