private void  InitBlock(System.IComparable[] cachedValues, SortComparator enclosingInstance)
			{
				this.cachedValues = cachedValues;
				this.enclosingInstance = enclosingInstance;
			}
			public AnonymousClassScoreDocComparator(System.IComparable[] cachedValues, SortComparator enclosingInstance)
			{
				InitBlock(cachedValues, enclosingInstance);
			}
Example #3
0
 // inherit javadocs
 public virtual System.IComparable[] GetCustom(Monodoc.Lucene.Net.Index.IndexReader reader, System.String field, SortComparator comparator)
 {
     field = String.Intern(field);
     System.Object ret = Lookup(reader, field, comparator);
     if (ret == null)
     {
         System.IComparable[] retArray = new System.IComparable[reader.MaxDoc()];
         if (retArray.Length > 0)
         {
             TermDocs termDocs = reader.TermDocs();
             TermEnum termEnum = reader.Terms(new Term(field, ""));
             try
             {
                 if (termEnum.Term() == null)
                 {
                     throw new System.SystemException("no terms in Field " + field);
                 }
                 do
                 {
                     Term term = termEnum.Term();
                     if ((System.Object)term.Field() != (System.Object)field)
                     {
                         break;
                     }
                     System.IComparable termval = comparator.GetComparable(term.Text());
                     termDocs.Seek(termEnum);
                     while (termDocs.Next())
                     {
                         retArray[termDocs.Doc()] = termval;
                     }
                 }while (termEnum.Next());
             }
             finally
             {
                 termDocs.Close();
                 termEnum.Close();
             }
         }
         Store(reader, field, SortField.CUSTOM, retArray);
         return(retArray);
     }
     return((System.IComparable[])ret);
 }
Example #4
0
 private void  InitBlock(System.IComparable[] cachedValues, SortComparator enclosingInstance)
 {
     this.cachedValues      = cachedValues;
     this.enclosingInstance = enclosingInstance;
 }
Example #5
0
 public AnonymousClassScoreDocComparator(System.IComparable[] cachedValues, SortComparator enclosingInstance)
 {
     InitBlock(cachedValues, enclosingInstance);
 }
Example #6
0
		// inherit javadocs
		public virtual System.IComparable[] GetCustom(Monodoc.Lucene.Net.Index.IndexReader reader, System.String field, SortComparator comparator)
		{
			field = String.Intern(field);
			System.Object ret = Lookup(reader, field, comparator);
			if (ret == null)
			{
				System.IComparable[] retArray = new System.IComparable[reader.MaxDoc()];
				if (retArray.Length > 0)
				{
					TermDocs termDocs = reader.TermDocs();
					TermEnum termEnum = reader.Terms(new Term(field, ""));
					try
					{
						if (termEnum.Term() == null)
						{
							throw new System.SystemException("no terms in Field " + field);
						}
						do 
						{
							Term term = termEnum.Term();
							if ((System.Object) term.Field() != (System.Object) field)
								break;
							System.IComparable termval = comparator.GetComparable(term.Text());
							termDocs.Seek(termEnum);
							while (termDocs.Next())
							{
								retArray[termDocs.Doc()] = termval;
							}
						}
						while (termEnum.Next());
					}
					finally
					{
						termDocs.Close();
						termEnum.Close();
					}
				}
				Store(reader, field, SortField.CUSTOM, retArray);
				return retArray;
			}
			return (System.IComparable[]) ret;
		}