jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From field...@apache.org
Subject svn commit: r151075 [15/15] - in incubator/jackrabbit/site: ./ apidocs/ apidocs/org/apache/jackrabbit/core/ apidocs/org/apache/jackrabbit/core/class-use/ apidocs/org/apache/jackrabbit/core/state/ apidocs/org/apache/jackrabbit/core/state/mem/ apidocs/org/apache/jackrabbit/core/state/obj/ apidocs/org/apache/jackrabbit/core/state/xml/ apidocs/org/apache/jackrabbit/core/version/ apidocs/org/apache/jackrabbit/core/version/persistence/ apidocs/org/apache/jackrabbit/core/xml/ xref-test/ xref-test/org/apache/jackrabbit/test/ xref-test/org/apache/jackrabbit/test/api/ xref-test/org/apache/jackrabbit/test/api/version/ xref-test/org/apache/jackrabbit/test/observation/ xref-test/org/apache/jackrabbit/test/search/ xref/org/apache/jackrabbit/core/ xref/org/apache/jackrabbit/core/search/lucene/
Date Wed, 02 Feb 2005 22:41:20 GMT
Modified: incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/search/lucene/NodeIndexer.html
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/search/lucene/NodeIndexer.html?view=diff&r1=151074&r2=151075
==============================================================================
--- incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/search/lucene/NodeIndexer.html
(original)
+++ incubator/jackrabbit/site/xref/org/apache/jackrabbit/core/search/lucene/NodeIndexer.html
Wed Feb  2 14:40:59 2005
@@ -156,127 +156,130 @@
 <a name="147" href="#147">147</a>                     }
 <a name="148" href="#148">148</a>                 } <strong>else</strong>
{
 <a name="149" href="#149">149</a>                     <em class="comment">//
single value</em>
-<a name="150" href="#150">150</a>                     addValue(doc, values[0],
propState.getName(), false);
-<a name="151" href="#151">151</a>                 }
-<a name="152" href="#152">152</a>             } <strong>catch</strong>
(NoSuchItemStateException e) {
-<a name="153" href="#153">153</a>                 <strong>throw</strong>
<strong>new</strong> RepositoryException(<span class="string">"Error while
indexing node: "</span> + node.getUUID(), e);
-<a name="154" href="#154">154</a>             } <strong>catch</strong>
(ItemStateException e) {
-<a name="155" href="#155">155</a>                 <strong>throw</strong>
<strong>new</strong> RepositoryException(<span class="string">"Error while
indexing node: "</span> + node.getUUID(), e);
-<a name="156" href="#156">156</a>             }
-<a name="157" href="#157">157</a>         }
-<a name="158" href="#158">158</a>         <strong>return</strong>
doc;
-<a name="159" href="#159">159</a>     }
-<a name="160" href="#160">160</a> 
-<a name="161" href="#161">161</a>     <em>/**<em>*</em></em>
-<a name="162" href="#162">162</a> <em>     * Adds a value to the lucene
Document.</em>
-<a name="163" href="#163">163</a> <em>     *</em>
-<a name="164" href="#164">164</a> <em>     * @param doc   the document.</em>
-<a name="165" href="#165">165</a> <em>     * @param value the internal
jackrabbit value.</em>
-<a name="166" href="#166">166</a> <em>     * @param name  the name of the
property.</em>
-<a name="167" href="#167">167</a> <em>     * @param multiValued if &lt;code>true&lt;/code>
the value is treated as a</em>
-<a name="168" href="#168">168</a> <em>     *   multivalued.</em>
-<a name="169" href="#169">169</a> <em>     */</em>
-<a name="170" href="#170">170</a>     <strong>private</strong> <strong>void</strong>
addValue(Document doc, <a href="../../../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>
value, <a href="../../../../../../org/apache/jackrabbit/core/QName.html">QName</a>
name, <strong>boolean</strong> multiValued) {
-<a name="171" href="#171">171</a>         String fieldName = name.getLocalName();
-<a name="172" href="#172">172</a>         <strong>try</strong> {
-<a name="173" href="#173">173</a>             StringBuffer tmp = <strong>new</strong>
StringBuffer();
-<a name="174" href="#174">174</a>             tmp.append(mappings.getPrefix(name.getNamespaceURI()));
-<a name="175" href="#175">175</a>             tmp.append(':');
-<a name="176" href="#176">176</a>             <strong>if</strong>
(multiValued) {
-<a name="177" href="#177">177</a>                 tmp.append(FieldNames.MVP_PREFIX);
-<a name="178" href="#178">178</a>             }
-<a name="179" href="#179">179</a>             tmp.append(name.getLocalName());
-<a name="180" href="#180">180</a>             fieldName = tmp.toString();
-<a name="181" href="#181">181</a>         } <strong>catch</strong>
(NamespaceException e) {
-<a name="182" href="#182">182</a>             <em class="comment">// will
never happen</em>
-<a name="183" href="#183">183</a>         }
-<a name="184" href="#184">184</a>         Object internalValue = value.internalValue();
-<a name="185" href="#185">185</a>         <strong>switch</strong>
(value.getType()) {
-<a name="186" href="#186">186</a>             <strong>case</strong>
PropertyType.BINARY:
-<a name="187" href="#187">187</a>                 <em class="comment">//
don't know how to index -> ignore</em>
-<a name="188" href="#188">188</a>                 <strong>break</strong>;
-<a name="189" href="#189">189</a>             <strong>case</strong>
PropertyType.BOOLEAN:
-<a name="190" href="#190">190</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="191" href="#191">191</a>                         internalValue.toString(),
-<a name="192" href="#192">192</a>                         false,
-<a name="193" href="#193">193</a>                         <strong>true</strong>,
-<a name="194" href="#194">194</a>                         false));
-<a name="195" href="#195">195</a>                 <strong>break</strong>;
-<a name="196" href="#196">196</a>             <strong>case</strong>
PropertyType.DATE:
-<a name="197" href="#197">197</a>                 <strong>long</strong>
millis = ((Calendar) internalValue).getTimeInMillis();
-<a name="198" href="#198">198</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="199" href="#199">199</a>                         DateField.timeToString(millis),
-<a name="200" href="#200">200</a>                         false,
-<a name="201" href="#201">201</a>                         <strong>true</strong>,
-<a name="202" href="#202">202</a>                         false));
-<a name="203" href="#203">203</a>                 <strong>break</strong>;
-<a name="204" href="#204">204</a>             <strong>case</strong>
PropertyType.DOUBLE:
-<a name="205" href="#205">205</a>                 <strong>double</strong>
<strong>double</strong>Val = ((Double) internalValue).<strong>double</strong>Value();
-<a name="206" href="#206">206</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="207" href="#207">207</a>                         DoubleField.doubleToString(doubleVal),
-<a name="208" href="#208">208</a>                         false,
-<a name="209" href="#209">209</a>                         <strong>true</strong>,
-<a name="210" href="#210">210</a>                         false));
-<a name="211" href="#211">211</a>                 <strong>break</strong>;
-<a name="212" href="#212">212</a>             <strong>case</strong>
PropertyType.LONG:
-<a name="213" href="#213">213</a>                 <strong>long</strong>
<strong>long</strong>Val = ((Long) internalValue).<strong>long</strong>Value();
-<a name="214" href="#214">214</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="215" href="#215">215</a>                         LongField.longToString(longVal),
-<a name="216" href="#216">216</a>                         false,
-<a name="217" href="#217">217</a>                         <strong>true</strong>,
-<a name="218" href="#218">218</a>                         false));
-<a name="219" href="#219">219</a>                 <strong>break</strong>;
-<a name="220" href="#220">220</a>             <strong>case</strong>
PropertyType.REFERENCE:
-<a name="221" href="#221">221</a>                 String uuid = internalValue.toString();
-<a name="222" href="#222">222</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="223" href="#223">223</a>                         uuid,
-<a name="224" href="#224">224</a>                         false,
-<a name="225" href="#225">225</a>                         <strong>true</strong>,
-<a name="226" href="#226">226</a>                         false));
-<a name="227" href="#227">227</a>                 <strong>break</strong>;
-<a name="228" href="#228">228</a>             <strong>case</strong>
PropertyType.PATH:
-<a name="229" href="#229">229</a>                 String path = internalValue.toString();
-<a name="230" href="#230">230</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="231" href="#231">231</a>                         path,
-<a name="232" href="#232">232</a>                         false,
-<a name="233" href="#233">233</a>                         <strong>true</strong>,
-<a name="234" href="#234">234</a>                         false));
-<a name="235" href="#235">235</a>                 <strong>break</strong>;
-<a name="236" href="#236">236</a>             <strong>case</strong>
PropertyType.STRING:
-<a name="237" href="#237">237</a>                 <em class="comment">//
simple String</em>
-<a name="238" href="#238">238</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="239" href="#239">239</a>                         internalValue.toString(),
-<a name="240" href="#240">240</a>                         false,
-<a name="241" href="#241">241</a>                         <strong>true</strong>,
-<a name="242" href="#242">242</a>                         false));
-<a name="243" href="#243">243</a>                 <em class="comment">//
also create fulltext index of this value</em>
-<a name="244" href="#244">244</a>                 doc.add(<strong>new</strong>
Field(FieldNames.FULLTEXT,
-<a name="245" href="#245">245</a>                         internalValue.toString(),
-<a name="246" href="#246">246</a>                         false,
-<a name="247" href="#247">247</a>                         <strong>true</strong>,
-<a name="248" href="#248">248</a>                         <strong>true</strong>));
-<a name="249" href="#249">249</a>                 <strong>break</strong>;
-<a name="250" href="#250">250</a>             <strong>case</strong>
PropertyType.NAME:
-<a name="251" href="#251">251</a>                 <a href="../../../../../../org/apache/jackrabbit/core/QName.html">QName</a>
qualiName = (QName) internalValue;
-<a name="252" href="#252">252</a>                 String normValue = internalValue.toString();
-<a name="253" href="#253">253</a>                 <strong>try</strong>
{
-<a name="254" href="#254">254</a>                     normValue = mappings.getPrefix(qualiName.getNamespaceURI())
-<a name="255" href="#255">255</a>                             + <span class="string">":"</span>
+ qualiName.getLocalName();
-<a name="256" href="#256">256</a>                 } <strong>catch</strong>
(NamespaceException e) {
-<a name="257" href="#257">257</a>                     <em class="comment">//
will never happen</em>
-<a name="258" href="#258">258</a>                 }
-<a name="259" href="#259">259</a>                 doc.add(<strong>new</strong>
Field(fieldName,
-<a name="260" href="#260">260</a>                         normValue,
-<a name="261" href="#261">261</a>                         false,
-<a name="262" href="#262">262</a>                         <strong>true</strong>,
-<a name="263" href="#263">263</a>                         false));
-<a name="264" href="#264">264</a>                 <strong>break</strong>;
-<a name="265" href="#265">265</a>             <strong>default</strong>:
-<a name="266" href="#266">266</a>                 <strong>throw</strong>
<strong>new</strong> IllegalArgumentException(<span class="string">"illegal
internal value type"</span>);
-<a name="267" href="#267">267</a>         }
-<a name="268" href="#268">268</a>     }
-<a name="269" href="#269">269</a> 
-<a name="270" href="#270">270</a> }
+<a name="150" href="#150">150</a>                     <em class="comment">//
do we have a value at all?</em>
+<a name="151" href="#151">151</a>                     <strong>if</strong>
(values.length == 1) {
+<a name="152" href="#152">152</a>                         addValue(doc, values[0],
propState.getName(), false);
+<a name="153" href="#153">153</a>                     }
+<a name="154" href="#154">154</a>                 }
+<a name="155" href="#155">155</a>             } <strong>catch</strong>
(NoSuchItemStateException e) {
+<a name="156" href="#156">156</a>                 <strong>throw</strong>
<strong>new</strong> RepositoryException(<span class="string">"Error while
indexing node: "</span> + node.getUUID(), e);
+<a name="157" href="#157">157</a>             } <strong>catch</strong>
(ItemStateException e) {
+<a name="158" href="#158">158</a>                 <strong>throw</strong>
<strong>new</strong> RepositoryException(<span class="string">"Error while
indexing node: "</span> + node.getUUID(), e);
+<a name="159" href="#159">159</a>             }
+<a name="160" href="#160">160</a>         }
+<a name="161" href="#161">161</a>         <strong>return</strong>
doc;
+<a name="162" href="#162">162</a>     }
+<a name="163" href="#163">163</a> 
+<a name="164" href="#164">164</a>     <em>/**<em>*</em></em>
+<a name="165" href="#165">165</a> <em>     * Adds a value to the lucene
Document.</em>
+<a name="166" href="#166">166</a> <em>     *</em>
+<a name="167" href="#167">167</a> <em>     * @param doc   the document.</em>
+<a name="168" href="#168">168</a> <em>     * @param value the internal
jackrabbit value.</em>
+<a name="169" href="#169">169</a> <em>     * @param name  the name of the
property.</em>
+<a name="170" href="#170">170</a> <em>     * @param multiValued if &lt;code>true&lt;/code>
the value is treated as a</em>
+<a name="171" href="#171">171</a> <em>     *   multivalued.</em>
+<a name="172" href="#172">172</a> <em>     */</em>
+<a name="173" href="#173">173</a>     <strong>private</strong> <strong>void</strong>
addValue(Document doc, <a href="../../../../../../org/apache/jackrabbit/core/InternalValue.html">InternalValue</a>
value, <a href="../../../../../../org/apache/jackrabbit/core/QName.html">QName</a>
name, <strong>boolean</strong> multiValued) {
+<a name="174" href="#174">174</a>         String fieldName = name.getLocalName();
+<a name="175" href="#175">175</a>         <strong>try</strong> {
+<a name="176" href="#176">176</a>             StringBuffer tmp = <strong>new</strong>
StringBuffer();
+<a name="177" href="#177">177</a>             tmp.append(mappings.getPrefix(name.getNamespaceURI()));
+<a name="178" href="#178">178</a>             tmp.append(':');
+<a name="179" href="#179">179</a>             <strong>if</strong>
(multiValued) {
+<a name="180" href="#180">180</a>                 tmp.append(FieldNames.MVP_PREFIX);
+<a name="181" href="#181">181</a>             }
+<a name="182" href="#182">182</a>             tmp.append(name.getLocalName());
+<a name="183" href="#183">183</a>             fieldName = tmp.toString();
+<a name="184" href="#184">184</a>         } <strong>catch</strong>
(NamespaceException e) {
+<a name="185" href="#185">185</a>             <em class="comment">// will
never happen</em>
+<a name="186" href="#186">186</a>         }
+<a name="187" href="#187">187</a>         Object internalValue = value.internalValue();
+<a name="188" href="#188">188</a>         <strong>switch</strong>
(value.getType()) {
+<a name="189" href="#189">189</a>             <strong>case</strong>
PropertyType.BINARY:
+<a name="190" href="#190">190</a>                 <em class="comment">//
don't know how to index -> ignore</em>
+<a name="191" href="#191">191</a>                 <strong>break</strong>;
+<a name="192" href="#192">192</a>             <strong>case</strong>
PropertyType.BOOLEAN:
+<a name="193" href="#193">193</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="194" href="#194">194</a>                         internalValue.toString(),
+<a name="195" href="#195">195</a>                         false,
+<a name="196" href="#196">196</a>                         <strong>true</strong>,
+<a name="197" href="#197">197</a>                         false));
+<a name="198" href="#198">198</a>                 <strong>break</strong>;
+<a name="199" href="#199">199</a>             <strong>case</strong>
PropertyType.DATE:
+<a name="200" href="#200">200</a>                 <strong>long</strong>
millis = ((Calendar) internalValue).getTimeInMillis();
+<a name="201" href="#201">201</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="202" href="#202">202</a>                         DateField.timeToString(millis),
+<a name="203" href="#203">203</a>                         false,
+<a name="204" href="#204">204</a>                         <strong>true</strong>,
+<a name="205" href="#205">205</a>                         false));
+<a name="206" href="#206">206</a>                 <strong>break</strong>;
+<a name="207" href="#207">207</a>             <strong>case</strong>
PropertyType.DOUBLE:
+<a name="208" href="#208">208</a>                 <strong>double</strong>
<strong>double</strong>Val = ((Double) internalValue).<strong>double</strong>Value();
+<a name="209" href="#209">209</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="210" href="#210">210</a>                         DoubleField.doubleToString(doubleVal),
+<a name="211" href="#211">211</a>                         false,
+<a name="212" href="#212">212</a>                         <strong>true</strong>,
+<a name="213" href="#213">213</a>                         false));
+<a name="214" href="#214">214</a>                 <strong>break</strong>;
+<a name="215" href="#215">215</a>             <strong>case</strong>
PropertyType.LONG:
+<a name="216" href="#216">216</a>                 <strong>long</strong>
<strong>long</strong>Val = ((Long) internalValue).<strong>long</strong>Value();
+<a name="217" href="#217">217</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="218" href="#218">218</a>                         LongField.longToString(longVal),
+<a name="219" href="#219">219</a>                         false,
+<a name="220" href="#220">220</a>                         <strong>true</strong>,
+<a name="221" href="#221">221</a>                         false));
+<a name="222" href="#222">222</a>                 <strong>break</strong>;
+<a name="223" href="#223">223</a>             <strong>case</strong>
PropertyType.REFERENCE:
+<a name="224" href="#224">224</a>                 String uuid = internalValue.toString();
+<a name="225" href="#225">225</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="226" href="#226">226</a>                         uuid,
+<a name="227" href="#227">227</a>                         false,
+<a name="228" href="#228">228</a>                         <strong>true</strong>,
+<a name="229" href="#229">229</a>                         false));
+<a name="230" href="#230">230</a>                 <strong>break</strong>;
+<a name="231" href="#231">231</a>             <strong>case</strong>
PropertyType.PATH:
+<a name="232" href="#232">232</a>                 String path = internalValue.toString();
+<a name="233" href="#233">233</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="234" href="#234">234</a>                         path,
+<a name="235" href="#235">235</a>                         false,
+<a name="236" href="#236">236</a>                         <strong>true</strong>,
+<a name="237" href="#237">237</a>                         false));
+<a name="238" href="#238">238</a>                 <strong>break</strong>;
+<a name="239" href="#239">239</a>             <strong>case</strong>
PropertyType.STRING:
+<a name="240" href="#240">240</a>                 <em class="comment">//
simple String</em>
+<a name="241" href="#241">241</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="242" href="#242">242</a>                         internalValue.toString(),
+<a name="243" href="#243">243</a>                         false,
+<a name="244" href="#244">244</a>                         <strong>true</strong>,
+<a name="245" href="#245">245</a>                         false));
+<a name="246" href="#246">246</a>                 <em class="comment">//
also create fulltext index of this value</em>
+<a name="247" href="#247">247</a>                 doc.add(<strong>new</strong>
Field(FieldNames.FULLTEXT,
+<a name="248" href="#248">248</a>                         internalValue.toString(),
+<a name="249" href="#249">249</a>                         false,
+<a name="250" href="#250">250</a>                         <strong>true</strong>,
+<a name="251" href="#251">251</a>                         <strong>true</strong>));
+<a name="252" href="#252">252</a>                 <strong>break</strong>;
+<a name="253" href="#253">253</a>             <strong>case</strong>
PropertyType.NAME:
+<a name="254" href="#254">254</a>                 <a href="../../../../../../org/apache/jackrabbit/core/QName.html">QName</a>
qualiName = (QName) internalValue;
+<a name="255" href="#255">255</a>                 String normValue = internalValue.toString();
+<a name="256" href="#256">256</a>                 <strong>try</strong>
{
+<a name="257" href="#257">257</a>                     normValue = mappings.getPrefix(qualiName.getNamespaceURI())
+<a name="258" href="#258">258</a>                             + <span class="string">":"</span>
+ qualiName.getLocalName();
+<a name="259" href="#259">259</a>                 } <strong>catch</strong>
(NamespaceException e) {
+<a name="260" href="#260">260</a>                     <em class="comment">//
will never happen</em>
+<a name="261" href="#261">261</a>                 }
+<a name="262" href="#262">262</a>                 doc.add(<strong>new</strong>
Field(fieldName,
+<a name="263" href="#263">263</a>                         normValue,
+<a name="264" href="#264">264</a>                         false,
+<a name="265" href="#265">265</a>                         <strong>true</strong>,
+<a name="266" href="#266">266</a>                         false));
+<a name="267" href="#267">267</a>                 <strong>break</strong>;
+<a name="268" href="#268">268</a>             <strong>default</strong>:
+<a name="269" href="#269">269</a>                 <strong>throw</strong>
<strong>new</strong> IllegalArgumentException(<span class="string">"illegal
internal value type"</span>);
+<a name="270" href="#270">270</a>         }
+<a name="271" href="#271">271</a>     }
+<a name="272" href="#272">272</a> 
+<a name="273" href="#273">273</a> }
 </pre>
 <hr/><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body>
 </html>



Mime
View raw message