Пример #1
0
        protected Query CreateSingleTermCombinationQuery(QueryTerm queryTerm)
        {
            var booleanQuery = new BooleanQuery();

            foreach (var term in queryTerm.Terms())
            {
                var luceneTerm = new Term(queryTerm.Field, $"*{term.ToLower()}*");
                var fieldQuery = new WildcardQuery(luceneTerm);
                booleanQuery.Add(fieldQuery, Occur.SHOULD);
            }

            return(booleanQuery);
        }
Пример #2
0
        protected Query CreateSingleTermQuery(QueryParser parser, QueryTerm queryTerm)
        {
            var singleValueQuery = parser.Parse($"*{queryTerm.Term}*");

            return(singleValueQuery);
        }