Skip to content

Instantly share code, notes, and snippets.

@gbellmann
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbellmann/d36babea303f2775a483 to your computer and use it in GitHub Desktop.
Save gbellmann/d36babea303f2775a483 to your computer and use it in GitHub Desktop.
public void CreateIndex(SearchServiceClient searchServiceClient)
{
var index = new Index
{
Name = "peliculas",
Fields = new []
{
new Field("peliculaId", DataType.String) { IsKey = true },
new Field("titulo", DataType.String) { IsSearchable = true, IsFilterable = true },
new Field("director", DataType.String) { IsSearchable = true, IsFilterable = true, IsFacetable = true },
new Field("actores", DataType.Collection(DataType.String)) { IsSearchable = true, IsFilterable = true, IsFacetable = true },
new Field("genero", DataType.String) { IsFilterable = true, IsSortable = true, IsFacetable = true },
new Field("rating", DataType.Int32) { IsFilterable = true, IsSortable = true, IsFacetable = true },
new Field("fechaEstreno", DataType.DateTimeOffset) { IsFilterable = true, IsSortable = true, IsFacetable = true }
}
};
serviceClient.Indexes.Create(index);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment