Skip to main content
Required ACL: search

Usage

// Initialize the client
var client = new CompositionClient(
  new CompositionConfig("ALGOLIA_APPLICATION_ID", "ALGOLIA_API_KEY")
);

// Call the API
var response = await client.SearchAsync<Hit>(
  "foo",
  new RequestBody
  {
    Params = new Params
    {
      Query = "batman",
      InjectedItems = new Dictionary<string, ExternalInjectedItem>
      {
        {
          "my-unique-external-group-key",
          new ExternalInjectedItem
          {
            Items = new List<ExternalInjection>
            {
              new ExternalInjection { ObjectID = "my-object-1" },
              new ExternalInjection
              {
                ObjectID = "my-object-2",
                Metadata = new Dictionary<string, object>
                {
                  { "my-string", "string" },
                  { "my-bool", true },
                  { "my-number", 42 },
                  {
                    "my-object",
                    new Dictionary<string, object> { { "sub-key", "sub-value" } }
                  },
                },
              },
            },
          }
        },
      },
    },
  }
);
// >LOG

See the full API reference

For more details about input parameters and response fields.
I