Class ExtractKeywordsReport

java.lang.Object
com.day.crx.statistics.Report
com.day.crx.statistics.keyword.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 Details

    • ExtractKeywordsReport

      public ExtractKeywordsReport(String queryDataPath, 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(String queryDataPath, 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 Details

    • getResult

      public 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.