1
1
package com .bakdata .conquery .util .search .solr ;
2
2
3
+ import java .io .IOException ;
4
+ import java .util .Collection ;
5
+ import java .util .Iterator ;
6
+ import java .util .LinkedList ;
7
+ import java .util .List ;
8
+ import java .util .Objects ;
9
+ import java .util .Set ;
10
+ import java .util .concurrent .ConcurrentHashMap ;
11
+ import java .util .function .Predicate ;
12
+
3
13
import com .bakdata .conquery .apiv1 .frontend .FrontendValue ;
4
14
import com .bakdata .conquery .util .search .Search ;
5
15
import com .bakdata .conquery .util .search .solr .entities .SolrFrontendValue ;
6
16
import com .google .common .base .Stopwatch ;
7
- import io .dropwizard .util .Duration ;
8
17
import lombok .Getter ;
9
18
import lombok .RequiredArgsConstructor ;
10
19
import lombok .extern .slf4j .Slf4j ;
13
22
import org .apache .solr .client .solrj .SolrServerException ;
14
23
import org .apache .solr .client .solrj .response .QueryResponse ;
15
24
16
- import java .io .IOException ;
17
- import java .util .*;
18
- import java .util .concurrent .ConcurrentHashMap ;
19
- import java .util .function .Predicate ;
20
-
21
25
22
26
/**
23
27
* Helper class to index {@link com.bakdata.conquery.apiv1.query.concept.filter.FilterValue}s
@@ -32,7 +36,6 @@ public class FilterValueIndexer extends Search<FrontendValue> {
32
36
private final String searchable ;
33
37
private final int sourcePriority ;
34
38
35
- private final Duration commitWithin ;
36
39
public final int updateChunkSize ;
37
40
38
41
/**
@@ -133,10 +136,6 @@ private void scheduleForIndex(SolrFrontendValue solrFrontendValue) {
133
136
}
134
137
}
135
138
136
- private int getCommitWithinMs () {
137
- return (int ) Math .min (commitWithin .toMilliseconds (), Integer .MAX_VALUE );
138
- }
139
-
140
139
public void registerValuesRaw (Collection <String > values ) {
141
140
List <SolrFrontendValue > solrFrontendValues = values .stream ()
142
141
.filter (Objects ::nonNull )
@@ -161,7 +160,7 @@ private void registerValues(Collection<SolrFrontendValue> solrFrontendValues) {
161
160
try {
162
161
Stopwatch stopwatch = Stopwatch .createStarted ();
163
162
log .debug ("BEGIN registering {} values to {} for {}" , solrFrontendValues .size (), solrClient .getDefaultCollection (), searchable );
164
- solrClient .addBeans (solrFrontendValues , getCommitWithinMs ());
163
+ solrClient .addBeans (solrFrontendValues , - 1 ); // do not commit yet
165
164
log .trace ("DONE registering {} values to {} for {} in {}" , solrFrontendValues .size (), solrClient .getDefaultCollection (), searchable , stopwatch );
166
165
}
167
166
catch (SolrServerException | IOException e ) {
0 commit comments