oh, you mean lucene 4 trunk. LogByteSizeMergePolicy's default size is 2048MB(2GB) I did like this LogByteSizeMergePolicy mp=new LogByteSizeMergePolicy(); mp.setMaxMergeMB(1000000);
2010/12/27 Rok Rejc <rokrej...@gmail.com>: > Okej the same thing happens if i run optimize in java: > > File file = new File("e:\\myIndex\\index"); > Directory directory = FSDirectory.open(file); > > Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_40); > IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, > analyzer); > IndexWriter writer = new IndexWriter(directory, config); > writer.optimize(1, true); > writer.close(); > System.out.println("Finished"); > > The optmize finishes immediately but there are still 21 segments after the > optimize? > > Any clue what else should I set? > > > On Mon, Dec 27, 2010 at 8:08 AM, Rok Rejc <rokrej...@gmail.com> wrote: > >> Hi, there is nothing in the log, and the optimize finishes successfully: >> >> <response> >> <lst name="responseHeader"> >> <int name="status">0</int> >> <int name="QTime">17</int> >> </lst> >> </response> >> >> I run optmize through browser by entering url >> >> http://localhost:8080/myindex/update?optimize=true >> or >> http://localhost:8080/myindex/update?stream.body=<optimize/> >> >> Thanks. >> >> >> On Mon, Dec 27, 2010 at 7:12 AM, Li Li <fancye...@gmail.com> wrote: >> >>> maybe you can consult log files and it may show you something >>> btw how do you post your command? >>> do you use curl 'http://localhost:8983/solr/update?optimize=true' ? >>> or posting a xml file? >>> >>> 2010/12/27 Rok Rejc <rokrej...@gmail.com>: >>> > On Mon, Dec 27, 2010 at 3:26 AM, Li Li <fancye...@gmail.com> wrote: >>> > >>> >> see maxMergeDocs(maxMergeSize) in solrconfig.xml. if the segment's >>> >> documents size is larger than this value, it will not be merged. >>> >> >>> > >>> > I see that in my solrconfig.xml, but it is commented and marked as >>> > deprecated. I have uncommented this setting (so the value was >>> 2147483647) un >>> > run the optmize again but it finished immediately and still left 21 >>> > segments. >>> > >>> > Btw mergeFactor is set to 20, maxDoc is 121490241, the index will be >>> > "read-only". >>> > >>> > Thanks. >>> > >>> >> >> >