<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 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 LuceneIndexManager to create an index if there was no index</font></div><div>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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"> </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" size="2" color="#3333FF" face="verdana, sans-serif"> URI storage = getStorageArea(book);</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> <span class="s1">if</span>(isIndexed(book)){</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> reply = <span class="s1">new</span> LuceneIndex(book, storage);</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> }</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> <span class="s1">else</span>{</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> reply = <span class="s1">new</span> LuceneIndex(book, storage,<span class="s1">true</span>);</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> }</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> <span class="s2">INDEXES</span><span class="s3">.put(book, reply)</span>;</font></p>
<p class="p1"><font class="Apple-style-span" size="2" color="#3333FF" face="verdana, sans-serif"> }</font></p><p class="p1"><font class="Apple-style-span" size="2" color="#000000" face="verdana, sans-serif"><br>
</font></p><p class="p1"><font class="Apple-style-span" size="2" color="#000000" face="verdana, sans-serif">After this change, examples.search worked fine.</font></p><p class="p1"><font class="Apple-style-span" size="2" color="#000000" face="verdana, sans-serif">Now examples.rankedSearch(); is failing with an OutOfMemory Error. Stacktrace is like below</font></p>
<p class="p1"><font class="Apple-style-span" face="verdana, sans-serif" size="2"><br></font></p><p class="p1"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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" face="verdana, sans-serif" size="2">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" face="verdana, sans-serif" size="2"> Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit</font></p>
<p class="p1"><font class="Apple-style-span" face="verdana, sans-serif" size="2"><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" face="verdana, sans-serif" size="2"><span class="Apple-tab-span">        </span>at org.apache.lucene.search.HitQueue.<init>(<span class="s1">HitQueue.java:67</span>)</font></p>
<p class="p1"><font class="Apple-style-span" face="verdana, sans-serif" size="2"><span class="Apple-tab-span">        </span>at org.apache.lucene.search.TopScoreDocCollector.<init>(<span class="s1">TopScoreDocCollector.java:126</span>)</font></p>
<p class="p1"><font class="Apple-style-span" face="verdana, sans-serif" size="2"><span class="Apple-tab-span">        </span>at org.apache.lucene.search.TopScoreDocCollector.<init>(<span class="s1">TopScoreDocCollector.java:37</span>)</font></p>
<p class="p1"><font class="Apple-style-span" face="verdana, sans-serif" size="2"><span class="Apple-tab-span">        </span>at org.apache.lucene.search.TopScoreDocCollector$OutOfOrderTopScoreDocCollector.<init>(<span class="s1">TopScoreDocCollector.java:74</span>)</font></p>
<p class="p1"><font class="Apple-style-span" face="verdana, sans-serif" size="2"><span class="Apple-tab-span">        </span>at org.apache.lucene.search.TopScoreDocCollector$OutOfOrderTopScoreDocCollector.<init>(<span class="s1">TopScoreDocCollector.java:72</span>)</font></p>
<p class="p1"><font class="Apple-style-span" face="verdana, sans-serif" size="2"><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" face="verdana, sans-serif" size="2"><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" face="verdana, sans-serif" size="2"><br></font></p><p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2">I modified the VM args to -Xmx1024m -Xms1024m and still having this issue</font></p>
<p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2">Has anyone else faced the same problem. is APIExamples working fine for everyone ?</font></p><p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2">I am using Eclipse 3.5 on OSX Snow Leopard.</font></p>
<p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2"><br></font></p><p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2">Any directions would be greatly appreciated.</font></p>
<p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2"><br></font></p><p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2"><br></font></p>
<p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2">thanks</font></p><p class="p1"><font class="Apple-style-span" color="#000000" face="verdana, sans-serif" size="2">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><p></p>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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=UTF-8">
<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=UTF-8">
<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>