Author: smumford
Date: 2011-11-14 22:36:33 -0500 (Mon, 14 Nov 2011)
New Revision: 8067
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/date-property-comparison.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-descendant-nodes.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/index-boost-value.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/offset-and-limit.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/or-constraint.xml
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-score.xml
Log:
Checking in current state prior to modifying for stage for beta.
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/date-property-comparison.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/date-property-comparison.xml 2011-11-15
03:32:03 UTC (rev 8066)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/date-property-comparison.xml 2011-11-15
03:36:33 UTC (rev 8067)
@@ -5,81 +5,42 @@
]>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Date_Property_Comparison">
<title>Date Property Comparison</title>
- <para>
- Find all nodes of primary type "nt:resource" whose jcr:lastModified
property value is greater than 2006-06-04 and less than 2008-06-04.
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Find all nodes of primary type
<literal>nt:resource</literal> whose
<parameter>jcr:lastModified</parameter> property value is greater than
<literal>2006-06-04</literal> and less than
<literal>2008-06-04</literal>.
+ </para>
+ </formalpara>
+
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Date_Property_Comparison-Repository_Structure">
<title>Repository Structure</title>
<para>
- Repository contains nt:resource nodes with different values of
jcr:lastModified property
+ Repository contains <literal>nt:resource</literal> nodes with
different values of <parameter>jcr:lastModified</parameter> property.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (nt:file)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- jcr:content (nt:resource)
jcr:lastModified="2006-01-19T15:34:15.917+02:00"
- </para>
+<programlisting>root
+ ├── document1 (nt:file)
+ │ └── jcr:content (nt:resource)
jcr:lastModified="2006-01-19T15:34:15.917+02:00"
+ ├── document2 (nt:file)
+ │ └── jcr:content (nt:resource)
jcr:lastModified="2005-01-19T15:34:15.917+02:00"
+ └── document3 (nt:file)
+ └── jcr:content (nt:resource)
jcr:lastModified="2007-01-19T15:34:15.917+02:00"
+</programlisting>
- </listitem>
-
- </itemizedlist>
-
- </listitem>
- <listitem>
- <para>
- document2 (nt:file)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- jcr:content (nt:resource)
jcr:lastModified="2005-01-19T15:34:15.917+02:00"
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
- <listitem>
- <para>
- document3 (nt:file)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- jcr:content (nt:resource)
jcr:lastModified="2007-01-19T15:34:15.917+02:00"
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Date_Property_Comparison-Query_Execution">
<title>Query Execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
+ <formalpara>
+ <title>SQL</title>
+ <para>
+ In SQL you have to use the keyword
<emphasis>TIMESTAMP</emphasis> for date comparisons. Otherwise, the date would
be interpreted as a string.
+ </para>
+ </formalpara>
+ <para>
+ The date has to be surrounded by single quotes (<literal>TIMESTAMP
'datetime'</literal>) and in the ISO standard format:
YYYY-MM-DDThh:mm:ss.sTZD.
</para>
- <para>
- In SQL you have to use the keyword <emphasis
role="bold">TIMESTAMP</emphasis> for date comparisons. Otherwise, the
date would be interpreted as a string. The date has to be surrounded by single quotes
(TIMESTAMP 'datetime') and in the ISO standard format: YYYY-MM-DDThh:mm:ss.sTZD (
<ulink
url="http://en.wikipedia.org/wiki/ISO_8601">http://en.wikipe...
and well explained in a W3C note <ulink
url="http://www.w3.org/TR/NOTE-datetime">http://www.w3.org/T...>).
+ <para>
+ Refer to <ulink
url="http://en.wikipedia.org/wiki/ISO_8601">http://en.wikipe...
or <ulink
url="http://www.w3.org/TR/NOTE-datetime">http://www.w3.org/T...
to more information.
</para>
<para>
You will see that it can be a date only (YYYY-MM-DD) but also a complete date
and time with a timezone designator (TZD).
@@ -101,12 +62,13 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
- <para>
- Compared to the SQL format, you have to use the keyword <emphasis
role="bold">xs:dateTime</emphasis> and surround the datetime by extra
brackets: xs:dateTime('datetime'). The actual format of the datetime also conforms
with the ISO date standard.
- </para>
+
+ <formalpara>
+ <title>XPath</title>
+ <para>
+ Compared to the SQL format, you have to use the keyword
<emphasis>xs:dateTime</emphasis> and surround the datetime by extra brackets:
<literal>xs:dateTime('datetime')</literal>. The actual format of the
datetime also conforms with the ISO date standard.
+ </para>
+ </formalpara>
<programlisting language="Java" role="Java">// make XPath
query
QueryManager queryManager = workspace.getQueryManager();
@@ -128,7 +90,7 @@
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Date_Property_Comparison-Fetching_the_result">
<title>Fetching the result</title>
<para>
- Let's get nodes:
+ To fetch the nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it =
result.getNodes();
@@ -138,10 +100,10 @@
Node foundNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "/document3/jcr:content".
+ The <literal>NodeIterator</literal> will return
<literal>/document3/jcr:content</literal>.
</para>
<para>
- We can also get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[]
columnNames = result.getColumnNames();
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-descendant-nodes.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-descendant-nodes.xml 2011-11-15
03:32:03 UTC (rev 8066)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/find-all-descendant-nodes.xml 2011-11-15
03:36:33 UTC (rev 8067)
@@ -5,74 +5,33 @@
]>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Descendant_Nodes">
<title>Finding All Descendant Nodes</title>
- <para>
- Find all nodes with the primary type 'nt:folder' that are descendants of
the node "/folder1/folder2".
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Find all nodes with the primary type
<literal>nt:folder</literal> that are descendants of the node
<literal>/folder1/folder2</literal>.
+ </para>
+ </formalpara>
+
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Descendant_Nodes-Repository_Structure">
<title>Repository Structure</title>
<para>
- The repository contains "nt:folder" nodes. The nodes are placed in
a multilayer tree.
+ The repository contains <literal>nt:folder</literal> nodes. The
nodes are placed in a multilayer tree.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- folder1 (nt:folder)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- folder2 (nt:folder)
- </para>
- <itemizedlist>
- <listitem>
- <para>
- folder3 (nt:folder) // This node we want to
find
- </para>
- <itemizedlist>
- <listitem>
- <para>
- folder4 (nt:folder) // This node we
want to find
- </para>
+<programlisting>root
+ └── folder1 (nt:folder)
+ └── folder2 (nt:folder)
+ ├── folder3 (nt:folder) // This node we want to find
+ │ └── folder4 (nt:folder) // This node we want to find
+ └── folder5 (nt:folder) // This node we want to find
+</programlisting>
- </listitem>
-
- </itemizedlist>
-
- </listitem>
- <listitem>
- <para>
- folder5 (nt:folder) // This node we want to
find
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
</section>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Descendant_Nodes-Query_Execution">
<title>Query Execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -80,10 +39,11 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath
query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -91,13 +51,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Finding_All_Descendant_Nodes-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes:
+ To fetch the nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it =
result.getNodes();
@@ -107,10 +69,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- The NodeIterator will return "folder3", "folder4" and
"folder5" nodes.
+ The <literal>NodeIterator</literal> will return
"folder3", "folder4" and "folder5" nodes.
</para>
<para>
- We can also get a table:
+ The results can also be output as a table:
</para>
<programlisting language="Java" role="Java">String[]
columnNames = result.getColumnNames();
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/index-boost-value.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/index-boost-value.xml 2011-11-15
03:32:03 UTC (rev 8066)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/index-boost-value.xml 2011-11-15
03:36:33 UTC (rev 8067)
@@ -4,28 +4,29 @@
%BOOK_ENTITIES;
]>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node">
- <title>Changing Priority of Node</title>
- <para>
- In this example, we will set different boost values for predefined nodes, and will
check effect by selecting those nodes and order them by jcr:score.
- </para>
- <para>
- The default boost value is 1.0. Higher boost values (a reasonable range is 1.0 - 5.0)
will yield a higher score value and appear as more relevant.
- </para>
- <note>
- <para>
- See 4.2.2 Index Boost Value <xref
linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" />
- </para>
+ <title>Changing Priority of Node</title>
+ <formalpara>
+ <title></title>
+ <para>
+ Set different boost values for predefined nodes, and check the effect
of this change by selecting those nodes and order them by
<literal>jcr:score</literal>.
+ </para>
+ </formalpara>
- </note>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Indexing_configuration">
- <title>Indexing configuration</title>
- <para>
- In next configuration, we will set boost values for nt:unstructured nodes
'text' property.
- </para>
- <para>
- indexing-config.xml:
- </para>
-
+ <para>
+ The default boost value is <literal>1.0</literal>. Higher boost
values (a reasonable range is between <literal>1.0</literal> and
<literal>5.0</literal>) will yield a higher score value and appear as more
relevant.
+ </para>
+ <para>
+ Refer to <xref
linkend="sect-Reference_Guide_eXo_JCR_1.14-Search_Configuration" /> for more
information.
+ </para>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Indexing_configuration">
+ <title>Indexing configuration</title>
+ <para>
+ In this configuration the boost values for
<literal>nt:unstructured</literal> nodes <emphasis>text</emphasis>
property will be increased.
+ </para>
+
+<example>
+ <title>indexing-config.xml:</title>
<programlisting language="XML" role="XML"><!--
This rule actualy do nothing. 'text' property has default boost value.
-->
@@ -49,53 +50,29 @@
<!-- boost: 3.0 -->
<property boost="3.0">text</property>
</index-rule></programlisting>
+</example>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Repository_structure">
- <title>Repository structure:</title>
- <para>
- Repository contains many nodes with primary type nt:unstructured. Each node contains
'text' property and 'rule' property with different values.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- node1(nt:unstructured) rule='boost1' text='The quick brown fox
jump...'
- </para>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Repository_structure">
+ <title>Repository structure:</title>
+ <para>
+ The repository contains many nodes with primary type
<literal>nt:unstructured</literal>. Each node contains
<emphasis>text</emphasis> property and <emphasis>rule</emphasis>
property with different values.
+ </para>
+<programlisting>root
+ ├── node1(nt:unstructured) rule='boost1' text='The quick brown fox
jump...'
+ ├── node2(nt:unstructured) rule='boost2' text='The quick brown fox
jump...'
+ └── node3(nt:unstructured) rule='boost3' text='The quick brown fox
jump...'
+</programlisting>
- </listitem>
- <listitem>
- <para>
- node2(nt:unstructured) rule='boost2' text='The quick brown fox
jump...'
- </para>
-
- </listitem>
- <listitem>
- <para>
- node3(nt:unstructured) rule='boost3' text='The quick brown fox
jump...'
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Query_execution">
- <title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Query_execution">
+ <title>Query execution</title>
+
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -103,10 +80,12 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath
query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -114,28 +93,46 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Fetching_result">
- <title>Fetching result</title>
- <para>
- Let's get nodes:
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-Changing_Priority_of_Node-Fetching_result">
+ <title>Fetching result</title>
+ <para>
+ To fetch the nodes:
+ </para>
+
<programlisting language="Java" role="Java">NodeIterator it =
result.getNodes();
if(it.hasNext())
{
Node findedNode = it.nextNode();
}</programlisting>
- <para>
- NodeIterator will return nodes in next order "node3", "node2",
"node1".
- </para>
+ <para>
+ The <literal>NodeIterator</literal> will return the nodes in this
order:
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>
+ node3
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ node2
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ node1
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
+
- </section>
-
-
</section>
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/offset-and-limit.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/offset-and-limit.xml 2011-11-15
03:32:03 UTC (rev 8066)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/offset-and-limit.xml 2011-11-15
03:36:33 UTC (rev 8067)
@@ -4,95 +4,63 @@
%BOOK_ENTITIES;
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit">
- <title>SetOffset and SetLimit</title>
- <para>
- Select all nodes with primary type 'nt:unstructured' and returns only 3 nodes
starting with the second node in the list.
- </para>
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Common_info">
- <title>Common info</title>
- <para>
- QueryImpl class has two methods: one to indicate how many results shall be returned at
most, and another to fix the starting position.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- setOffset(long offset) - Sets the start offset of the result set.
- </para>
+ <title><literal>SetOffset</literal> and
<literal>SetLimit</literal></title>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Select all nodes with primary type
<literal>nt:unstructured</literal> and return only three nodes starting with
the second node in the list.
+ </para>
+ </formalpara>
- </listitem>
- <listitem>
- <para>
- setLimit(long position) - Sets the maximum size of the result set.
- </para>
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Common_info">
+ <title>Common information</title>
+ <para>
+ <literal>QueryImpl</literal> class has two methods; one to
indicate how many results shall be returned at most, and another to fix the starting
position.
+ </para>
+ <variablelist>
+ <title></title>
+ <varlistentry>
+ <term>setOffset(long offset)</term>
+ <listitem>
+ <para>
+ Sets the start offset of the result set.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>setLimit(long position)</term>
+ <listitem>
+ <para>
+ Sets the maximum size of the result set.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
- </listitem>
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Repository_structure">
+ <title>Repository structure</title>
+ <para>
+ The repository contains <literal>mix:title</literal> nodes, where
<literal>jcr:title</literal> has different values.
+ </para>
+<programlisting>root
+ ├── node1 (nt:unstructured)
+ ├── node2 (nt:unstructured)
+ ├── node3 (nt:unstructured)
+ ├── node4 (nt:unstructured)
+ ├── node5 (nt:unstructured)
+ └── node6 (nt:unstructured)
+</programlisting>
- </itemizedlist>
-
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Repository_structure">
- <title>Repository structure</title>
- <para>
- Repository contains mix:title nodes, where jcr:title has different values.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- node1 (nt:unstructured)
- </para>
-
- </listitem>
- <listitem>
- <para>
- node2 (nt:unstructured)
- </para>
-
- </listitem>
- <listitem>
- <para>
- node3 (nt:unstructured)
- </para>
-
- </listitem>
- <listitem>
- <para>
- node4 (nt:unstructured)
- </para>
-
- </listitem>
- <listitem>
- <para>
- node5 (nt:unstructured)
- </para>
-
- </listitem>
- <listitem>
- <para>
- node6 (nt:unstructured)
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Query_execution">
- <title>Query execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Query_execution">
+ <title>Query execution</title>
+
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -104,30 +72,32 @@
query.setLimit(3);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
- </section>
-
- <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Fetching_result">
- <title>Fetching result</title>
- <para>
- Let's get nodes:
- </para>
-
+ </section>
+
+ <section
id="sect-Reference_Guide_eXo_JCR_1.14-SetOffset_and_SetLimit-Fetching_result">
+ <title>Fetching result</title>
+ <para>
+ To fetch the matching nodes:
+ </para>
+
<programlisting language="Java" role="Java">NodeIterator it =
result.getNodes();
if(it.hasNext())
{
Node findedNode = it.nextNode();
}</programlisting>
- <para>
- In usual case (without using setOffset and setLimit methods), Node iterator returns
all nodes (node1...node6). But in our case NodeIterator will return
"node2","node3" and "node4".
- </para>
- <para>
- \[node1 <emphasis role="bold">node2</emphasis> <emphasis
role="bold">node3</emphasis> <emphasis
role="bold">node4</emphasis> node5 node6\]
- </para>
+ <para>
+ In usual cases (without using <literal>setOffset</literal> and
<literal>setLimit</literal> methods), the
<literal>NodeIterator</literal> returns all nodes
(<emphasis>node1</emphasis> to <emphasis>node6</emphasis>).
However in this case <literal>NodeIterator</literal> will return;
<emphasis>node2</emphasis>, <emphasis>node3</emphasis> and
<emphasis>node4</emphasis>.
+ </para>
+ <para>
+ \[node1 <emphasis role="bold">node2</emphasis>
<emphasis role="bold">node3</emphasis> <emphasis
role="bold">node4</emphasis> node5 node6\]
+ </para>
- </section>
-
+ </section>
+
</section>
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/or-constraint.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/or-constraint.xml 2011-11-15
03:32:03 UTC (rev 8066)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/or-constraint.xml 2011-11-15
03:36:33 UTC (rev 8067)
@@ -5,56 +5,31 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-OR_Constraint">
<title>OR Constraint</title>
- <para>
- Find all documents whose title is 'Cinderella' or whose description is
'novel'.
- </para>
- <para>
- How does it sound in jcr terms? - Find all nodes with a mixin type
'mix:title' whose property 'jcr:title' equals "Cinderella" or
whose "jcr:description" property value is "novel".
- </para>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Find all documents whose title is
<emphasis>Cinderella</emphasis> OR whose description is
<emphasis>novel</emphasis>. In JCR terms this would be; find all nodes with a
mixin type <literal>mix:title</literal> whose property
<parameter>jcr:title</parameter> equals
<emphasis>Cinderella</emphasis> or whose
<parameter>jcr:description</parameter> property value is
<emphasis>novel</emphasis>.
+ </para>
+ </formalpara>
+
<section
id="sect-Reference_Guide_eXo_JCR_1.14-OR_Constraint-Repository_Structure">
<title>Repository Structure</title>
<para>
The repository contains mix:title nodes, where jcr:title and jcr:description
have different values.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (mix:title) jcr:title="War and peace"
jcr:description="novel"
- </para>
-
- </listitem>
- <listitem>
- <para>
- document2 (mix:title) jcr:title="Cinderella"
jcr:description="fairytale"
- </para>
-
- </listitem>
- <listitem>
- <para>
- document3 (mix:title) jcr:title="Puss in Boots"
jcr:description="fairytale"
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
+<programlisting>root
+ ├── document1 (mix:title) jcr:title="War and peace"
jcr:description="novel"
+ ├── document2 (mix:title) jcr:title="Cinderella"
jcr:description="fairytale"
+ └── document3 (mix:title) jcr:title="Puss in Boots"
jcr:description="fairytale"
+</programlisting>
</section>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-OR_Constraint-Query_Execution">
<title>Query Execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -62,10 +37,11 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath
query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -73,13 +49,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-OR_Constraint-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes:
+ To fetch matching nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it =
result.getNodes();
@@ -89,10 +67,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return "document1" and "document2".
+ The <literal>NodeIterator</literal> will return
<emphasis>document1</emphasis> and
<emphasis>document2</emphasis>.
</para>
<para>
- We can also get a table:
+ The output can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[]
columnNames = result.getColumnNames();
Modified:
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-score.xml
===================================================================
---
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-score.xml 2011-11-15
03:32:03 UTC (rev 8066)
+++
epp/docs/branches/5.2/Reference_Guide-eXoJCR-1.14/en-US/modules/Advanced/eXoJCR/jcr/searching/order-by-score.xml 2011-11-15
03:36:33 UTC (rev 8067)
@@ -5,13 +5,19 @@
]>
<section id="sect-Reference_Guide_eXo_JCR_1.14-Ordering_by_Score">
<title>Ordering by Score</title>
+ <formalpara>
+ <title>Task:</title>
+ <para>
+ Select all nodes with the mixin type
<literal>mix:title</literal> containing any word from the set
{<emphasis>brown</emphasis>, <emphasis>fox</emphasis>,
<emphasis>jumps</emphasis>}. Then, sort the results by their score in
ascending node. This way nodes that are a closer match to the query statement are in the
last positions in the result list.
+ </para>
+ </formalpara>
<para>
- Select all nodes with the mixin type 'mix:title' containing any word from
the set {'brown','fox','jumps'}. Then, sort result by the score in
ascending node. This way nodes that match better the query statement are ordered at the
last positions in the result list.
+
</para>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Ordering_by_Score-Info">
<title>Info</title>
<para>
- SQL and XPath queries support both score constructions jcr:score and
jcr:score()
+ SQL and XPath queries both support score constructions
<literal>jcr:score</literal> and <literal>jcr:score()</literal>.
</para>
<programlisting>SELECT * FROM nt:base ORDER BY jcr:score [ASC|DESC]
@@ -20,12 +26,12 @@
//element(*,nt:base) order by jcr:score() [descending]
//element(*,nt:base) order by @jcr:score [descending]</programlisting>
<para>
- Do not use "ascending" combined with jcr:score in XPath. The
following XPath statement may throw an exception:
+ Do not use <parameter>ascending</parameter> combined with
<literal>jcr:score</literal> in XPath. The following XPath statement may throw
an exception:
</para>
<programlisting>... order by jcr:score() ascending</programlisting>
<para>
- Do not set any ordering specifier - ascending is default:
+ If you do not set any ordering specifier the default is ascending:
</para>
<programlisting>... order by jcr:score()</programlisting>
@@ -37,45 +43,18 @@
<para>
The repository contains mix:title nodes, where the jcr:description has
different values.
</para>
- <itemizedlist>
- <listitem>
- <para>
- root
- </para>
- <itemizedlist>
- <listitem>
- <para>
- document1 (mix:title) jcr:description="The quick brown
fox jumps over the lazy dog."
- </para>
-
- </listitem>
- <listitem>
- <para>
- document2 (mix:title) jcr:description="The brown fox
lives in the forest."
- </para>
-
- </listitem>
- <listitem>
- <para>
- document3 (mix:title) jcr:description="The fox is a nice
animal."
- </para>
-
- </listitem>
-
- </itemizedlist>
-
- </listitem>
-
- </itemizedlist>
-
+<programlisting>root
+ ├── document1 (mix:title) jcr:description="The quick brown fox jumps over the lazy
dog."
+ ├── document2 (mix:title) jcr:description="The brown fox lives in the
forest."
+ └── document3 (mix:title) jcr:description="The fox is a nice animal."
+</programlisting>
</section>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Ordering_by_Score-Query_Execution">
<title>Query Execution</title>
- <para>
- <emphasis role="bold">SQL</emphasis>
- </para>
-
+ <formalpara>
+ <title>SQL</title>
+ <para>
<programlisting language="Java" role="Java">// make SQL query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -83,10 +62,12 @@
Query query = queryManager.createQuery(sqlStatement, Query.SQL);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
- <para>
- <emphasis role="bold">XPath</emphasis>
- </para>
-
+ </para>
+ </formalpara>
+
+ <formalpara>
+ <title>XPath</title>
+ <para>
<programlisting language="Java" role="Java">// make XPath
query
QueryManager queryManager = workspace.getQueryManager();
// create query
@@ -94,13 +75,15 @@
Query query = queryManager.createQuery(xpathStatement, Query.XPATH);
// execute query and fetch result
QueryResult result = query.execute();</programlisting>
+ </para>
+ </formalpara>
</section>
<section
id="sect-Reference_Guide_eXo_JCR_1.14-Ordering_by_Score-Fetching_the_Result">
<title>Fetching the Result</title>
<para>
- Let's get nodes
+ To fetch the nodes:
</para>
<programlisting language="Java" role="Java">NodeIterator it =
result.getNodes();
@@ -110,10 +93,10 @@
Node findedNode = it.nextNode();
}</programlisting>
<para>
- NodeIterator will return nodes in the following order: "document3",
"document2", "document1".
+ The <literal>NodeIterator</literal> will return nodes in the
following order: <emphasis>document3</emphasis>,
<emphasis>document2</emphasis>, <emphasis>document1</emphasis>.
</para>
<para>
- We can also get a table:
+ The results can also be formatted as a table:
</para>
<programlisting language="Java" role="Java">String[]
columnNames = result.getColumnNames();