Human readable representation of total hits count
This commit is contained in:
parent
9734d78839
commit
9d326f5a8b
@ -197,6 +197,7 @@ versions:
|
||||
onlyTopScores: boolean
|
||||
computeScores: boolean
|
||||
TotalHitsCount:
|
||||
stringRepresenter: "it.cavallium.dbengine.lucene.LuceneUtils.toHumanReadableString"
|
||||
data:
|
||||
value: long
|
||||
exact: boolean
|
||||
|
@ -478,4 +478,13 @@ public class LuceneUtils {
|
||||
totalHitsCount.exact() && totalHitsCount1.exact()
|
||||
);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public static String toHumanReadableString(TotalHitsCount totalHitsCount) {
|
||||
if (totalHitsCount.exact()) {
|
||||
return Long.toString(totalHitsCount.value());
|
||||
} else {
|
||||
return totalHitsCount.value() + "+";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user