mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 18:35:25 +00:00
Setting index to no ends up using by default the "keyword" analyzer on it, which means one can't highlight on it when searching on _all, closes #2062.
This commit is contained in:
parent
834c79597e
commit
644dcb99cf
@ -224,12 +224,14 @@ public abstract class AbstractFieldMapper<T> implements FieldMapper<T>, Mapper {
|
|||||||
this.omitNorms = omitNorms;
|
this.omitNorms = omitNorms;
|
||||||
this.omitTermFreqAndPositions = omitTermFreqAndPositions;
|
this.omitTermFreqAndPositions = omitTermFreqAndPositions;
|
||||||
this.indexOptions = omitTermFreqAndPositions ? FieldInfo.IndexOptions.DOCS_ONLY : FieldInfo.IndexOptions.DOCS_AND_FREQS_AND_POSITIONS;
|
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;
|
this.indexAnalyzer = Lucene.KEYWORD_ANALYZER;
|
||||||
} else {
|
} else {
|
||||||
this.indexAnalyzer = indexAnalyzer;
|
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;
|
this.searchAnalyzer = Lucene.KEYWORD_ANALYZER;
|
||||||
} else {
|
} else {
|
||||||
this.searchAnalyzer = searchAnalyzer;
|
this.searchAnalyzer = searchAnalyzer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user