Search in sources :

Example 6 with SearchLogHelper

use of org.codelibs.fess.helper.SearchLogHelper in project fess by codelibs.

the class IndexUpdateCallbackImpl method addClickCountField.

protected void addClickCountField(final Map<String, Object> doc, final String url, final String clickCountField) {
    final SearchLogHelper searchLogHelper = ComponentUtil.getSearchLogHelper();
    final int count = searchLogHelper.getClickCount(url);
    doc.put(clickCountField, count);
    if (logger.isDebugEnabled()) {
        logger.debug("Click Count: " + count + ", url: " + url);
    }
}
Also used : SearchLogHelper(org.codelibs.fess.helper.SearchLogHelper)

Example 7 with SearchLogHelper

use of org.codelibs.fess.helper.SearchLogHelper in project fess by codelibs.

the class IndexUpdater method addClickCountField.

protected void addClickCountField(final Map<String, Object> doc) {
    final FessConfig fessConfig = ComponentUtil.getFessConfig();
    final String url = (String) doc.get(fessConfig.getIndexFieldUrl());
    if (StringUtil.isNotBlank(url)) {
        final SearchLogHelper searchLogHelper = ComponentUtil.getSearchLogHelper();
        final int count = searchLogHelper.getClickCount(url);
        doc.put(fessConfig.getIndexFieldClickCount(), count);
        if (logger.isDebugEnabled()) {
            logger.debug("Click Count: {}, url: {}", count, url);
        }
    }
}
Also used : SearchLogHelper(org.codelibs.fess.helper.SearchLogHelper) FessConfig(org.codelibs.fess.mylasta.direction.FessConfig)

Example 8 with SearchLogHelper

use of org.codelibs.fess.helper.SearchLogHelper in project fess by codelibs.

the class AggregateLogJob method execute.

public String execute() {
    final SearchLogHelper searchLogHelper = ComponentUtil.getSearchLogHelper();
    final StringBuilder resultBuf = new StringBuilder();
    try {
        searchLogHelper.storeSearchLog();
    } catch (final Exception e) {
        logger.error("Failed to store a search log.", e);
        resultBuf.append(e.getMessage()).append("\n");
    }
    return resultBuf.toString();
}
Also used : SearchLogHelper(org.codelibs.fess.helper.SearchLogHelper)

Aggregations

SearchLogHelper (org.codelibs.fess.helper.SearchLogHelper)8 FessConfig (org.codelibs.fess.mylasta.direction.FessConfig)2 IOException (java.io.IOException)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 URLEncoder (java.net.URLEncoder)1 Map (java.util.Map)1 Resource (javax.annotation.Resource)1 LogManager (org.apache.logging.log4j.LogManager)1 Logger (org.apache.logging.log4j.Logger)1 StringUtil (org.codelibs.core.lang.StringUtil)1 URLUtil (org.codelibs.core.net.URLUtil)1 Constants (org.codelibs.fess.Constants)1 FessSearchAction (org.codelibs.fess.app.web.base.FessSearchAction)1 ErrorAction (org.codelibs.fess.app.web.error.ErrorAction)1 CharUtil (org.codelibs.fess.crawler.util.CharUtil)1 ClickLog (org.codelibs.fess.es.log.exentity.ClickLog)1 PathMappingHelper (org.codelibs.fess.helper.PathMappingHelper)1 ViewHelper (org.codelibs.fess.helper.ViewHelper)1 ComponentUtil (org.codelibs.fess.util.ComponentUtil)1 DocumentUtil (org.codelibs.fess.util.DocumentUtil)1