📄 indexschema.java
字号:
public int getMaxFieldLength() { return this.maxFieldLength; } /** * @param maxFieldLength * The maxFieldLength to set. */ public void setMaxFieldLength(int maxFieldLength) { this.maxFieldLength = maxFieldLength; } /** * @return Returns the maxMergeDocs. */ public int getMaxMergeDocs() { return this.maxMergeDocs; } /** * @param maxMergeDocs * The maxMergeDocs to set. */ public void setMaxMergeDocs(int maxMergeDocs) { this.maxMergeDocs = maxMergeDocs; } /** * @return Returns the mergeFactor. */ public int getMergeFactor() { return this.mergeFactor; } /** * @param mergeFactor * The mergeFactor to set. */ public void setMergeFactor(int mergeFactor) { this.mergeFactor = mergeFactor; } /** * @return Returns the writeLockTimeout. */ public long getWriteLockTimeout() { return this.writeLockTimeout; } /** * @param writeLockTimeout * The writeLockTimeout to set. */ public void setWriteLockTimeout(long writeLockTimeout) { this.writeLockTimeout = writeLockTimeout; } /** * @param fields * The fieldConfiguration to set. */ public void setSchemaFields(Collection<IndexSchemaField> fields) { this.schemaFields = fields; } /** * @return Returns the name. */ public String getName() { return this.name; } /** * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object object) { if (this == object) return true; if (object == null) return false; if (object instanceof IndexSchema) { if(this.name ==null) return super.equals(object); return this.name.equals(((IndexSchema) object).getName()); } return false; } /** * @see java.lang.Object#hashCode() */ @Override public int hashCode() { if (this.name == null) return super.hashCode(); return this.name.hashCode(); } private void buildPerFieldAnalyzerWrapper(Analyzer anazlyer, String field) { if (anazlyer == null || field == null || field.length() == 0) return; if (this.perFieldAnalyzer == null) this.perFieldAnalyzer = new PerFieldAnalyzerWrapper( this.serviceAnalyzer); this.perFieldAnalyzer.addAnalyzer(field, anazlyer); } private static Analyzer getAnalyzerInstance(Class<? extends Analyzer> clazz) { if (!ReflectionUtils.extendsType(clazz, Analyzer.class)) { LOG.warn("Can not create analyzer for class " + clazz.getName()); return null; } try { return clazz.newInstance(); } catch (Exception e) { LOG.warn("Can not create analyzer for class " + clazz.getName()); } return null; } /** * @param name * The name to set. */ public void setName(String name) { this.name = name; } /** * @return Returns the indexLocation. */ public String getIndexLocation() { return this.indexLocation; } /** * @param indexLocation * The indexLocation to set. */ public void setIndexLocation(String indexLocation) { this.indexLocation = indexLocation; } /** * @return Returns the defaultField. */ public String getDefaultSearchField() { return this.defaultSearchField; } /** * @param defaultField * The defaultField to set. */ public void setDefaultSearchField(String defaultField) { this.defaultSearchField = defaultField; } /** * @return Returns the indexerIdleTime. */ public long getIndexerIdleTime() { return this.indexerIdleTime; } /** * @param indexerIdleTime * The indexerIdleTime to set. */ public void setIndexerIdleTime(long indexerIdleTime) { this.indexerIdleTime = indexerIdleTime; } /** * @return Returns the useTimedIndexer. */ public boolean isUseTimedIndexer() { return this.useTimedIndexer; } /** * @param useTimedIndexer * The useTimedIndexer to set. */ public void setUseTimedIndexer(boolean useTimedIndexer) { this.useTimedIndexer = useTimedIndexer; } /** * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder builder = new StringBuilder(this.getClass().getName()) .append(" "); builder.append("Name: ").append(this.name).append(" "); builder.append("MaxBufferedDocs: ").append(this.maxBufferedDocs) .append(" "); builder.append("MaxFieldLength: ").append(this.maxFieldLength).append( " "); builder.append("MaxMergeDocs: ").append(this.maxMergeDocs).append(" "); builder.append("MergeFactor: ").append(this.mergeFactor).append(" "); builder.append("CommitLockTimeout: ").append(this.commitLockTimeout) .append(" "); builder.append("WriteLockTimeout: ").append(this.writeLockTimeout) .append(" "); builder.append("indexerIdleTime: ").append(this.indexerIdleTime) .append(" "); builder.append("useCompoundFile: ").append(this.useCompoundFile) .append(" "); builder.append("Added SchemaField instances: ").append( this.schemaFields.size()).append(" "); builder.append("IndexLocation: ").append(this.indexLocation) .append(" "); return builder.toString(); } /** * @return Returns the searchableFieldNames. */ public Set<String> getSearchableFieldNames() { return this.searchableFieldNames; } /** * Defines after how many added,removed or updated document the indexer should commit. * @return Returns the commitAfterDocuments. */ public int getCommitAfterDocuments() { return this.commitAfterDocuments; } /** * @param commitAfterDocuments The commitAfterDocuments to set. */ public void setCommitAfterDocuments(int commitAfterDocuments) { if(commitAfterDocuments < DEFAULT_COMMIT_COUNT) return; this.commitAfterDocuments = commitAfterDocuments; } /** * Defines after how many commits the indexer should optimize the index * @return Returns the optimizeAfterCommit. */ public int getOptimizeAfterCommit() { return this.optimizeAfterCommit; } /** * @param optimizeAfterCommit The optimizeAfterCommit to set. */ public void setOptimizeAfterCommit(int optimizeAfterCommit) { if(optimizeAfterCommit < DEFAULT_OPTIMIZE_COUNT ) return; this.optimizeAfterCommit = optimizeAfterCommit; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -