0
0
Fork 0

mapping_index: add IndexMapping.FieldAnalyzer()

It returns the name of the analyzer used on a field, which can be passed
to IndexMapping.AnalyzeText().

Fix #282
This commit is contained in:
Patrick Mezard 2015-11-19 11:13:29 +01:00
parent 7dd52a5463
commit ff41dfec3d
1 changed files with 5 additions and 0 deletions

View File

@ -507,3 +507,8 @@ func (im *IndexMapping) AnalyzeText(analyzerName string, text []byte) (analysis.
}
return analyzer.Analyze(text), nil
}
// FieldAnalyzer returns the name of the analyzer used on a field.
func (im *IndexMapping) FieldAnalyzer(field string) string {
return im.analyzerNameForPath(field)
}