Github user softwaredoug commented on a diff in the pull request: https://github.com/apache/lucene-solr/pull/275#discussion_r154483628 --- Diff: solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java --- @@ -539,6 +591,27 @@ protected Query newRegexpQuery(Term regexp) { return query; } + @Override + protected Query newSynonymQuery(Term terms[]) { + switch (synonymQueryStyle) { + case PICK_BEST: + List<Query> currPosnClauses = new ArrayList<Query>(terms.length); + for (Term term : terms) { + currPosnClauses.add(newTermQuery(term)); + } + DisjunctionMaxQuery dm = new DisjunctionMaxQuery(currPosnClauses, 0.0f); + return dm; + case AS_DISTINCT_TERMS: + BooleanQuery.Builder builder = new BooleanQuery.Builder(); + for (Term term : terms) { + builder.add(newTermQuery(term), BooleanClause.Occur.SHOULD); + } + return builder.build(); + default: --- End diff -- I don't think synonymQueryStyle should ever be null (should default to AS_SAME_TERM)
--- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org