My hit size is 127674 and even if i comment the remedy fetching code ( the second search in for loop) still its taking very long time. This is the code which im using without Remedy fetching code :
StandardAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_36); IndexReader reader = IndexReader.open(FSDirectory.open(new File("C:/hierarchy/idname/index"))); final IndexSearcher searcher = new IndexSearcher(reader); Query qu = new QueryParser(Version.LUCENE_36,"remname", analyzer).parse(query); //Sort sort = new Sort(new SortField("contents",SortField.STRING)); TopDocs hits = searcher.search(qu,searcher.maxDoc()); final ScoreDoc[] arrScoreDoc = hits.scoreDocs; System.out.println("hit size: "+arrScoreDoc.length); for(int k=0;k<arrScoreDoc.length;k++){ Document doc = searcher.doc(arrScoreDoc[k].doc); String remrid = doc.get("remrid"); SearchHit o = new SearchHit(); String contents = doc.get("contents"); String section = doc.get("section"); o.setContents(contents.replaceAll("/", " ; ")); o.setSection(section); o.setRemrid(remrid); } On Mon, Jun 24, 2013 at 12:01 PM, neeraj shah <neerajsha...@gmail.com>wrote: > > its 137MB only. > > my code id is: > > StandardAnalyzer analyzer = new > StandardAnalyzer(Version.LUCENE_36); > IndexReader reader = IndexReader.open(FSDirectory.open(new > File("C:/hierarchy/idname/index"))); > IndexSearcher searcher = new IndexSearcher(reader); > Query qu = new QueryParser(Version.LUCENE_36,"remname", > analyzer).parse(query); > > TopDocs hits = searcher.search(qu,searcher.maxDoc()); > final ScoreDoc[] arrScoreDoc = hits.scoreDocs; > System.out.println("hit size: "+arrScoreDoc.length); > > List lstRubricIdsAdded = new ArrayList(); > > for(int k=0;k<arrScoreDoc.length;k++){ > Document doc = searcher.doc(arrScoreDoc[k].doc); > String remrid = doc.get("remrid"); > > if(!lstRubricIdsAdded.contains(remrid)){ > lstRubricIdsAdded.add(remrid); > > SearchHit o = new SearchHit(); > String contents = doc.get("contents"); > String section = doc.get("section"); > > o.setContents(contents.replaceAll("/", " ; ")); > o.setSection(section); > o.setRemrid(remrid); > > Query q = new QueryParser(Version.LUCENE_36,"remrid", > analyzer).parse(remrid); > TopDocs hitsRubId = searcher.search(q,searcher.maxDoc()); > ScoreDoc[] arrRubIdScoreDoc = hitsRubId.scoreDocs; > > for(int h=0;h<arrRubIdScoreDoc.length;h++){ > Document docRem = > searcher.doc(arrRubIdScoreDoc[h].doc); > > String remmarks = docRem.get("remmarks"); > String remauthid = docRem.get("remauthid"); > String remname = doc.get("remname"); > > Remedy remedy = new Remedy(remname); > > remedy.setRubricID(remrid); > remedy.setAuhtorId(remauthid); > int mark = Integer.parseInt(remmarks); > remedy.setMarks(mark); > > > remedy.setAuhtorAbbrivation(auth.get(remauthid.toLowerCase().trim()).toString()); > > o.getRemedyInList().add(remedy); > > } > > } > } > > this code is taking very long time. > > > On Sat, Jun 22, 2013 at 6:52 PM, Roberto Ragusa <m...@robertoragusa.it>wrote: > >> On 06/22/2013 11:38 AM, neeraj shah wrote: >> > i have already tried this. I am fetching the info of "ABC" and then >> passing >> > then again in searcher with new Query then adding the required result. >> > but this method taking very very long time (more than 100 secs). my data >> > file is very big size would be around 137MB. >> > So was asking is there another way to get the result in Lucene. >> >> 100 secs? >> And you are calling 137MB a very big size? >> >> Something doesn't feel right. >> >> Are you doing two searches (1+1) or a lot of them (1+N)? >> I really reread your mail a few times to understand if I had misread >> seconds for milliseconds or MB for GB... >> >> -- >> Roberto Ragusa mail at robertoragusa.it >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> > > > -- > With Regards, > Neeraj Kumar Shah > +919819474146 > -- With Regards, Neeraj Kumar Shah +919819474146