Skip to content

Commit 7b2faea

Browse files
committed
Snippets draft 1, a lot too much complex.
1 parent 331d5bb commit 7b2faea

2 files changed

Lines changed: 636 additions & 0 deletions

File tree

common/src/java/com/github/oeuvres/alix/lucene/spans/HistoListener.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public HistoListener(final HistoNum histo)
1717
{
1818
this.histo = Objects.requireNonNull(histo);
1919
histo.valueSpans = new int[histo.length()];
20+
histo.valueDocs = new int[histo.length()];
2021
histo.cols().add(Col.SPANS);
22+
histo.cols().add(Col.DOCS);
2123
}
2224

2325
@Override
@@ -37,6 +39,7 @@ public void endDoc(final int spanCount)
3739
{
3840
if (histoIndex < 0) return;
3941
histo.valueSpans[histoIndex] += spanCount;
42+
if (spanCount > 0) histo.valueDocs[histoIndex]++;
4043
}
4144

4245

0 commit comments

Comments
 (0)