/// <summary>
        /// Sets a list of stopwords to initialize the stop filter with.
        /// Defaults to the language stop words.
        /// </summary>
        public MoreLikeThisFieldQuery <T> StopWords(IEnumerable <string> stopwords)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("stop_words", stopwords);

            RegisterJsonPart(propertyJson);
            return(this);
        }
        /// <summary>
        /// Sets a list of words to use.
        /// </summary>
        public DictionaryDecompounderTokenFilter WordList(IEnumerable <string> wordList)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("word_list", wordList);

            RegisterJsonPart(propertyJson);
            return(this);
        }
        /// <summary>
        /// Sets a list of stopwords to initialize the stop filter with.
        /// Defaults to the language stop words.
        /// </summary>
        public TPart Stopwords(IEnumerable <string> stopwords)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("stopwords", stopwords);

            RegisterJsonPart(propertyJson);
            return((TPart)this);
        }
예제 #4
0
        /// <summary>
        /// The collection of index types this query apply to.
        /// </summary>
        public IdsQuery <T> Types(IEnumerable <string> types)
        {
            string typesJson = JsonHelper.BuildJsonStringsProperty("types", types);

            RegisterJsonPart(typesJson);
            return(this);
        }
예제 #5
0
        /// <summary>
        /// Sets an optional list of logical / registered name of char filters.
        /// </summary>
        public CustomAnalyzer CharFilter(IEnumerable <string> filters)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("char_filter", filters);

            RegisterJsonPart(propertyJson);
            return(this);
        }
        /// <summary>
        /// Sets a custom type mapping table.
        /// </summary>
        public WordDelimiterTokenFilter TypeTable(IEnumerable <string> typeTable)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("type_table", typeTable);

            RegisterJsonPart(propertyJson);
            return(this);
        }
        /// <summary>
        /// Sets a list of stop words articles.
        /// </summary>
        public ElisionTokenFilter Articles(IEnumerable <string> articles)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("articles", articles);

            RegisterJsonPart(propertyJson);
            return(this);
        }
        /// <summary>
        /// Sets a list of character mappings.
        /// </summary>
        public MappingCharFilter Mappings(IEnumerable <string> mappings)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("mappings", mappings);

            RegisterJsonPart(propertyJson);
            return(this);
        }
        /// <summary>
        /// Sets a list of words protected from being delimited.
        /// </summary>
        public WordDelimiterTokenFilter ProtectedWords(IEnumerable <string> protectedWords)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("protected_words", protectedWords);

            RegisterJsonPart(propertyJson);
            return(this);
        }
예제 #10
0
        /// <summary>
        /// Sets a list of stem exclusion words supported by the following languages:
        /// arabic, armenian, basque, brazilian, bulgarian, catalan, czech, danish, dutch, english, finnish, french, galician, german, hindi, hungarian, indonesian, italian, norwegian, portuguese, romanian, russian, spanish, swedish, turkish.
        /// </summary>
        public LanguageAnalyzer StemExclusion(IEnumerable <string> stemExclusion)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("stem_exclusion", stemExclusion);

            RegisterJsonPart(propertyJson);
            return(this);
        }
        /// <summary>
        /// Sets the synonyms configuration in the specified format.
        /// </summary>
        public SynonymTokenFilter Synonyms(IEnumerable <string> synonyms)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("synonyms", synonyms);

            RegisterJsonPart(propertyJson);
            return(this);
        }
예제 #12
0
        /// <summary>
        /// A list of indices to match.
        /// </summary>
        public IndicesFilter <T> Indices(IEnumerable <string> indices)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("indices", indices);

            RegisterJsonPart(propertyJson);
            return(this);
        }
예제 #13
0
        /// <summary>
        /// Sets analyzer aliases to have several registered lookup names associated with analyzer.
        /// </summary>
        public TPart Alias(IEnumerable<string> aliases)
        {
            string propertyJson = JsonHelper.BuildJsonStringsProperty("alias", aliases);
            RegisterJsonPart(propertyJson);

            return (TPart)this;
        }
예제 #14
0
        /// <summary>
        /// The collection of ids to use as filter.
        /// </summary>
        public IdsQuery <T> Values(IEnumerable <string> values)
        {
            string typesJson = JsonHelper.BuildJsonStringsProperty("values", values);

            RegisterJsonPart(typesJson);
            hasRequiredParts = !typesJson.IsNullOrEmpty();
            return(this);
        }
        protected override string ApplyJsonTemplate(string body)
        {
            if (queryFields.Count > 0)
            {
                string fields = JsonHelper.BuildJsonStringsProperty("fields", queryFields);
                body = new[] { fields, body }.JoinWithComma();
            }

            return("{{ 'fuzzy_like_this': {{ {0} }} }}".AltQuoteF(body));
        }
예제 #16
0
        protected override string ApplyJsonTemplate(string body)
        {
            if (!RegisteredField.IsNullOrEmpty())
            {
                queryFields.Add(RawFieldName);
            }

            if (queryFields.Count > 0)
            {
                string fields = JsonHelper.BuildJsonStringsProperty("fields", queryFields);
                body = new[] { fields, body }.JoinWithComma();
            }

            return("{{ 'multi_match': {{ {0} }} }}".AltQuoteF(body));
        }