lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anshum <ansh...@gmail.com>
Subject Re: Lucene Index taking a lot to time
Date Wed, 29 Oct 2008 05:01:57 GMT
Was there something that you changed or some disk issues?
The code seemed fine. Moreover, I could have asked the version of lucene you
are using, but that seems out of question for the issue as you say that it
is just the same indexer running on the same source and machine that is now
taking longer.
Correct me if 'm wrong!
Could you also add markers(prints) to check what is it that is taking more
time. Plus in case you are using an older variant of lucene (or had upgraded
recently) that could be the issue. i.e. you might be having 2 jars in the
same directory(your classpath) which now picks up older lucene, thereby
taking more time as compared to the older thing(which had no conflict in the
jar)

--
Anshum Gupta
Naukri Labs!
http://ai-cafe.blogspot.com

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............


On Wed, Oct 29, 2008 at 2:03 AM, Birendar Singh Waldiya -X (bwaldiya - TCS
at Cisco) <bwaldiya@cisco.com> wrote:

> Hi Gurus,
>
> We are using Lucene for creating indexes on some database column  and
> suddenly my indexcreation time sems to have increased considerably,
>
> Here is the code snippet we are using ,  we are wondering how come the
> index creation has increaed suddenly..any pointer please
>
> Date start = new Date();
>   Map inputParams = new HashMap();
>         IndexWriter writer = new
> IndexWriter(SDSUtil.getSDLuceneIndexDirectory(), new
> StandardAnalyzer(),true, IndexWriter.MaxFieldLength.UNLIMITED);
>   //IndexWriter writer = new
> IndexWriter(SDSUtil.getSDLuceneIndexDirectory(), new
> StandardAnalyzer());
>   logger.info("Adding records - Before creating Lucene Index");
>   CreateLuceneIndexPr createLuceneIndexPr = new
> CreateLuceneIndexPr(sdsJdbcTemplate, writer);
>   Map outParams = createLuceneIndexPr.execute(inputParams);
>
>   //now add partner Exceptions also to index
>   List ptnrExcpnList = getPartnerExceptionList("vipmistr"); //TODO:
> change it:passing userId as blank to get all prtnr Excpns
>
>  for (Iterator iter = ptnrExcpnList.iterator(); iter.hasNext();) {
>    PartnerException partnerException = (PartnerException) iter.next();
>    Document doc = new Document();
>    doc.add(new Field("intd_id", "",
> org.apache.lucene.document.Field.Store.NO,
> org.apache.lucene.document.Field.Index.NOT_ANALYZED));
>             doc.add(new Field("cntry_id", "",
> org.apache.lucene.document.Field.Store.NO,
> org.apache.lucene.document.Field.Index.NOT_ANALYZED));
>             doc.add(new Field("Technology_Node", "",
> org.apache.lucene.document.Field.Store.YES,
> org.apache.lucene.document.Field.Index.NO));
>             doc.add(new Field("product_id", "",
> org.apache.lucene.document.Field.Store.NO,
> org.apache.lucene.document.Field.Index.NOT_ANALYZED));
>             doc.add(new Field("RULE_AUT_SPEC", "",
> org.apache.lucene.document.Field.Store.YES,
> org.apache.lucene.document.Field.Index.NO));
>             doc.add(new Field("ptnrExcpn",
> partnerException.getPgtmvBeId(),
> org.apache.lucene.document.Field.Store.YES,
> org.apache.lucene.document.Field.Index.NOT_ANALYZED));
>             writer.addDocument(doc);
>   }
>   logger.info("Optimizing...");
>   writer.optimize();
>   writer.close();
>   Date end = new Date();
>   logger.info("#################Index Create Time :-->>>>> " +
> (end.getTime() - start.getTime()) + " milliseconds");
>  } catch (Exception e) {
>   if (e instanceof DAOException) {
>    throw (DAOException) e;
>   } else {
>    e.printStackTrace();
>    throw new DAOSystemException("error.admin.error",e);
>   }
>  }
>  }
>
>
>
> --------------------------
> Thanks & Regards
> Birendar
> Ph#919-392-5181
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message