internal /*protected*/ static TextCompareOperator GetTextCompareOpForRelation(Relation rel)
        {
            TextCompareOperator tcOp = TextCompareOperator.Contains;

            switch (rel)
            {
            case Relation.Contains:
                tcOp = TextCompareOperator.Contains;
                break;

            case Relation.Equal:
                tcOp = TextCompareOperator.IsEqual;
                break;

            default:
                throw new ArgumentException("Specified relation is not suited for textual comparision");
            }

            return(tcOp);
        }
Example #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;
        }
Example #3
0
 public FreeTextSearchCriteria(string searchString, IFreeTextSearchField fields, TextCompareOperator compareOperator)
     : this(searchString, fields, compareOperator, MatchRule.AnyMustMatch)
 {
 }