Class StandardDocumentPopularityProvider

    • Field Detail

      • UNIQUE_VISITOR_THRESHOLD_CACHE

        public static final PortalCache<java.lang.Integer> UNIQUE_VISITOR_THRESHOLD_CACHE
        Cache for default unique visitors threshold.
        Since:
        11.1.0
    • Constructor Detail

      • StandardDocumentPopularityProvider

        public StandardDocumentPopularityProvider()
    • Method Detail

      • calculateDocumentPopularities

        public java.util.Map<IDocumentPopularityProvider.DocumentPopularityKey,​java.lang.Double> calculateDocumentPopularities()
                                                                                                                              throws PortalException
        Description copied from interface: IDocumentPopularityProvider
        Returns a list of documents popularities.
        Each entry of the given map is consisted in: a standard document's item identifier, used as the entry's key; and a double value, used as the document's popularity.

        Both, key and value must not be null and the value must be a positive 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.

        The returned map must not be null.
        Specified by:
        calculateDocumentPopularities in interface IDocumentPopularityProvider
        Returns:
        a list of documents popularities.
        Throws:
        PortalException - if some error occur during calculation.
      • calculateDocumentPopularity

        public double calculateDocumentPopularity​(StandardDocument document)
                                           throws PortalException,
                                                  TransactionRequiredException,
                                                  java.lang.IllegalArgumentException
        Description copied from interface: IDocumentPopularityProvider
        Returns the popularity for the given document. The returned value must be a positive 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.

        Specified by:
        calculateDocumentPopularity in interface IDocumentPopularityProvider
        Parameters:
        document - the document.
        Returns:
        the popularity for the given document.
        Throws:
        PortalException - if some error occur during calculation.
        TransactionRequiredException - if there's no active transaction.
        java.lang.IllegalArgumentException - if the given document is null.