Esempio n. 1
0
            public override bool Next()
            {
                if (field == null)
                {
                    return(false);
                }

                bool next = termEnum.Next();

                // still within field?
                if (next && (System.Object)termEnum.Term().Field() == (System.Object)field)
                {
                    return(true);                 // yes, keep going
                }
                termEnum.Close();                 // close old termEnum

                // find the next field, if any
                field = ((System.String)SupportClass.TailMap(Enclosing_Instance.fieldToReader, field).GetKey(0));
                if (field != null)
                {
                    termEnum = ((IndexReader)Enclosing_Instance.fieldToReader[field]).Terms();
                    return(true);
                }

                return(false);                // no more fields
            }
Esempio n. 2
0
            public override bool Next()
            {
                if (termEnum == null)
                {
                    return(false);
                }

                // another term in this field?
                if (termEnum.Next() && (System.Object)termEnum.Term().Field() == (System.Object)field)
                {
                    return(true);                 // yes, keep going
                }
                termEnum.Close();                 // close old termEnum

                // find the next field with terms, if any
                if (fieldIterator == null)
                {
                    fieldIterator = SupportClass.TailMap(Enclosing_Instance.fieldToReader, field).Keys.GetEnumerator();
                    fieldIterator.MoveNext();                     // Skip field to get next one
                }
                while (fieldIterator.MoveNext())
                {
                    field    = ((System.String)fieldIterator.Current);
                    termEnum = ((IndexReader)Enclosing_Instance.fieldToReader[field]).Terms(new Term(field, ""));
                    Term term = termEnum.Term();
                    if (term != null && (System.Object)term.Field() == (System.Object)field)
                    {
                        return(true);
                    }
                    else
                    {
                        termEnum.Close();
                    }
                }

                return(false);                // no more fields
            }