Search in sources :

Example 1 with QueryRestriction

use of com.celements.search.lucene.query.QueryRestriction in project celements-blog by celements.

the class ArticleLuceneQueryBuilder method getBlogSearchTermRestriction.

IQueryRestriction getBlogSearchTermRestriction(ArticleLoadParameter param) throws XWikiException {
    QueryRestrictionGroup restr = null;
    if (param.isWithBlogArticles() && (param.getSearchTerm() != null)) {
        restr = searchService.createRestrictionGroup(Type.OR);
        restr.add(new QueryRestriction("XWiki.ArticleClass.extract", param.getSearchTerm()));
        restr.add(new QueryRestriction("XWiki.ArticleClass.title", param.getSearchTerm()));
        restr.add(new QueryRestriction("XWiki.ArticleClass.content", param.getSearchTerm()));
    }
    LOGGER.trace("got blog restriction " + restr + "' for '" + param + "'");
    return restr;
}
Also used : QueryRestriction(com.celements.search.lucene.query.QueryRestriction) IQueryRestriction(com.celements.search.lucene.query.IQueryRestriction) QueryRestrictionGroup(com.celements.search.lucene.query.QueryRestrictionGroup)

Aggregations

IQueryRestriction (com.celements.search.lucene.query.IQueryRestriction)1 QueryRestriction (com.celements.search.lucene.query.QueryRestriction)1 QueryRestrictionGroup (com.celements.search.lucene.query.QueryRestrictionGroup)1