Java Code Examples for org.apache.lucene.analysis.PerFieldAnalyzerWrapper#addAnalyzer()

The following examples show how to use org.apache.lucene.analysis.PerFieldAnalyzerWrapper#addAnalyzer() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: uyuni   File: IndexManager.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Analyzer getServerAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("checkin", new KeywordAnalyzer());
    analyzer.addAnalyzer("registered", new KeywordAnalyzer());
    analyzer.addAnalyzer("ram", new KeywordAnalyzer());
    analyzer.addAnalyzer("swap", new KeywordAnalyzer());
    analyzer.addAnalyzer("cpuMHz", new KeywordAnalyzer());
    analyzer.addAnalyzer("cpuNumberOfCpus", new KeywordAnalyzer());


    return analyzer;
}
 
Example 2
Source Project: uyuni   File: IndexManager.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Analyzer getErrataAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("advisoryName", new KeywordAnalyzer());
    analyzer.addAnalyzer("synopsis", new StandardAnalyzer());
    analyzer.addAnalyzer("description", new StandardAnalyzer());
    analyzer.addAnalyzer("topic", new StandardAnalyzer());
    analyzer.addAnalyzer("solution", new StandardAnalyzer());

    return analyzer;
}
 
Example 3
Source Project: uyuni   File: IndexManager.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Analyzer getSnapshotTagAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("snapshotId", new KeywordAnalyzer());
    analyzer.addAnalyzer("orgId", new KeywordAnalyzer());
    analyzer.addAnalyzer("serverId", new KeywordAnalyzer());
    analyzer.addAnalyzer("tagNameId", new KeywordAnalyzer());
    analyzer.addAnalyzer("created", new KeywordAnalyzer());
    analyzer.addAnalyzer("modified", new KeywordAnalyzer());
    return analyzer;
}
 
Example 4
Source Project: uyuni   File: IndexManager.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Analyzer getHardwareDeviceAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("serverId", new KeywordAnalyzer());
    analyzer.addAnalyzer("pciType", new KeywordAnalyzer());
    return analyzer;
}
 
Example 5
Source Project: uyuni   File: IndexManager.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Analyzer getServerCustomInfoAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("serverId", new KeywordAnalyzer());
    analyzer.addAnalyzer("created", new KeywordAnalyzer());
    analyzer.addAnalyzer("modified", new KeywordAnalyzer());
    analyzer.addAnalyzer("createdBy", new KeywordAnalyzer());
    analyzer.addAnalyzer("lastModifiedBy", new KeywordAnalyzer());
    return analyzer;
}
 
Example 6
Source Project: uyuni   File: IndexManager.java    License: GNU General Public License v2.0 5 votes vote down vote up
private Analyzer getDefaultAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("arch", new KeywordAnalyzer());
    analyzer.addAnalyzer("epoch", new KeywordAnalyzer());
    analyzer.addAnalyzer("version", new KeywordAnalyzer());
    analyzer.addAnalyzer("release", new KeywordAnalyzer());
    analyzer.addAnalyzer("filename", new KeywordAnalyzer());
    return analyzer;
}
 
Example 7
Source Project: netbeans   File: DocumentUtil.java    License: Apache License 2.0 5 votes vote down vote up
public static Analyzer createAnalyzer() {
    final PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new KeywordAnalyzer());
    analyzer.addAnalyzer(DocumentUtil.FIELD_IDENTS, new WhitespaceAnalyzer());
    analyzer.addAnalyzer(DocumentUtil.FIELD_FEATURE_IDENTS, new WhitespaceAnalyzer());
    analyzer.addAnalyzer(DocumentUtil.FIELD_CASE_INSENSITIVE_FEATURE_IDENTS, new DocumentUtil.LCWhitespaceAnalyzer());
    return analyzer;
}
 
Example 8
private Analyzer getServerAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("checkin", new KeywordAnalyzer());
    analyzer.addAnalyzer("registered", new KeywordAnalyzer());
    analyzer.addAnalyzer("ram", new KeywordAnalyzer());
    analyzer.addAnalyzer("swap", new KeywordAnalyzer());
    analyzer.addAnalyzer("cpuMHz", new KeywordAnalyzer());
    analyzer.addAnalyzer("cpuNumberOfCpus", new KeywordAnalyzer());


    return analyzer;
}
 
Example 9
private Analyzer getErrataAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("advisoryName", new KeywordAnalyzer());
    analyzer.addAnalyzer("synopsis", new StandardAnalyzer());
    analyzer.addAnalyzer("description", new StandardAnalyzer());
    analyzer.addAnalyzer("topic", new StandardAnalyzer());
    analyzer.addAnalyzer("solution", new StandardAnalyzer());

    return analyzer;
}
 
Example 10
private Analyzer getSnapshotTagAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("snapshotId", new KeywordAnalyzer());
    analyzer.addAnalyzer("orgId", new KeywordAnalyzer());
    analyzer.addAnalyzer("serverId", new KeywordAnalyzer());
    analyzer.addAnalyzer("tagNameId", new KeywordAnalyzer());
    analyzer.addAnalyzer("created", new KeywordAnalyzer());
    analyzer.addAnalyzer("modified", new KeywordAnalyzer());
    return analyzer;
}
 
Example 11
private Analyzer getHardwareDeviceAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("serverId", new KeywordAnalyzer());
    analyzer.addAnalyzer("pciType", new KeywordAnalyzer());
    return analyzer;
}
 
Example 12
private Analyzer getServerCustomInfoAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("serverId", new KeywordAnalyzer());
    analyzer.addAnalyzer("created", new KeywordAnalyzer());
    analyzer.addAnalyzer("modified", new KeywordAnalyzer());
    analyzer.addAnalyzer("createdBy", new KeywordAnalyzer());
    analyzer.addAnalyzer("lastModifiedBy", new KeywordAnalyzer());
    return analyzer;
}
 
Example 13
private Analyzer getDefaultAnalyzer() {
    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new
            NGramAnalyzer(min_ngram, max_ngram));
    analyzer.addAnalyzer("id", new KeywordAnalyzer());
    analyzer.addAnalyzer("arch", new KeywordAnalyzer());
    analyzer.addAnalyzer("epoch", new KeywordAnalyzer());
    analyzer.addAnalyzer("version", new KeywordAnalyzer());
    analyzer.addAnalyzer("release", new KeywordAnalyzer());
    analyzer.addAnalyzer("filename", new KeywordAnalyzer());
    return analyzer;
}