Package com.day.crx.statistics.keyword
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.
- Get the
-
-
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 overObject[]
instances.int
getSize()
void
setPeriod(int period)
void
setSize(int size)
-
-
-
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 overObject[]
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
ofString
s (the keywords)
- Specified by:
getResult
in classReport
- 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.
- Path
-
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.
-
-