public class JsonAnalyzer
extends org.apache.lucene.analysis.Analyzer
org.apache.lucene.analysis.Analyzer.GlobalReuseStrategy, org.apache.lucene.analysis.Analyzer.PerFieldReuseStrategy, org.apache.lucene.analysis.Analyzer.ReuseStrategy, org.apache.lucene.analysis.Analyzer.TokenStreamComponents
Constructor and Description |
---|
JsonAnalyzer(org.apache.lucene.util.Version version,
org.apache.lucene.analysis.Analyzer fieldAnalyzer,
org.apache.lucene.analysis.Analyzer valueAnalyzer)
Create a
JsonAnalyzer with the specified Analyzer s for
field names and values. |
Modifier and Type | Method and Description |
---|---|
void |
clearDatatypes()
Remove all registered Datatype
Analyzer s. |
protected org.apache.lucene.analysis.Analyzer.TokenStreamComponents |
createComponents(String fieldName,
Reader reader) |
void |
registerDatatype(char[] datatype,
org.apache.lucene.analysis.Analyzer a)
Assign an
Analyzer to be used with that key. |
void |
setFieldAnalyzer(org.apache.lucene.analysis.Analyzer analyzer) |
void |
setValueAnalyzer(org.apache.lucene.analysis.Analyzer analyzer) |
public JsonAnalyzer(org.apache.lucene.util.Version version, org.apache.lucene.analysis.Analyzer fieldAnalyzer, org.apache.lucene.analysis.Analyzer valueAnalyzer)
JsonAnalyzer
with the specified Analyzer
s for
field names and values.
The default analyzer for field names will be associated with the datatype
JSONDatatype.JSON_FIELD
. The default analyzer for values will be
associated with the datatype XSDDatatype.XSD_STRING
.
fieldAnalyzer
- Default Analyzer
for the field namesvalueAnalyzer
- Default Analyzer
for the valuespublic void setValueAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
public void setFieldAnalyzer(org.apache.lucene.analysis.Analyzer analyzer)
public void registerDatatype(char[] datatype, org.apache.lucene.analysis.Analyzer a)
Analyzer
to be used with that key. That analyzer is used
to process tokens generated by the JsonTokenizer
.datatype
- The datatype keya
- the associated Analyzer
public void clearDatatypes()
Analyzer
s.Copyright © 2014. All rights reserved.