Class ExtractKeywordsReport


  • public class ExtractKeywordsReport
    extends Report
    ExtractKeywordsReport implements a report, which extracts keywords from the statistical query and result data. The algorithm works as follows:
    • Get the n most popular queries for a given period.
    • For each query, retrieve the results that were selected the most. Whether a result is considered relevant depends on the number of times it was selected. The threshold is set to half the value of the most selected result, but at least 2.
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtractKeywordsReport​(java.lang.String queryDataPath, java.lang.String resultDataPath)
      Creates a new report.
      ExtractKeywordsReport​(java.lang.String queryDataPath, java.lang.String resultDataPath, boolean traversalOk)
      Creates a new report.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getPeriod()  
      java.util.Iterator getResult​(Session session)
      Runs the report and returns a result iterator over Object[] instances.
      int getSize()  
      void setPeriod​(int period)  
      void setSize​(int size)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExtractKeywordsReport

        public ExtractKeywordsReport​(java.lang.String queryDataPath,
                                     java.lang.String resultDataPath)
        Creates a new report.
        Parameters:
        queryDataPath - the path where query data is stored.
        resultDataPath - the path where result data is stored.
      • ExtractKeywordsReport

        public ExtractKeywordsReport​(java.lang.String queryDataPath,
                                     java.lang.String resultDataPath,
                                     boolean traversalOk)
        Creates a new report.
        Parameters:
        queryDataPath - the path where query data is stored.
        resultDataPath - the path where result data is stored.
        traversalOk - set to true to put "traveral ok" option in the statistics query
    • Method Detail

      • getResult

        public java.util.Iterator getResult​(Session session)
                                     throws RepositoryException
        Runs the report and returns a result iterator over Object[] instances.

        Returns result rows with the following objects:

        • Path String of a page
        • Long count (how may times the page was selected as a result)
        • List of Strings (the keywords)
        Specified by:
        getResult in class Report
        Parameters:
        session - the session giving access to the workspace.
        Returns:
        Iterator over Object results.
        Throws:
        RepositoryException - if an error occurs while reading from the repository.
      • getSize

        public int getSize()
        Returns:
        the maximum number of queries analyze.
      • setSize

        public void setSize​(int size)
        Parameters:
        size - the maximum number of queries to analyze.
      • getPeriod

        public int getPeriod()
        Returns:
        the report period in number of days.
      • setPeriod

        public void setPeriod​(int period)
        Parameters:
        period - the report period in number of days.