Skip to content

Commit

Permalink
Setting index to no ends up using by default the "keyword" analyzer o…
Browse files Browse the repository at this point in the history
…n it, which means one can't highlight on it when searching on _all, closes elastic#2062.
  • Loading branch information
kimchy committed Jun 27, 2012
1 parent ccb0997 commit 742d3a3
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -224,12 +224,14 @@ protected AbstractFieldMapper(Names names, Field.Index index, Field.Store store,
this.omitNorms = omitNorms;
this.omitTermFreqAndPositions = omitTermFreqAndPositions;
this.indexOptions = omitTermFreqAndPositions ? FieldInfo.IndexOptions.DOCS_ONLY : FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
if (indexAnalyzer == null && !index.isAnalyzed()) {
// automatically set to keyword analyzer if its indexed and not analyzed
if (indexAnalyzer == null && !index.isAnalyzed() && index.isIndexed()) {
this.indexAnalyzer = Lucene.KEYWORD_ANALYZER;
} else {
this.indexAnalyzer = indexAnalyzer;
}
if (searchAnalyzer == null && !index.isAnalyzed()) {
// automatically set to keyword analyzer if its indexed and not analyzed
if (searchAnalyzer == null && !index.isAnalyzed() && index.isIndexed()) {
this.searchAnalyzer = Lucene.KEYWORD_ANALYZER;
} else {
this.searchAnalyzer = searchAnalyzer;
Expand Down

0 comments on commit 742d3a3

Please sign in to comment.