Configuration

Use the following configuration options to bind the WireBootstrap Azure Search Filter.

Properties

Bind the Component

The following creates a data source to connect to Azure Search.

const source = new wire.data.DataSource("az-search", {
   Provider: {
     service: "azs-playground",
     index: "realestate-us-sample",
     queryKey: "*****",
     suggesterName: "sg"
   }
 });

Create the default query for the component.

const query = wire.data.select("number","street","city","region","countryCode")
   .search("*")
   .facet("type")
   .facet("status");

Create the dataset from the query and the data source.

const dataset = new wire.data.DataSet({
   Source: source,
   Query: query
});

Finally, bind the component.

new wire.azSearchFilter().render("#search", {
    data: dataset
});

Suggest

Use the suggest configuration option to control how type-ahead results appear in the component drop-down.

new wire.azSearchFilter().render("#search", {
  suggest: {
     resultsExpression: "{number} {street}, {city} {region} {countryCode}"
  }
});

Last updated