Class Scale
java.lang.Object
com.github.oeuvres.alix.lucene.search.Scale
Handle data to display results as a chronology, according to subset of an
index, given as a bitset.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intCount of docsfinal FieldIntField name, type: NumericDocValuesField, for int valuesfinal FieldTextField name, type.final Scale.Tick[]Data, sorted in docid order, used in term search statsfinal Scale.Tick[]Data, sorted in fieldInt order, used to write an axis -
Constructor Summary
ConstructorsConstructorDescriptionConstructor with alix objects for a lucene reader, an int field, and a text field.Constructor with alix objects for a lucene reader, an int field, and a text field. -
Method Summary
Modifier and TypeMethodDescriptionaxis()Return data to display an axis for the corpus.long[][]Ask for a count of forms, according to a number of dot (ex: 100).long[][]legend(int dots) For each dot, his occurrence index, a label like a year, and a doc order.longlength()Returns the total count of occurrences for this scale.intmax()Maximun value of this scale.intmin()Minimum value of this scale.
-
Field Details
-
fint
Field name, type: NumericDocValuesField, for int values -
ftext
Field name, type. TextField, for text occurrences -
docs
public final int docsCount of docs -
tickByOrder
Data, sorted in fieldInt order, used to write an axis -
tickByDocid
Data, sorted in docid order, used in term search stats
-
-
Constructor Details
-
Scale
Constructor with alix objects for a lucene reader, an int field, and a text field.- Parameters:
alix- wrapper on a lucene reader.fieldInt- stats on an int field.fieldText- stats on a text field.- Throws:
IOException- lucene errors.
-
Scale
public Scale(Alix alix, String fieldInt, String fieldText, org.apache.lucene.util.BitSet docFilter) throws IOException Constructor with alix objects for a lucene reader, an int field, and a text field.- Parameters:
alix- wrapper on a lucene reader.fieldInt- stats on an int field.fieldText- stats on a text field.docFilter- if not null, documents to exclude from stats.- Throws:
IOException- lucene errors.
-
-
Method Details
-
min
public int min()Minimum value of this scale.- Returns:
- minimum value.
-
max
public int max()Maximun value of this scale.- Returns:
- maximum value.
-
length
public long length()Returns the total count of occurrences for this scale.- Returns:
- total count of occurrences.
-
axis
Return data to display an axis for the corpus.- Returns:
- lists of ticks.
-
legend
public long[][] legend(int dots) For each dot, his occurrence index, a label like a year, and a doc order.- Parameters:
dots- How many dots for a curve?- Returns:
- a complex double array to document more.
-
curves
Ask for a count of forms, according to a number of dot (ex: 100). Repartition is equal by occurrences (may be more or less than one year) so as an x value, it is a number of occurrences, not a year, label is given by legend(). #) col[0] global count of occurrences for each requested point #) populate an array docId → pointIndex #) loop on index reader to get count- Parameters:
forms- A list of terms to searchdots- Number of dots by curve.- Returns:
- a complex array.
- Throws:
IOException- Lucene errors.
-