Beispiel #1
0
        // append a searchcondition to a sql string
        public static void Append(StringBuilder sql, string condition, MatchRule mr)
        {
            if (sql.Length > 0)
                sql.AppendFormat(" {0} ", mr.GetSqlLogicalOperator());

            sql.Append('(').Append(condition).Append(')');
        }
Beispiel #2
0
        public FreeTextSearchCriteria(string searchString, IFreeTextSearchField fields, TextCompareOperator compareOperator, MatchRule fieldMatchRule)
        {
            if (searchString == null)
                throw new ArgumentNullException("searchString");

            if (searchString.Length < VolumeDatabase.MIN_SEARCHSTR_LENGTH)
                throw new ArgumentException(string.Format("Length of a searchstring must be at least {0}",
                                            VolumeDatabase.MIN_SEARCHSTR_LENGTH), "searchString");

            //			if (fields == FreeTextSearchField.None)
            if (fields == null || fields.IsEmpty)
                throw new ArgumentException("No searchfield specified", "fields");

            this.searchString	   = searchString.Replace("'","''");
            this.fields			   = fields;
            this.compareOperator   = compareOperator;
            this.fieldMatchRule    = fieldMatchRule;
        }
Beispiel #3
0
 public SearchCriteriaGroup(MatchRule membersMatchRule)
 {
     this.membersMatchRule   = membersMatchRule;
     this.memberCriteria     = new List <ISearchCriteria>();
     this.searchCriteriaType = SearchCriteriaType.None;
 }
Beispiel #4
0
        public FreeTextSearchCriteria(string searchString, IFreeTextSearchField fields, TextCompareOperator compareOperator, MatchRule fieldMatchRule)
        {
            if (searchString == null)
            {
                throw new ArgumentNullException("searchString");
            }

            if (searchString.Length < VolumeDatabase.MIN_SEARCHSTR_LENGTH)
            {
                throw new ArgumentException(string.Format("Length of a searchstring must be at least {0}",
                                                          VolumeDatabase.MIN_SEARCHSTR_LENGTH), "searchString");
            }

//			if (fields == FreeTextSearchField.None)
            if (fields == null || fields.IsEmpty)
            {
                throw new ArgumentException("No searchfield specified", "fields");
            }

            this.searchString    = searchString.Replace("'", "''");
            this.fields          = fields;
            this.compareOperator = compareOperator;
            this.fieldMatchRule  = fieldMatchRule;
        }