use of org.meveo.service.index.ElasticClient in project meveo by meveo-org.
the class FullTextSearchBean method getEsDataModel.
public LazyDataModel<Map<String, Object>> getEsDataModel(Map<String, Object> inputFilters) {
if (esDataModel == null) {
final Map<String, Object> filters = inputFilters;
esDataModel = new ESBasedDataModel() {
private static final long serialVersionUID = -1514374110345615089L;
@Override
protected String getFullTextSearchValue(Map<String, Object> loadingFilters) {
return (String) filters.get(ESBasedDataModel.FILTER_FULL_TEXT);
}
@Override
protected ElasticClient getElasticClientImpl() {
return elasticClient;
}
@Override
public String[] getSearchScope() {
// Limit search scope to offers, product, offer template categories, user groups for marketing manager application
if (FullTextSearchBean.this.getCurrentUser().hasRole("marketingCatalogManager") || FullTextSearchBean.this.getCurrentUser().hasRole("marketingCatalogVisualization")) {
return new String[] { UserHierarchyLevel.class.getName() };
}
return null;
}
};
}
return esDataModel;
}
Aggregations