Re: obtaining the number of documents stored in a .cfs file

2006-10-26 Thread Volodymyr Bychkoviak
one mistake in this code should be infos.counter = ++counter; instead of infos.counter = counter++; Volodymyr Bychkoviak wrote: I've used following code to recover index. Note: it only works with .cfs files. String path = // path to index File file = new File(path); Directory d

Re: obtaining the number of documents stored in a .cfs file

2006-09-06 Thread Volodymyr Bychkoviak
One more note: this should be in package 'org.apache.lucene.index;' because it uses some package visible classes :) Volodymyr Bychkoviak wrote: I've used following code to recover index. Note: it only works with .cfs files. String path = // path to index File file = new File(path);

Re: obtaining the number of documents stored in a .cfs file

2006-09-06 Thread Volodymyr Bychkoviak
I've used following code to recover index. Note: it only works with .cfs files. String path = // path to index File file = new File(path); Directory directory = FSDirectory.getDirectory(file, false); String[] files = file.list(new FilenameFilter() { public boolean accept(File

Re: obtaining the number of documents stored in a .cfs file

2006-09-05 Thread Andrzej Bialecki
Stanislav Jordanov wrote: Suppose I have a bunch of valid .cfs files while the segmens/segments.new file is missing or invalid. The task is to 'recover' the present .cfs files into a valid index. I think it will be necessary and sufficient to create a segments file that references the .cfs file

obtaining the number of documents stored in a .cfs file

2006-09-05 Thread Stanislav Jordanov
Suppose I have a bunch of valid .cfs files while the segmens/segments.new file is missing or invalid. The task is to 'recover' the present .cfs files into a valid index. I think it will be necessary and sufficient to create a segments file that references the .cfs files. The only problem I've en