Skip to content

Instantly share code, notes, and snippets.

@lindstromhenrik
lindstromhenrik / QueryStringSearchExtension.cs
Created April 4, 2017 10:23
InAnalyzedField-extension
public static class QueryStringSearchExtensions {
public static IQueriedSearch<TSource, QueryStringQuery> InAnalyzedField<TSource, TExistingQuery>(
this IQueriedSearch<TSource, TExistingQuery> search,
Expression<Func<TSource, string>> fieldSelector,
double? relativeImportance = null)
where TExistingQuery : QueryStringQuery
{
fieldSelector.ValidateNotNullArgument("fieldSelector");
return search.InField(search.Client.Conventions.FieldNameConvention.GetFieldNameForAnalyzed((Expression)fieldSelector), relativeImportance);
@lindstromhenrik
lindstromhenrik / Program.cs
Created September 19, 2017 02:30
NestPercolation
using Nest;
using System;
using System.Collections.Generic;
using System.Linq;
namespace NestPercolation
{
class Program
{
static void Main(string[] args)