Exemplo n.º 1
0
            protected internal override System.Object CreateValue(IndexReader reader, Entry entryKey)
            {
                Entry entry = (Entry)entryKey;

                System.String  field      = entry.field;
                SortComparator comparator = (SortComparator)entry.custom;

                System.IComparable[] retArray = new System.IComparable[reader.MaxDoc()];
                TermDocs             termDocs = reader.TermDocs();
                TermEnum             termEnum = reader.Terms(new Term(field));

                try
                {
                    do
                    {
                        Term term = termEnum.Term();
                        if (term == null || (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();
                }
                return(retArray);
            }
Exemplo n.º 2
0
			private void  InitBlock(System.IComparable[] cachedValues, SortComparator enclosingInstance)
			{
				this.cachedValues = cachedValues;
				this.enclosingInstance = enclosingInstance;
			}
Exemplo n.º 3
0
			public AnonymousClassScoreDocComparator(System.IComparable[] cachedValues, SortComparator enclosingInstance)
			{
				InitBlock(cachedValues, enclosingInstance);
			}
Exemplo n.º 4
0
 public virtual System.IComparable[] GetCustom(IndexReader reader, System.String field, SortComparator comparator)
 {
     return((System.IComparable[])((Cache)caches[typeof(System.IComparable)]).Get(reader, new Entry(field, comparator)));
 }
Exemplo n.º 5
0
		public virtual System.IComparable[] GetCustom(IndexReader reader, System.String field, SortComparator comparator)
		{
			return (System.IComparable[]) ((Cache) caches[typeof(System.IComparable)]).Get(reader, new Entry(field, comparator));
		}
Exemplo n.º 6
0
 private void  InitBlock(System.IComparable[] cachedValues, SortComparator enclosingInstance)
 {
     this.cachedValues      = cachedValues;
     this.enclosingInstance = enclosingInstance;
 }
Exemplo n.º 7
0
 public AnonymousClassScoreDocComparator(System.IComparable[] cachedValues, SortComparator enclosingInstance)
 {
     InitBlock(cachedValues, enclosingInstance);
 }