caio.co/de/cerberus

Upgrade to lucene 8.0.0 (again)

Now with a better search path (ref: da33d428) there isn't a much
noticeable throughput loss for the facetedQuery and basicQuery
is actually faster[^1].

Lucene 7.7.1:

Benchmark                     Mode  Cnt   Score   Error  Units
QueryBenchmark.basicQuery    thrpt    3  98.053 ± 6.045  ops/s
QueryBenchmark.facetedQuery  thrpt    3  10.936 ± 0.203  ops/s

Lucene 8.0.0:

Benchmark                     Mode  Cnt    Score   Error  Units
QueryBenchmark.basicQuery    thrpt    3  103.662 ± 3.564  ops/s
QueryBenchmark.facetedQuery  thrpt    3   10.328 ± 0.741  ops/s

[^1]: Benchmarks were run on a noisy system, so I'm not taking
      these numbers as face value, but there's no indication of
      the previously observed 20+% throughput loss that made me
      block the upgrade.
Id
ce134c075eb52f96b7b76efd4d9c55fa5de6362a
Author
Caio
Commit time
2019-03-28T16:09:38+01:00

Modified pom.xml

@@ -18,7 +18,7
<description>Recipe Search and Metadata retrieval library</description>

<properties>
- <lucene.version>7.7.1</lucene.version>
+ <lucene.version>8.0.0</lucene.version>
<flatbuffers.version>1.10.0.2</flatbuffers.version>
<flatbuffers.sources>${basedir}/src/main/flatbuffers</flatbuffers.sources>
<flatbuffers.generated.sources>${project.build.directory}/generated-sources/java</flatbuffers.generated.sources>

Modified src/main/java/co/caio/cerberus/search/SearcherImpl.java

@@ -95,7 +95,7
luceneQuery, query.offset() + query.maxResults(), toLuceneSort(query.sort()));
}

- builder.totalHits(result.totalHits);
+ builder.totalHits(result.totalHits.value);
for (int i = query.offset(); i < result.scoreDocs.length; i++) {
Document doc = indexSearcher.doc(result.scoreDocs[i].doc);
builder.addRecipe(doc.getField(IndexField.RECIPE_ID).numericValue().longValue());