<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 01/03/2011 11:41 PM, Joe Kumar wrote:
    <blockquote
      cite="mid:AANLkTimA=Nk-J+O9uOcm3rVyFUii=fs9uJtcR8=KBB1r@mail.gmail.com"
      type="cite"><font class="Apple-style-span" face="verdana,
        sans-serif">Hi all,</font>
      <div><font class="Apple-style-span" face="verdana, sans-serif"><br>
        </font></div>
      <div><font class="Apple-style-span" face="verdana, sans-serif">I've
          been trying out APIExamples.java and initially had issues
          with&nbsp;examples.search();</font></div>
      <div><font class="Apple-style-span" face="verdana, sans-serif">There
          was no index for the "Book" and so I modified getIndex(Book
          book) in&nbsp;LuceneIndexManager to create an index if there was no
          index</font></div>
      <div>
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <meta http-equiv="Content-Style-Type" content="text/css">
        <title></title>
        <meta name="Generator" content="Cocoa HTML Writer">
        <meta name="CocoaVersion" content="1038.35">
        <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
span.s1 {color: #a10067}
span.s2 {text-decoration: underline ; color: #2700ce}
span.s3 {text-decoration: underline}
</style>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><font class="Apple-style-span"
              color="#000000">&nbsp;</font><font class="Apple-style-span"
              color="#3333ff"><span class="s1">if</span> (reply == <span
                class="s1">null</span>) {</font></font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URI
            storage = getStorageArea(book);</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
              class="s1">if</span>(isIndexed(book)){</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            reply = <span class="s1">new</span> LuceneIndex(book,
            storage);</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
              class="s1">else</span>{</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            reply = <span class="s1">new</span> LuceneIndex(book,
            storage,<span class="s1">true</span>);</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
              class="s2">INDEXES</span><span class="s3">.put(book,
              reply)</span>;</font></p>
        <p class="p1"><font class="Apple-style-span" color="#3333ff"
            size="2" face="verdana, sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif"><br>
          </font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">After this change,
            examples.search worked fine.</font></p>
      </div>
    </blockquote>
    <br>
    I'll look into making that change. We need to make sure that index
    creation is still under the control of the end user.<br>
    <br>
    <blockquote
      cite="mid:AANLkTimA=Nk-J+O9uOcm3rVyFUii=fs9uJtcR8=KBB1r@mail.gmail.com"
      type="cite">
      <div>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">Now&nbsp;examples.rankedSearch();
            is failing with an OutOfMemory Error. Stacktrace is like
            below</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><br>
          </font></p>
        <p class="p1">
          <meta http-equiv="Content-Type" content="text/html;
            charset=ISO-8859-1">
          <meta http-equiv="Content-Style-Type" content="text/css">
          <title></title>
          <meta name="Generator" content="Cocoa HTML Writer">
          <meta name="CocoaVersion" content="1038.35">
          <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco; color: #ff0000}
span.s1 {text-decoration: underline ; color: #190094}
span.Apple-tab-span {white-space:pre}
</style></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif">org.crosswire.jsword.index.lucene.LuceneIndex(INFO):
            ParsedQuery-content:for content:god content:so content:loved
            content:the content:world</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif">&nbsp;Exception in thread "main"
            java.lang.OutOfMemoryError: Requested array size exceeds VM
            limit</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
            org.apache.lucene.util.PriorityQueue.initialize(<span
              class="s1">PriorityQueue.java:105</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
            org.apache.lucene.search.HitQueue.&lt;init&gt;(<span
              class="s1">HitQueue.java:67</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
            org.apache.lucene.search.TopScoreDocCollector.&lt;init&gt;(<span
              class="s1">TopScoreDocCollector.java:126</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
            org.apache.lucene.search.TopScoreDocCollector.&lt;init&gt;(<span
              class="s1">TopScoreDocCollector.java:37</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
org.apache.lucene.search.TopScoreDocCollector$OutOfOrderTopScoreDocCollector.&lt;init&gt;(<span
              class="s1">TopScoreDocCollector.java:74</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
org.apache.lucene.search.TopScoreDocCollector$OutOfOrderTopScoreDocCollector.&lt;init&gt;(<span
              class="s1">TopScoreDocCollector.java:72</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
            org.apache.lucene.search.TopScoreDocCollector.create(<span
              class="s1">TopScoreDocCollector.java:115</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><span class="Apple-tab-span"> </span>at
            org.crosswire.jsword.index.lucene.LuceneIndex.find(<span
              class="s1">LuceneIndex.java:263</span>)</font></p>
        <p class="p1"><font class="Apple-style-span" size="2"
            face="verdana, sans-serif"><br>
          </font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">I modified the VM args
            to&nbsp;-Xmx1024m -Xms1024m and still having this issue</font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">Has anyone else faced
            the same problem. is APIExamples working fine for everyone ?</font></p>
      </div>
    </blockquote>
    It is a problem for everyone. Seems Lucene has changed its internal
    implementation such that this way is now bad. I'll see about
    updating it soon.<br>
    Bible Desktop does not have the problem. So it is fixable.<br>
    <br>
    <blockquote
      cite="mid:AANLkTimA=Nk-J+O9uOcm3rVyFUii=fs9uJtcR8=KBB1r@mail.gmail.com"
      type="cite">
      <div>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">I am using Eclipse 3.5
            on OSX Snow Leopard.</font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif"><br>
          </font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">Any directions would be
            greatly appreciated.</font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif"><br>
          </font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif"><br>
          </font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">thanks</font></p>
        <p class="p1"><font class="Apple-style-span" color="#000000"
            size="2" face="verdana, sans-serif">Joe.</font></p>
        <p class="p1" style="font-family: Monaco;"><br>
        </p>
        <p class="p1" style="font-family: Monaco; font-size: 11px;"><br>
        </p>
        <p class="p1" style="font-family: Monaco; font-size: 11px;"><br>
        </p>
        <p class="p1" style="font-family: Monaco; font-size: 11px;">
          <br>
        </p>
        <p class="p1" style="font-family: Monaco; font-size: 11px;"><br>
        </p>
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        <meta http-equiv="Content-Style-Type" content="text/css">
        <title></title>
        <meta name="Generator" content="Cocoa HTML Writer">
        <meta name="CocoaVersion" content="1038.35">
        <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
</style></div>
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta http-equiv="Content-Style-Type" content="text/css">
      <title></title>
      <meta name="Generator" content="Cocoa HTML Writer">
      <meta name="CocoaVersion" content="1038.35">
      <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
</style>
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta http-equiv="Content-Style-Type" content="text/css">
      <title></title>
      <meta name="Generator" content="Cocoa HTML Writer">
      <meta name="CocoaVersion" content="1038.35">
      <style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Monaco}
</style>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
jsword-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:jsword-devel@crosswire.org">jsword-devel@crosswire.org</a>
<a class="moz-txt-link-freetext" href="http://www.crosswire.org/mailman/listinfo/jsword-devel">http://www.crosswire.org/mailman/listinfo/jsword-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>