/// <summary> /// Adds a <see cref="SearchCondition"/> to the collection for a full-text search on the value given. /// </summary> /// <param name="searchBuilder">The <see cref="MFSearchBuilder"/> to add the condition to.</param> /// <param name="value">The value to search for.</param> /// <param name="searchFlags">The type of full text search to execute (defaults to <see cref="MFFullTextSearchFlags.MFFullTextSearchFlagsLookInFileData"/> | <see cref="MFFullTextSearchFlags.MFFullTextSearchFlagsLookInMetaData"/> ).</param> /// <returns>The <paramref name="searchBuilder"/> provided, for chaining.</returns> public static MFSearchBuilder FullText ( this MFSearchBuilder searchBuilder, string value, MFFullTextSearchFlags searchFlags = MFFullTextSearchFlags.MFFullTextSearchFlagsLookInFileData // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags | MFFullTextSearchFlags.MFFullTextSearchFlagsLookInMetaData ) { // Sanity. if (null == searchBuilder) { throw new ArgumentNullException(nameof(searchBuilder)); } if (null == value) { throw new ArgumentNullException(nameof(value)); } // Create the search condition. var searchCondition = new SearchCondition { ConditionType = MFConditionType.MFConditionTypeContains }; // Set up the any-field (full-text) expression. searchCondition.Expression.SetAnyFieldExpression ( searchFlags ); // Search for the given term. searchCondition.TypedValue.SetValue(MFDataType.MFDatatypeText, value); // Add the search condition to the collection. searchBuilder.Conditions.Add(-1, searchCondition); // Return the search builder for chaining. return(searchBuilder); }
/// <summary> /// Adds a search condition for a full-text search for a text query. /// </summary> /// <param name="searchConditions">The search conditions to add the condition to.</param> /// <param name="query">The query to full-text-search for.</param> /// <param name="fullTextSearchFlags">What type of full-text-search to execute. Defaults to searching in both file data and metadata.</param> /// <param name="index">The index at which to add the search condition to the collection.</param> public static void AddFullTextSearchCondition(this ISearchConditions searchConditions, string query, // ReSharper disable once BitwiseOperatorOnEnumWithoutFlags MFFullTextSearchFlags fullTextSearchFlags = MFFullTextSearchFlags.MFFullTextSearchFlagsLookInFileData | MFFullTextSearchFlags.MFFullTextSearchFlagsLookInMetaData, int index = -1) { // Sanity. if (null == searchConditions) { throw new ArgumentNullException(nameof(searchConditions)); } // Create the search condition. SearchCondition condition = new SearchCondition { ConditionType = MFConditionType.MFConditionTypeContains, }; condition.Expression.SetAnyFieldExpression(fullTextSearchFlags); condition.TypedValue.SetValue(MFDataType.MFDatatypeText, query); // Add the condition at the index provided. searchConditions.Add(index, condition); }
public ObjectSearchResults SearchForObjectsByString(string searchString, bool sortResults, MFFullTextSearchFlags fullTextSearchFlags) { vault.MetricGatherer.MethodCalled(); throw new NotImplementedException(); }
public void SetAnyFieldExpression(MFFullTextSearchFlags FullTextSearchFlags) { throw new NotImplementedException(); }