-
Notifications
You must be signed in to change notification settings - Fork 69
/
ElasticSearchRepoServiceImpl.java
41 lines (34 loc) · 1.21 KB
/
ElasticSearchRepoServiceImpl.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package org.jai.elasticsearch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class ElasticSearchRepoServiceImpl implements ElasticSearchRepoService {
private static final Logger LOG = LoggerFactory
.getLogger(ElasticSearchRepoServiceImpl.class);
@Autowired
private TopQueryElasticsearchRepository topQueryElasticsearchRepository;
@Autowired
private ProductViewElasticsearchRepository productViewElasticsearchRepository;
@Override
public long countCustomerTopQueryTotalRecords() {
long count = topQueryElasticsearchRepository.count();
LOG.debug("Total count returned for TopQueryRepository is: {}", count);
return count;
}
@Override
public void deleteAllCustomerTopQueryRecords() {
topQueryElasticsearchRepository.deleteAll();
}
@Override
public long countProductViewsTotalRecords() {
long count = productViewElasticsearchRepository.count();
LOG.debug("Total count returned for productViewElasticsearchRepository is: {}", count);
return count;
}
@Override
public void deleteAllProductViewsRecords() {
productViewElasticsearchRepository.deleteAll();
}
}