private double GetTextTermFreqForClass(BytesRef c)
        {
            double avgNumberOfUniqueTerms = 0;

            foreach (string textFieldName in _textFieldNames)
            {
                Terms terms       = MultiFields.GetTerms(_atomicReader, textFieldName);
                long  numPostings = terms.SumDocFreq;                           // number of term/doc pairs
                avgNumberOfUniqueTerms += numPostings / (double)terms.DocCount; // avg # of unique terms per doc
            }
            int docsWithC = _atomicReader.DocFreq(new Term(_classFieldName, c));

            return(avgNumberOfUniqueTerms * docsWithC); // avg # of unique terms in text fields per doc * # docs with c
        }
Ejemplo n.º 2
0
 // only called from assert
 private bool TermNotInReader(AtomicReader reader, Term term)
 {
     return(reader.DocFreq(term) == 0);
 }
Ejemplo n.º 3
0
 private bool TermNotInReader(AtomicReader reader, Term term)
 {
     // only called from assert
     //System.out.println("TQ.termNotInReader reader=" + reader + " term=" + field + ":" + bytes.utf8ToString());
     return(reader.DocFreq(term) == 0);
 }
Ejemplo n.º 4
0
 private static bool TermNotInReader(AtomicReader reader, Term term) // LUCENENET: CA1822: Mark members as static
 {
     // only called from assert
     //System.out.println("TQ.termNotInReader reader=" + reader + " term=" + field + ":" + bytes.utf8ToString());
     return(reader.DocFreq(term) == 0);
 }
Ejemplo n.º 5
0
 internal bool TermNotInReader(AtomicReader reader, Term term)
 {
     // only called from assert
     //System.out.println("TQ.termNotInReader reader=" + reader + " term=" + field + ":" + bytes.utf8ToString());
     return reader.DocFreq(term) == 0;
 }
Ejemplo n.º 6
0
 // only called from assert
 internal virtual bool TermNotInReader(AtomicReader reader, Term term)
 {
     return(reader.DocFreq(term) == 0);
 }