Usages of

org.apache.lucene.queries.ExtendedCommonTermsQuery.setMinimumNumberShouldMatch(?)
private final Query parseQueryString(ExtendedCommonTermsQuery query, String queryString, String fieldName, QueryParseContext parseContext, String queryAnalyzer, String minimumShouldMatch) throws IOException { FieldMapper<?> mapper = null; String field; MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName); if (smartNameFieldMappers != null && smartNameFieldMappers.hasMapper()) { mapper = smartNameFieldMappers.mapper(); field = mapper.names().indexName(); } else { field = fieldName; } Analyzer analyzer = null; if (queryAnalyzer == null) { if (mapper != null) { analyzer = mapper.searchAnalyzer(); } if (analyzer == null && smartNameFieldMappers != null) { analyzer = smartNameFieldMappers.searchAnalyzer(); } if (analyzer == null) { analyzer = parseContext.mapperService().searchAnalyzer(); } } else { analyzer = parseContext.mapperService().analysisService().analyzer(queryAnalyzer); if (analyzer == null) { throw new ElasticSearchIllegalArgumentException("No analyzer found for [" + queryAnalyzer + "]"); } } // Logic similar to QueryParser#getFieldQuery TokenStream source = analyzer.tokenStream(field, new FastStringReader(queryString.toString())); source.reset(); CharTermAttribute termAtt = source.addAttribute(CharTermAttribute.class); int count = 0; while (source.incrementToken()) { BytesRef ref = new BytesRef(termAtt.length() * 4); // oversize for // UTF-8 UnicodeUtil.UTF16toUTF8(termAtt.buffer(), 0, termAtt.length(), ref); query.add(new Term(field, ref)); count++; } if (count == 0) { return null; } query.setMinimumNumberShouldMatch(minimumShouldMatch); return wrapSmartNameQuery(query, smartNameFieldMappers, parseContext); }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes