10,000 개의 문서를 IndexWriter에 추가 한 작은 루프를 작성하여이를 수행하는 데 오래 걸렸습니다.Lucene IndexWriter 문서를 추가하는 속도가 느림
많은 양의 문서를 색인하는 또 다른 방법이 있습니까?
라이브가되면 15,000 개의 레코드를로드해야하기 때문에 질문합니다.
또 다른 질문은 웹 응용 프로그램을 다시 시작할 때 모든 레코드를 다시로드하지 않아도되는 방법입니다. 편집
제가 사용되는 코드이며;
for (int t = 0; t < 10000; t++){
doc = new Document();
text = "Value" + t.toString();
doc.Add(new Field("Value", text, Field.Store.YES, Field.Index.TOKENIZED));
iwriter.AddDocument(doc);
};
편집
Analyzer analyzer = new StandardAnalyzer();
Directory directory = new RAMDirectory();
IndexWriter iwriter = new IndexWriter(directory, analyzer, true);
iwriter.SetMaxFieldLength(25000);
(2) 다음의 코드는 다음, 문서를 추가 할;
iwriter.Close();
얼마나 오래 되었습니까? –
약 2.5 ~ 3 분이 소요되었습니다. 예상 되나요? – griegs
문서에 단일 필드가 있고 필드의 값이 "value"+ t.toString() 인 것으로 추가해야합니다. 매우 작음 – griegs