Skip to main content
Required ACL: search This can be useful in these cases:
  • Different indices for different purposes, such as, one index for products, another one for marketing content.
  • Multiple searches to the same index—for example, with different filters.
Use the helper searchForHits or searchForFacets to get the results in a more convenient format, if you already know the return type you want.

Usage

// Initialize the client
var client = new SearchClient(new SearchConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY"));

// Call the API
var response = await client.SearchAsync<Hit>(
  new SearchMethodParams
  {
    Requests = new List<SearchQuery>
    {
      new SearchQuery(
        new SearchForHits
        {
          IndexName = "<YOUR_INDEX_NAME>",
          Query = "<YOUR_QUERY>",
          HitsPerPage = 50,
        }
      ),
    },
  }
);

// print the response
Console.WriteLine(response);

See the full API reference

For more details about input parameters and response fields.