/// <summary>
/// POST /_analyze?pretty=true
/// POST /employee/_analyze
/// </summary>
public void Analyze()
{
client.Analyze(x => x.Analyzer("standard").Text("Text to analyze").Pretty());
client.Analyze(x=>x.Index("employee").Field("last_name").Text("陈一狮"));
}
/// <summary>
/// GET /employee/_mapping/employee?pretty=true
/// </summary>
public void GetMapping()
{
client.GetMapping<employee>(x => x.Pretty());
}
/// <summary>
/// PUT /employee/employee/_mapping
/// </summary>
public void Mapping()
{
var response = client.IndexExists("employee");
if(!response.Exists)
{
client.CreateIndex("employee");
}
client.Map<employee>(m => m.Properties(p => p.Text(t => t.Name("age").Index(false))).AutoMap());
}
知识兔