this is the way im indexing the file:

    FileInputStream fr = new FileInputStream(file);
    BufferedInputStream bfr = new BufferedInputStream(fr);
    DataInputStream dbfr = new DataInputStream(bfr);

    while(dbfr.available()!=0){
        String line = dbfr.readLine();
        if(line!=null){

            String[] id_name = line.split("\t");

            //Mind RUB_Mind_1015181 Mind / DAY_TEST 6 bism 1
RUB_Mind_1015181 REP_Boenning

            String section = id_name[0];
            String id = id_name[1];
            String name = id_name[2];

            System.out.println(name);
            //String remCount = id_name[3];
            String remname = id_name[3];
            String remmarks = id_name[4];
            String remrid = id_name[5];
            String remauthid = id_name[6];

            String rubnum = remrid.substring(remrid.lastIndexOf("_")+1,
remrid.length());

            //String content =
section+"\t"+name+"\t"+remname+"\t"+remmarks+"\t"+remauthid;
            Document doc = new Document();

            //doc.add(new
Field("contents",content,Field.Store.COMPRESS,Field.Index.ANALYZED));
            doc.add(new
Field("contents",name,Field.Store.YES,Field.Index.ANALYZED));
            doc.add(new
Field("title",id,Field.Store.YES,Field.Index.ANALYZED));
            doc.add(new
Field("section",section,Field.Store.YES,Field.Index.ANALYZED));
            //doc.add(new
Field("remcount",remCount,Field.Store.YES,Field.Index.NOT_ANALYZED));
            doc.add(new
Field("remname",remname,Field.Store.YES,Field.Index.ANALYZED));
            doc.add(new
Field("remmarks",remmarks,Field.Store.YES,Field.Index.ANALYZED));
            doc.add(new
Field("remrid",remrid,Field.Store.YES,Field.Index.ANALYZED));
            doc.add(new
Field("remauthid",remauthid,Field.Store.YES,Field.Index.ANALYZED));
            doc.add(new
Field("rubnum",rubnum,Field.Store.YES,Field.Index.ANALYZED));

            writer.addDocument(doc);


        }
    }


On Mon, Jun 24, 2013 at 2:31 PM, neeraj shah <neerajsha...@gmail.com> wrote:

> so how can i solve this and reduce time?
>
>
> On Mon, Jun 24, 2013 at 2:21 PM, Roberto Ragusa <m...@robertoragusa.it>wrote:
>
>> On 06/24/2013 08:38 AM, neeraj shah wrote:
>> > 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 :
>> >
>> >
>> >            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);
>> >
>> >
>> >            }
>>
>> You are doing 3 doc.get per result; those 400,000 calls are killing you.
>> Do you see disk activity or is it entirely cached?
>> What operating system are you running on?
>>
>>
>> --
>>    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

Reply via email to