/// <summary> /// Creates the query. /// </summary> /// <param name="field">The field.</param> /// <param name="value">The value.</param> /// <returns></returns> public static Filter CreateQuery(string field, AttributeFilterValue value) { object val = value.Value; var query = new TermsFilter(); query.AddTerm(new Term(field, ConvertToSearchable(val))); return query; }
/// <summary> /// Adds the facet queries. /// </summary> /// <param name="param">The param.</param> /// <param name="fieldName">Name of the field.</param> /// <param name="values">The values.</param> private void AddFacetQueries(Facets<ESDocument> param, string fieldName, AttributeFilterValue[] values) { if (values == null) return; param.Terms(t => t.FacetName(fieldName.ToLower()).Field(fieldName.ToLower())); }