You can call this operation to query data based on multiple conditions. BoolQuery may include one or more subquery conditions. You can retrieve the rows that match the subquery conditions.

You can combine these subquery conditions in different ways. If you specify these subquery conditions as MustQueries, Table Store returns results that meet all of the subquery conditions. If you specify these subquery conditions as MustNotQueries, Table Store returns results that meet none of the subquery conditions. BoolQuery has the following parameters:

BoolQuery has the following parameters:
/// <summary>
/// The document must match all subquery conditions.
/// </summary>
public List<IQuery> MustQueries { get; set; }
/// <summary>
/// The document must match none of the subquery conditions.
/// </summary>
public List<IQuery> MustNotQueries { get; set; }
/// <summary>
/// The document must match all subfilters. Unlike MustQueries, the matching score is ignored for FilterQueries.
/// </summary>
public List<IQuery> FilterQueries { get; set; }
/// <summary>
/// The document must match at least one of the subquery conditions. The score is higher if the document matches more subquery conditions.
/// </summary>
public List<IQuery> ShouldQueries { get; set; }
/// <summary>
/// Specify the minimum number of ShouldQueries clauses that the document must match. The default value is 1.
/// </summary>
public int? MinimumShouldMatch { get; set; }

Example

/// <summary>
///Union query(the most frequently used query when query conditions are complex). Bool query is formed by one or multiple clauses. Each clause has a specific type.
///must: The document must match all the conditions. 
///should:   should contains more than one conditions. A document accords with should when the document meets at least one of the conditions. 
///must_not: The document must not match the conditions.
///MinimumShouldMatch: The minimum conditions to meet when use should query.
/// </summary>
/// <param name="otsClient"></param>
public static void BoolQuery(OTSClient otsClient)
{
    Console.WriteLine("\n Start bool query...");

    var searchQuery = new SearchQuery();
    searchQuery.GetTotalCount = true;
    var boolQuery = new BoolQuery();
    var shouldQuerys = new List<IQuery>();
    shouldQuerys.Add(new TermQuery(Keyword_type_col, new ColumnValue("SearchIndex")));
    houldQuerys.Add(new TermQuery(Keyword_type_col, new ColumnValue("TableStore")));
    boolQuery.ShouldQueries = shouldQuerys;
    boolQuery.MinimumShouldMatch = 1;

    searchQuery.Query = boolQuery;

    var request = new SearchRequest(TableName, IndexName, searchQuery);
    request.ColumnsToGet = new ColumnsToGet()
    {
        ReturnAll = true
    };

    var response = otsClient.Search(request);

    Console.WriteLine("Total Count:" + response.TotalCount);
    foreach (var row in response.Rows)
    {
        PrintRow(row);
    }
}