/// <summary>
 /// Create <see cref="ToParentBlockJoinSortField"/>.
 /// </summary>
 /// <param name="field"> The sort field on the nested / child level. </param>
 /// <param name="type"> The sort type on the nested / child level. </param>
 /// <param name="reverse"> Whether natural order should be reversed on the nested / child document level. </param>
 /// <param name="order"> Whether natural order should be reversed on the parent level. </param>
 /// <param name="parentFilter"> <see cref="Filter"/> that identifies the parent documents. </param>
 /// <param name="childFilter"> <see cref="Filter"/> that defines which child documents participates in sorting. </param>
 public ToParentBlockJoinSortField(string field, SortFieldType type, bool reverse, bool order, Filter parentFilter, Filter childFilter)
     : base(field, type, reverse)
 {
     this.order        = order;
     this.parentFilter = parentFilter;
     this.childFilter  = childFilter;
 }
Exemple #2
0
 // Sets field & type, and ensures field is not NULL unless
 // type is SCORE or DOC
 private void InitFieldType(string field, SortFieldType type)
 {
     this.type = type;
     if (field == null)
     {
         if (type != SortFieldType.SCORE && type != SortFieldType.DOC)
         {
             throw new System.ArgumentException("field can only be null when type is SCORE or DOC");
         }
     }
     else
     {
         this.field = field;
     }
 }
Exemple #3
0
        public DataTable GetAllFinancialYears(SortType sortType, SortFieldType sortFieldType)
        {
            DataTable financialYears = _iFinancialYearsDAL.GetAllFinancialYears();


            if (sortType == SortType.Ascending)
            {
                // financialYears = financialYears.OrderBy(p => p.FIN_YEAR_ID).ToList();
            }
            else
            {
                //    financialYears = financialYears.OrderByDescending(p => p.FIN_YEAR_ID).ToList();
            }
            return(financialYears);
        }
        private static DocComparerSource GetNonFacetComparerSource(SortField sf)
        {
            string        fieldname = sf.Field;
            SortFieldType type      = sf.Type;

            switch (type)
            {
            case SortFieldType.INT32:
                return(new DocComparerSource.Int32DocComparerSource(fieldname));

            case SortFieldType.SINGLE:
                return(new DocComparerSource.SingleDocComparerSource(fieldname));

            case SortFieldType.INT64:
                return(new DocComparerSource.Int64DocComparerSource(fieldname));

            case SortFieldType.DOUBLE:
                return(new DocComparerSource.Int64DocComparerSource(fieldname));

#pragma warning disable 612, 618
            case SortFieldType.BYTE:
                return(new DocComparerSource.ByteDocComparerSource(fieldname));

            case SortFieldType.INT16:
                return(new DocComparerSource.Int16DocComparerSource(fieldname));

#pragma warning restore 612, 618

            case SortFieldType.STRING:
                return(new DocComparerSource.StringOrdComparerSource(fieldname));

            case SortFieldType.STRING_VAL:
                return(new DocComparerSource.StringValComparerSource(fieldname));

            case SortFieldType.CUSTOM:
                throw new InvalidOperationException("lucene custom sort no longer supported: " + fieldname);

            default:
                throw new InvalidOperationException("Illegal sort type: " + type + ", for field: " + fieldname);
            }
        }
Exemple #5
0
 /// <summary>
 /// Creates a sort, possibly in reverse, by terms in the given field with the
 /// type of term values explicitly given. </summary>
 /// <param name="field">  Name of field to sort by.  Can be <c>null</c> if
 ///               <paramref name="type"/> is <see cref="SortFieldType.SCORE"/> or <see cref="SortFieldType.DOC"/>. </param>
 /// <param name="type">   Type of values in the terms. </param>
 /// <param name="reverse"> <c>True</c> if natural order should be reversed. </param>
 public SortField(string field, SortFieldType type, bool reverse)
 {
     InitFieldType(field, type);
     this.reverse = reverse;
 }
Exemple #6
0
        protected object m_missingValue = null; // LUCENENET NOTE: added protected backing field

        /// <summary>
        /// Creates a sort by terms in the given field with the type of term
        /// values explicitly given. </summary>
        /// <param name="field"> Name of field to sort by. Can be <c>null</c> if
        ///               <paramref name="type"/> is <see cref="SortFieldType.SCORE"/> or <see cref="SortFieldType.DOC"/>. </param>
        /// <param name="type"> Type of values in the terms. </param>
        public SortField(string field, SortFieldType type)
        {
            InitFieldType(field, type);
        }
Exemple #7
0
 public void FinancialYearsSort(SortType sortType, SortFieldType sortFieldType)
 {
     _iFinancialYearsView.OrderFinancialYearbyFieldAndDirection(_iFinacialYearsService.GetAllFinancialYears(sortType, sortFieldType));
 }