Ejemplo n.º 1
0
            protected internal override ScoreDoc FetchNextOrNull()
            {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                if (!Iterator.hasNext())
                {
                    return(null);
                }
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                CurrentDocConflict = Iterator.next();
                int subIndex = ReaderUtil.subIndex(CurrentDocConflict.doc, DocStarts);
                LeafReaderContext context = Contexts[subIndex];

                OnNextDoc(CurrentDocConflict.doc - context.docBase, context);
                return(CurrentDocConflict);
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Returns the weight for the current <code>docId</code> as computed
            /// by the <code>weightsValueSource</code>
            ///
            /// </summary>
            protected internal override long GetWeight(Document doc, int docId)
            {
                if (currentWeightValues == null)
                {
                    return(0);
                }
                int subIndex = ReaderUtil.subIndex(docId, starts);

                if (subIndex != currentLeafIndex)
                {
                    currentLeafIndex = subIndex;
                    try
                    {
                        currentWeightValues = outerInstance.weightsValueSource.GetValues(new Dictionary <string, object>(), leaves[currentLeafIndex]);
                    }
                    catch (IOException)
                    {
                        throw new Exception();
                    }
                }
                return(currentWeightValues.LongVal(docId - starts[subIndex]));
            }