本文整理汇总了Java中org.apache.lucene.index.IndexCommit.getDirectory方法的典型用法代码示例。如果您正苦于以下问题:Java IndexCommit.getDirectory方法的具体用法?Java IndexCommit.getDirectory怎么用?Java IndexCommit.getDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.index.IndexCommit
的用法示例。
在下文中一共展示了IndexCommit.getDirectory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getId
import org.apache.lucene.index.IndexCommit; //导入方法依赖的package包/类
private String getId(IndexCommit commit) {
StringBuilder sb = new StringBuilder();
Directory dir = commit.getDirectory();
// For anything persistent, make something that will
// be the same, regardless of the Directory instance.
if (dir instanceof FSDirectory) {
FSDirectory fsd = (FSDirectory) dir;
File fdir = fsd.getDirectory();
sb.append(fdir.getPath());
} else {
sb.append(dir);
}
sb.append('/');
sb.append(commit.getGeneration());
return sb.toString();
}
示例2: str
import org.apache.lucene.index.IndexCommit; //导入方法依赖的package包/类
static String str(IndexCommit commit) {
StringBuilder sb = new StringBuilder();
try {
sb.append("commit{");
Directory dir = commit.getDirectory();
if (dir instanceof FSDirectory) {
FSDirectory fsd = (FSDirectory) dir;
sb.append("dir=").append(fsd.getDirectory());
} else {
sb.append("dir=").append(dir);
}
sb.append(",segFN=").append(commit.getSegmentsFileName());
sb.append(",generation=").append(commit.getGeneration());
sb.append(",filenames=").append(commit.getFileNames());
} catch (Exception e) {
sb.append(e);
}
return sb.toString();
}
示例3: appendDetails
import org.apache.lucene.index.IndexCommit; //导入方法依赖的package包/类
protected void appendDetails(StringBuilder sb, IndexCommit c) {
Directory dir = c.getDirectory();
if (dir instanceof FSDirectory) {
FSDirectory fsd = (FSDirectory) dir;
sb.append("dir=").append(fsd.getDirectory());
} else {
sb.append("dir=").append(dir);
}
sb.append(",segFN=").append(c.getSegmentsFileName());
sb.append(",generation=").append(c.getGeneration());
}