小编Roe*_*mer的帖子

使用NEST进行静态查询构建

我正在玩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)

c# static builder elasticsearch nest

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

builder ×1

c# ×1

elasticsearch ×1

nest ×1

static ×1