org.apache.lucene.analysis.PerFieldAnalyzerWrapper Java Examples

The following examples show how to use org.apache.lucene.analysis.PerFieldAnalyzerWrapper. 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 File: IndexManager.java    From uyuni with 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 File: IndexManager.java    From uyuni with 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 File: IndexManager.java    From uyuni with 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 File: IndexManager.java    From uyuni with 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 File: IndexManager.java    From uyuni with 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 File: IndexManager.java    From uyuni with 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 File: DocumentUtil.java    From netbeans with 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
Source File: IndexManager.java    From spacewalk with 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 #9
Source File: IndexManager.java    From spacewalk with 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 #10
Source File: IndexManager.java    From spacewalk with 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 #11
Source File: IndexManager.java    From spacewalk with 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 #12
Source File: IndexManager.java    From spacewalk with 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 #13
Source File: IndexManager.java    From spacewalk with 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;
}