我正在玩Elasticsearch和NEST.
我在理解可用于创建和构建静态查询的各种类和接口时遇到一些麻烦.
这是我想要实现的简化示例:
using Nest;
using System;
using System.Text;
namespace NestTest
{
public class Product
{
public string Name { get; set; }
public int Price { get; set; }
}
public class ProductFilter
{
public string[] IncludeNames { get; set; }
public string[] ExcludeNames { get; set; }
public int MaxPrice { get; set; }
}
class Program
{
static void Main(string[] args)
{
var filter = new ProductFilter();
filter.MaxPrice = 100;
filter.IncludeNames = new[] { "Notebook", "Workstation" }; …Run Code Online (Sandbox Code Playgroud)