Hibernate SVN: r11605 - trunk/HibernateExt/validator/src/java/org/hibernate/validator/resources.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-31 17:14:53 -0400 (Thu, 31 May 2007)
New Revision: 11605
Modified:
trunk/HibernateExt/validator/src/java/org/hibernate/validator/resources/DefaultValidatorMessages_es.properties
Log:
update spanish translation
Modified: trunk/HibernateExt/validator/src/java/org/hibernate/validator/resources/DefaultValidatorMessages_es.properties
===================================================================
--- trunk/HibernateExt/validator/src/java/org/hibernate/validator/resources/DefaultValidatorMessages_es.properties 2007-05-31 14:18:07 UTC (rev 11604)
+++ trunk/HibernateExt/validator/src/java/org/hibernate/validator/resources/DefaultValidatorMessages_es.properties 2007-05-31 21:14:53 UTC (rev 11605)
@@ -12,5 +12,5 @@
validator.email=no es una direcci�n de correo electr�nico bien formada
validator.notEmpty=no debe ser nulo o vac�o
validator.digits=numeric value out of bounds (<{integerDigits} digits>.<{fractionalDigits} digits> expected)
-validator.ean=invalid EAN
-validator.creditCard=invalid credit card number
\ No newline at end of file
+validator.ean=EAN inv�lido
+validator.creditCard=n�mero de tarjeta de cr�dito inv�lido
\ No newline at end of file
17 years, 6 months
Hibernate SVN: r11604 - trunk/HibernateExt/search/doc/reference/en/modules.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-31 10:18:07 -0400 (Thu, 31 May 2007)
New Revision: 11604
Modified:
trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml
Log:
grrrr
Modified: trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml 2007-05-31 14:13:25 UTC (rev 11603)
+++ trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml 2007-05-31 14:18:07 UTC (rev 11604)
@@ -188,7 +188,7 @@
<title>Reader strategy</title>
<para>When executing a query, Hibernate Search interacts with the Apache
- Lucene indexes through a reader strategy. chosing a reder strategy will
+ Lucene indexes through a reader strategy. chosing a reader strategy will
depend on the profile of the application (frequent updates, read mostly,
asynchronous index update etc).</para>
17 years, 6 months
Hibernate SVN: r11603 - trunk/HibernateExt/search/doc/reference/en/modules.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-31 10:13:25 -0400 (Thu, 31 May 2007)
New Revision: 11603
Modified:
trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml
trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml
trunk/HibernateExt/search/doc/reference/en/modules/query.xml
Log:
Documentation updates
Modified: trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml 2007-05-31 12:50:33 UTC (rev 11602)
+++ trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml 2007-05-31 14:13:25 UTC (rev 11603)
@@ -188,13 +188,15 @@
<title>Reader strategy</title>
<para>When executing a query, Hibernate Search interacts with the Apache
- Lucene indexes through a reader strategy.</para>
+ Lucene indexes through a reader strategy. chosing a reder strategy will
+ depend on the profile of the application (frequent updates, read mostly,
+ asynchronous index update etc).</para>
<section>
<title>not-shared</title>
<para>Every time a query is executed, a Lucene IndexReader is opened.
- This strategy is not the most efficient, opening and warming up an
+ This strategy is not the most efficient: opening and warming up an
IndexReader can be a relatively expensive operation. This strategy is
the default, but will be changed in the future.</para>
</section>
@@ -202,11 +204,13 @@
<section>
<title>shared</title>
- <para>Hibernate Search will share the same IndexReader for a given index
- provided that the IndexReader is still up-to-date. Generally speaking,
- this strategy provides much better performance than the previous one. It
- is especially true if the number of updates is much lower than the
- read.</para>
+ <para>With this strategy, Hibernate Search will share the same
+ IndexReader, for a given Lucene index, across multiple queries and
+ threads provided that the IndexReader is still up-to-date. If the
+ IndexReader is not up-to-date, an new one is opened and provided.
+ Generally speaking, this strategy provides much better performances than
+ the <literal>not-shared</literal> strategy. It is especially true if the
+ number of updates is much lower than the reads.</para>
</section>
<section>
Modified: trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml 2007-05-31 12:50:33 UTC (rev 11602)
+++ trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml 2007-05-31 14:13:25 UTC (rev 11603)
@@ -78,7 +78,7 @@
to use the index query result. For a regular Hibernate Search usage,
storing is not necessary. However you might want to store some fields to
subsequently project them (see <xref linkend="search-query" /> for more
- information). </para>
+ information).</para>
<para>Whether or not you want to tokenize a property depends on whether
you wish to search the element as is, or by the words it contains. It
@@ -125,7 +125,7 @@
<title>Embedded and associated objects</title>
<para>Associated objects as well as embedded objects can be indexed as
- well as part of the root entity index.</para>
+ part of the root entity index.</para>
<programlisting>@Entity
@Indexed
@@ -168,11 +168,11 @@
<literal>Place</literal> index. The <literal>Place</literal> index
documents will also contain the fields <literal>address.id</literal>,
<literal>address.street</literal>, and <literal>address.city</literal>
- which you will be able to query from. This is done thanks to the
+ which you will be able to query. This is enabled by the
<literal>@IndexedEmbedded</literal> annotation.</para>
<para><literal>@ContainedIn</literal> is useful on embedded objects that
- are also entities (like <literal>Address</literal> in the example): it
+ are also entities (like <literal>Address</literal> in this example): it
basically means that when an address entity is updated, the index
document of the associated <literal>Place</literal>(s), also have to be
updated.</para>
@@ -414,8 +414,7 @@
alternative approach is to use a Filter query which will
filter the result query to the appropriate range.</para>
- <para><productname>Hibernate Search</productname> will support
- a padding mechanism</para>
+ <para>Hibernate Search will support a padding mechanism</para>
</footnote></para>
</listitem>
</varlistentry>
Modified: trunk/HibernateExt/search/doc/reference/en/modules/query.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/query.xml 2007-05-31 12:50:33 UTC (rev 11602)
+++ trunk/HibernateExt/search/doc/reference/en/modules/query.xml 2007-05-31 14:13:25 UTC (rev 11603)
@@ -2,12 +2,11 @@
<chapter id="search-query" xreflabel="Querying">
<title>Querying</title>
- <para>The second most important capability of <productname>Hibernate Search
- </productname> is the ability to execute a Lucene query and retrieve
- entities managed by an Hibernate session, providing the power of Lucene
- without living the Hibernate paradigm, and giving another dimension to the
- Hibernate classic search mechanisms (HQL, Criteria query, native SQL
- query).</para>
+ <para>The second most important capability of Hibernate Search is the
+ ability to execute a Lucene query and retrieve entities managed by an
+ Hibernate session, providing the power of Lucene without living the
+ Hibernate paradigm, and giving another dimension to the Hibernate classic
+ search mechanisms (HQL, Criteria query, native SQL query).</para>
<para>To access the <productname>Hibernate Search</productname> querying
facilities, you have to use an Hibernate
@@ -65,9 +64,10 @@
<programlisting>FullTextSession fullTextSession = Search.createFullTextSession( session );
org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery );</programlisting>
- <para>If not specified, the query will be applied on all indexed,
- potentially returning all types of indexed classes. It is advised, for
- a performance point of view to restrict the returned types:</para>
+ <para>If not specified, the query will be executed all indexed,
+ potentially returning all types of indexed classes. It is advised,
+ from a performance point of view, to restrict the returned
+ types:</para>
<programlisting>org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, Customer.class );
//or
@@ -117,15 +117,15 @@
interface which is a sub interface of
<classname>org.hibernate.Query</classname>.</para>
- <para>Fields used for sorting ust not be tokenized.</para>
+ <para>Fields used for sorting must not be tokenized.</para>
</section>
<section>
<title>Fetching strategy</title>
<para>When you restrict the return types to one class, Hibernate
- Search load the objects and respect the static fetching strategy
- defined in your domain model using a single query.</para>
+ Search loads the objects using a single query. It also respects the
+ static fetching strategy defined in your domain model.</para>
<para>It is often useful, however, to refine the fetching strategy for
a specific use case.</para>
@@ -140,7 +140,8 @@
<para>When defining a criteria query, it is not needed to restrict the
entity types returned while creating the Hibernate Search query from
the full text session: the type is guessed from the criteria query
- itself.</para>
+ itself. Only fetch mode can be adjusted, refrain from applying any
+ other restriction.</para>
<para>One cannot use <methodname>setCriteriaQuery</methodname> if more
than one entity type is expected to be returned.</para>
@@ -181,7 +182,8 @@
<classname>org.hibernate.search.bridge.TwoWayFieldBridge</classname>
or
<literal>org.hibernate.search.bridge.TwoWayStringBridge</literal>,
- the latter being the simpler version</para>
+ the latter being the simpler version. All Hibernate Search
+ built-in types are two-way.</para>
</listitem>
</itemizedlist>
@@ -203,7 +205,7 @@
<section>
<title>Performance considerations</title>
- <para>If you expect a reasonable result number (for example using
+ <para>If you expect a reasonable number of results (for example using
pagination) and expect to work on all of them,
<methodname>list()</methodname> or
<methodname>uniqueResult()</methodname> are recommended.
@@ -227,7 +229,7 @@
<itemizedlist>
<listitem>
- <para>for the Google-like feature 1-10 of about 888,000,000 </para>
+ <para>for the Google-like feature 1-10 of about 888,000,000</para>
</listitem>
<listitem>
@@ -246,7 +248,7 @@
<para>Hibernate Search allows you to retrieve the total number of
matching documents regardless of the pagination parameters. Even more
interesting, you can retrieve the number of matching elements without
- even triggering a single object load.</para>
+ triggering a single object load.</para>
<programlisting>org.hibernate.search.FullTextQuery query = s.createFullTextQuery( luceneQuery, Book.class );
assert 3245 == <emphasis role="bold">query.getResultSize()</emphasis>; //return the number of matching books without loading a single one
@@ -256,7 +258,11 @@
List results = query.list();
assert 3245 == <emphasis role="bold">query.getResultSize()</emphasis>; //return the total number of matching books regardless of pagination</programlisting>
- <para></para>
+ <note>
+ <para>Like Google, the number of results is approximative if the index
+ is not fully up-to-date with the database (asynchronous cluster for
+ example).</para>
+ </note>
</section>
</section>
17 years, 6 months
Hibernate SVN: r11602 - in trunk/HibernateExt/search: lib/test and 5 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-31 08:50:33 -0400 (Thu, 31 May 2007)
New Revision: 11602
Modified:
trunk/HibernateExt/search/changelog.txt
trunk/HibernateExt/search/lib/test/jboss-embedded-all.jar
trunk/HibernateExt/search/lib/test/thirdparty-all.jar
trunk/HibernateExt/search/src/test-resources/conf/jbossjta-properties.xml
trunk/HibernateExt/search/src/test-resources/deploy/jboss-local-jdbc.rar
trunk/HibernateExt/search/src/test-resources/deploy/jboss-xa-jdbc.rar
trunk/HibernateExt/search/src/test-resources/deploy/jms-ra.rar
trunk/HibernateExt/search/src/test-resources/deploy/messaging/connection-factories-service.xml
trunk/HibernateExt/search/src/test-resources/deploy/messaging/destinations-service.xml
trunk/HibernateExt/search/src/test-resources/deploy/messaging/hsqldb-persistence-service.xml
trunk/HibernateExt/search/src/test-resources/deploy/messaging/jms-ds.xml
trunk/HibernateExt/search/src/test-resources/deploy/messaging/messaging-service.xml
trunk/HibernateExt/search/src/test-resources/deploy/messaging/remoting-service.xml
trunk/HibernateExt/search/src/test-resources/deployers/jca-deployers-beans.xml
trunk/HibernateExt/search/src/test-resources/jndi.properties
Log:
HSEARCH-65 update JBoss Embedded to beta2
Modified: trunk/HibernateExt/search/changelog.txt
===================================================================
--- trunk/HibernateExt/search/changelog.txt 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/changelog.txt 2007-05-31 12:50:33 UTC (rev 11602)
@@ -27,8 +27,12 @@
* [HSEARCH-53] - Add support for projection (ie read the data from the index only)
* [HSEARCH-61] - Move from MultiSearcher to MultiReader
* [HSEARCH-62] - Support pluggable ReaderProvider strategies
+
+** Task
+ * [HSEARCH-65] - Update to JBoss Embedded beta2
+
3.0.0.Beta1 (19-03-2007)
------------------------
Modified: trunk/HibernateExt/search/lib/test/jboss-embedded-all.jar
===================================================================
(Binary files differ)
Modified: trunk/HibernateExt/search/lib/test/thirdparty-all.jar
===================================================================
(Binary files differ)
Modified: trunk/HibernateExt/search/src/test-resources/conf/jbossjta-properties.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/conf/jbossjta-properties.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/conf/jbossjta-properties.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -106,66 +106,60 @@
value="var"/>
-->
</properties>
- <properties depends="arjuna" name="recoverymanager">
+ <properties name="common">
+ <!-- CLF 2.0 properties -->
+ <property name="com.arjuna.common.util.logging.DebugLevel"
+ type="System" value="0x00000000"/>
+ <property name="com.arjuna.common.util.logging.FacilityLevel"
+ type="System" value="0xffffffff"/>
+ <property name="com.arjuna.common.util.logging.VisibilityLevel"
+ type="System" value="0xffffffff"/>
+ <property name="com.arjuna.common.util.logger" type="System" value="log4j"/>
+ </properties>
+ <properties depends="arjuna" name="txoj">
<!--
- Properties used only by the RecoveryManager.
+ (default is LockStore of installation - must be writeable!)
-->
<!--
- Periodic recovery settings.
- Time values in this section are in seconds.
- -->
- <!--
- Interval in seconds between initiating the periodic recovery modules.
- Default is 120 seconds.
- -->
<property
- name="com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod" value="120"/>
- <!--
- Interval in seconds between first and second pass of periodic recovery.
- Default is 10 seconds.
+ name="com.arjuna.ats.txoj.lockstore.lockStoreDir"
+ value="LockStore"/>
-->
- <property
- name="com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod" value="10"/>
<!--
- Periodic recovery modules to use. Invoked in sort-order of names.
+ (default is BasicLockStore)
-->
- <property
- name="com.arjuna.ats.arjuna.recovery.recoveryExtension1" value="com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule"/>
- <property
- name="com.arjuna.ats.arjuna.recovery.recoveryExtension2" value="com.arjuna.ats.internal.txoj.recovery.TORecoveryModule"/>
+ <property name="com.arjuna.ats.txoj.lockstore.lockStoreType" value="BasicLockStore"/>
<!--
- Expired entry removal
+ (default is NO)
-->
+ <property name="com.arjuna.ats.txoj.lockstore.multipleLockStore" value="NO"/>
<!--
- Expiry scanners to use (order of invocation is random).
- Names must begin with "com.arjuna.ats.arjuna.recovery.expiryScanner"
+ (default is YES)
-->
- <property
- name="com.arjuna.ats.arjuna.recovery.expiryScannerTransactionStatusManager" value="com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner"/>
+ <property name="com.arjuna.ats.txoj.lockstore.singleLockStore" value="YES"/>
<!--
- Interval, in hours, between running the expiry scanners.
- This can be quite long. The absolute value determines the interval -
- if the value is negative, the scan will NOT be run until after one
- interval has elapsed. If positive the first scan will be immediately
- after startup. Zero will prevent any scanning.
- Default = 12 = run immediately, then every 12 hours.
+ (default is YES)
-->
<property
- name="com.arjuna.ats.arjuna.recovery.expiryScanInterval" value="12"/>
+ name="com.arjuna.ats.txoj.lockstore.allowNestedLocking" value="YES"/>
+ </properties>
+ <properties depends="arjuna" name="jta">
<!--
- Age, in hours, for removal of transaction status manager item.
- This should be longer than any ts-using process will remain running.
- Zero = Never removed. Default is 12.
+ Support subtransactions in the JTA layer?
+ Default is NO.
-->
- <property
- name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime" value="12"/>
+ <property name="com.arjuna.ats.jta.supportSubtransactions" value="NO"/>
+ <property name="com.arjuna.ats.jta.jtaTMImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/>
<!--
- Use this to fix the port on which the TransactionStatusManager listens,
- The default behaviour is to use any free port.
- -->
- <property
- name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort" value="0"/>
+ com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple
+ -->
+ <property name="com.arjuna.ats.jta.jtaUTImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
<!--
+ com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple
+ -->
+ </properties>
+ <properties depends="arjuna,txoj,jta" name="recoverymanager">
+ <!--
Properties used only by the RecoveryManager.
-->
<!--
@@ -226,58 +220,6 @@
<property
name="com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort" value="0"/>
</properties>
- <properties name="common">
- <!-- CLF 2.0 properties -->
- <property name="com.arjuna.common.util.logging.DebugLevel"
- type="System" value="0x00000000"/>
- <property name="com.arjuna.common.util.logging.FacilityLevel"
- type="System" value="0xffffffff"/>
- <property name="com.arjuna.common.util.logging.VisibilityLevel"
- type="System" value="0xffffffff"/>
- <property name="com.arjuna.common.util.logger" type="System" value="log4j"/>
- </properties>
- <properties depends="arjuna" name="txoj">
- <!--
- (default is LockStore of installation - must be writeable!)
- -->
- <!--
- <property
- name="com.arjuna.ats.txoj.lockstore.lockStoreDir"
- value="LockStore"/>
- -->
- <!--
- (default is BasicLockStore)
- -->
- <property name="com.arjuna.ats.txoj.lockstore.lockStoreType" value="BasicLockStore"/>
- <!--
- (default is NO)
- -->
- <property name="com.arjuna.ats.txoj.lockstore.multipleLockStore" value="NO"/>
- <!--
- (default is YES)
- -->
- <property name="com.arjuna.ats.txoj.lockstore.singleLockStore" value="YES"/>
- <!--
- (default is YES)
- -->
- <property
- name="com.arjuna.ats.txoj.lockstore.allowNestedLocking" value="YES"/>
- </properties>
- <properties depends="arjuna" name="jta">
- <!--
- Support subtransactions in the JTA layer?
- Default is NO.
- -->
- <property name="com.arjuna.ats.jta.supportSubtransactions" value="NO"/>
- <property name="com.arjuna.ats.jta.jtaTMImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"/>
- <!--
- com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple
- -->
- <property name="com.arjuna.ats.jta.jtaUTImplementation" value="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
- <!--
- com.arjuna.ats.internal.jta.transaction.jts.UserTransactionImple
- -->
- </properties>
<properties depends="jta" name="jdbc">
<!--
property name="com.arjuna.ats.jdbc.isolationLevel" value="TRANSACTION_SERIALIZABLE"/>
Modified: trunk/HibernateExt/search/src/test-resources/deploy/jboss-local-jdbc.rar
===================================================================
(Binary files differ)
Modified: trunk/HibernateExt/search/src/test-resources/deploy/jboss-xa-jdbc.rar
===================================================================
(Binary files differ)
Modified: trunk/HibernateExt/search/src/test-resources/deploy/jms-ra.rar
===================================================================
(Binary files differ)
Modified: trunk/HibernateExt/search/src/test-resources/deploy/messaging/connection-factories-service.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/deploy/messaging/connection-factories-service.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/deploy/messaging/connection-factories-service.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -3,16 +3,18 @@
<!--
Messaging Connection Factories deployment descriptor.
- $Id: connection-factories-service.xml 920 2006-05-02 02:45:42Z ovidiu $
+ $Id: connection-factories-service.xml 2386 2007-02-21 18:07:44Z timfox $
-->
<server>
<mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
- name="jboss.messaging.destination:service=ConnectionFactory"
+ name="jboss.messaging.connectionfactory:service=ConnectionFactory"
xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=socket</depends>
+ <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=bisocket</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+
<attribute name="JNDIBindings">
<bindings>
<binding>/ConnectionFactory</binding>
@@ -21,6 +23,7 @@
<binding>java:/XAConnectionFactory</binding>
</bindings>
</attribute>
+
</mbean>
</server>
\ No newline at end of file
Modified: trunk/HibernateExt/search/src/test-resources/deploy/messaging/destinations-service.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/deploy/messaging/destinations-service.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/deploy/messaging/destinations-service.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -1,35 +1,90 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Messaging Destinations deployment descriptor.
-
- $Id: destinations-service.xml 927 2006-05-03 01:51:14Z ovidiu $
--->
-
-<server>
-
- <!--
- The Dead Letter Queue. This destination is a dependency of an EJB MDB container.
- -->
-
- <mbean code="org.jboss.jms.server.destination.Queue"
- name="jboss.messaging.destination:service=Queue,name=DLQ"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <!--
- Default test destination. Smoke tests assume they are available.
- -->
- <mbean code="org.jboss.jms.server.destination.Topic"
- name="jboss.messaging.destination:service=Topic,name=testTopic"
- xmbean-dd="xmdesc/Topic-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
- <mbean code="org.jboss.jms.server.destination.Queue"
- name="jboss.messaging.destination:service=Queue,name=testQueue"
- xmbean-dd="xmdesc/Queue-xmbean.xml">
- <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
- </mbean>
-
-</server>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Messaging Destinations deployment descriptor.
+
+ $Id: destinations-service.xml 1930 2007-01-09 18:16:04Z timfox $
+ -->
+
+<server>
+
+ <!--
+ The Default Dead Letter Queue. This destination is a dependency of an EJB MDB container.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=DLQ"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <!--
+ The Default Expiry Queue.
+ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=ExpiryQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <!--
+ Example destinations.
+ -->
+
+ <!-- It's possible for indiviual queues and topics to use a specific queue for
+ an expiry or DLQ -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=PrivateDLQ"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=QueueWithOwnDLQAndExpiryQueue"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
+ <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=TopicWithOwnDLQAndExpiryQueue"
+ xmbean-dd="xmdesc/Topic-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="DLQ">jboss.messaging.destination:service=Queue,name=PrivateDLQ</attribute>
+ <attribute name="ExpiryQueue">jboss.messaging.destination:service=Queue,name=PrivateExpiryQueue</attribute>
+ </mbean>
+
+ <!-- Queues and Topics can also specify their own redelivery delay -->
+
+ <mbean code="org.jboss.jms.server.destination.QueueService"
+ name="jboss.messaging.destination:service=Queue,name=QueueWithOwnRedeliveryDelay"
+ xmbean-dd="xmdesc/Queue-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="RedeliveryDelay">5000</attribute>
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.destination.TopicService"
+ name="jboss.messaging.destination:service=Topic,name=TopicWithOwnRedeliveryDelay"
+ xmbean-dd="xmdesc/Topic-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+ <depends>jboss.messaging:service=PostOffice</depends>
+ <attribute name="RedeliveryDelay">5000</attribute>
+ </mbean>
+
+</server>
\ No newline at end of file
Modified: trunk/HibernateExt/search/src/test-resources/deploy/messaging/hsqldb-persistence-service.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/deploy/messaging/hsqldb-persistence-service.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/deploy/messaging/hsqldb-persistence-service.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -3,35 +3,45 @@
<!--
Hypersonic persistence deployment descriptor.
- $Id: hsqldb-persistence-service.xml 1222 2006-08-10 18:51:44Z ovidiu.feodorov(a)jboss.com $
+ $Id: hsqldb-persistence-service.xml 2277 2007-02-12 21:51:57Z clebert.suconic(a)jboss.com $
-->
<server>
- <mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManager"
+ <mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManagerService"
name="jboss.messaging:service=PersistenceManager"
xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
- <!-- TODO this insures the fact that dependency exists. However I need to redundantly specifiy
- the DataSource JNDI name in order to actually get a reference to it. Fix this.
- -->
<depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
<depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
- <depends optional-attribute-name="ChannelMapper">jboss.messaging:service=ChannelMapper</depends>
<attribute name="DataSource">java:/DefaultDS</attribute>
<attribute name="CreateTablesOnStartup">true</attribute>
- <attribute name="UsingBatchUpdates">true</attribute>
+ <attribute name="UsingBatchUpdates">false</attribute>
+ <attribute name="MaxParams">500</attribute>
</mbean>
- <mbean code="org.jboss.jms.server.plugin.JDBCChannelMapper"
- name="jboss.messaging:service=ChannelMapper"
- xmbean-dd="xmdesc/JDBCChannelMapper-xmbean.xml">
- <!-- TODO this insures the fact that dependency exists. However I need to redundantly specifiy
- the DataSource JNDI name in order to actually get a reference to it. Fix this.
- -->
+ <!-- Note that Hypersonic CANNOT be used for clustered post offices -->
+
+ <mbean code="org.jboss.messaging.core.plugin.DefaultPostOfficeService"
+ name="jboss.messaging:service=PostOffice"
+ xmbean-dd="xmdesc/DefaultPostOffice-xmbean.xml">
+ <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
<depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
<depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+ <attribute name="PostOfficeName">JMS</attribute>
<attribute name="DataSource">java:/DefaultDS</attribute>
<attribute name="CreateTablesOnStartup">true</attribute>
- </mbean>
-
+ </mbean>
+
+ <mbean code="org.jboss.jms.server.plugin.JDBCJMSUserManagerService"
+ name="jboss.messaging:service=JMSUserManager"
+ xmbean-dd="xmdesc/JMSUserManager-xmbean.xml">
+ <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
+ <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
+ <attribute name="DataSource">java:/DefaultDS</attribute>
+ <attribute name="CreateTablesOnStartup">true</attribute>
+ <attribute name="SqlProperties"><![CDATA[
+POPULATE.TABLES.1=INSERT INTO JBM_USER (USER_ID,PASSWD,CLIENTID) VALUES ('dilbert','dogbert','dilbert-id')
+ ]]></attribute>
+ </mbean>
+
</server>
\ No newline at end of file
Modified: trunk/HibernateExt/search/src/test-resources/deploy/messaging/jms-ds.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/deploy/messaging/jms-ds.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/deploy/messaging/jms-ds.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -6,7 +6,11 @@
<!-- JMS Stuff -->
<!-- ==================================================================== -->
- <!-- The JMS provider loader -->
+ <!--
+ The JMS provider loader. Currently pointing to a non-clustered ConnectionFactory. Need to
+ be replaced with a clustered non-load-balanced ConnectionFactory when it becomes available.
+ See http://jira.jboss.org/jira/browse/JBMESSAGING-843.
+ -->
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
<attribute name="ProviderName">DefaultJMSProvider</attribute>
Modified: trunk/HibernateExt/search/src/test-resources/deploy/messaging/messaging-service.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/deploy/messaging/messaging-service.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/deploy/messaging/messaging-service.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -3,7 +3,7 @@
<!--
The JBoss Messaging service deployment descriptor.
- $Id: messaging-service.xml 1019 2006-07-17 17:15:04Z timfox $
+ $Id: messaging-service.xml 2386 2007-02-21 18:07:44Z timfox $
-->
<server>
@@ -14,35 +14,33 @@
<constructor>
<!-- ServerPeerID -->
- <arg type="java.lang.String" value="server.0" />
+ <arg type="int" value="0"/>
<!-- DefaultQueueJNDIContext -->
- <arg type="java.lang.String" value="/queue" />
+ <arg type="java.lang.String" value="/queue"/>
<!-- DefaultTopicJNDIContext -->
- <arg type="java.lang.String" value="/topic" />
+ <arg type="java.lang.String" value="/topic"/>
</constructor>
- <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
- <depends optional-attribute-name="MessageStore">jboss.messaging:service=MessageStore</depends>
- <depends optional-attribute-name="ChannelMapper">jboss.messaging:service=ChannelMapper</depends>
-
- <!-- Set to -1 to completely disable client leasing -->
+ <attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
<attribute name="SecurityDomain">java:/jaas/messaging</attribute>
<attribute name="DefaultSecurityConfig">
<security>
<role name="guest" read="true" write="true" create="true"/>
</security>
</attribute>
- </mbean>
+ <attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
+ <attribute name="DefaultMaxDeliveryAttempts">10</attribute>
+ <attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
+ <attribute name="DefaultRedeliveryDelay">0</attribute>
+ <attribute name="QueueStatsSamplePeriod">5000</attribute>
+ <attribute name="FailoverStartTimeout">3000</attribute>
+ <attribute name="FailoverCompleteTimeout">12000</attribute>
+ <attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
- <!-- Plug-ins -->
+ <depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
+ <depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
+ <depends>jboss.messaging:service=Connector,transport=bisocket</depends>
- <mbean code="org.jboss.messaging.core.plugin.SimpleMessageStore"
- name="jboss.messaging:service=MessageStore"
- xmbean-dd="xmdesc/SimpleMessageStore-xmbean.xml">
- <constructor>
- <!-- StoreID -->
- <arg type="java.lang.String" value="store.0" />
- </constructor>
</mbean>
</server>
\ No newline at end of file
Modified: trunk/HibernateExt/search/src/test-resources/deploy/messaging/remoting-service.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/deploy/messaging/remoting-service.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/deploy/messaging/remoting-service.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -3,26 +3,63 @@
<!--
Messaging Remoting service deployment descriptor.
- $Id: remoting-service.xml 943 2006-05-08 21:35:39Z ovidiu $
+ $Id: remoting-service.xml 2399 2007-02-23 01:21:29Z ovidiu.feodorov(a)jboss.com $
-->
<server>
<mbean code="org.jboss.remoting.transport.Connector"
- name="jboss.messaging:service=Connector,transport=socket"
- display-name="Socket transport Connector">
+ name="jboss.messaging:service=Connector,transport=bisocket"
+ display-name="Bisocket transport Connector">
<attribute name="Configuration">
<config>
- <invoker transport="socket">
+ <invoker transport="bisocket">
<attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
<attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
- <attribute name="serializationtype" isParam="true">jboss</attribute>
+ <!-- Serialization type must be jms - do not change! -->
+ <attribute name="serializationtype" isParam="true">jms</attribute>
<attribute name="dataType" isParam="true">jms</attribute>
<attribute name="socket.check_connection" isParam="true">false</attribute>
<attribute name="timeout">0</attribute>
<attribute name="serverBindAddress">${jboss.bind.address}</attribute>
<attribute name="serverBindPort">4457</attribute>
+ <attribute name="leasePeriod">10000</attribute>
+ <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
+ <attribute name="clientSocketClass" isParam="true">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>
+ <attribute name="serverSocketClass">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>
+ <attribute name="callbackErrorsAllowed">1</attribute>
+ <attribute name="numberOfRetries" isParam="true">1</attribute>
+ <attribute name="NumberOfCallRetries" isParam="true">2</attribute>
+ <attribute name="clientMaxPoolSize" isParam="true">50</attribute>
+ </invoker>
+ <handlers>
+ <handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
+ </handlers>
+ </config>
+ </attribute>
+ <depends>jboss.messaging:service=NetworkRegistry</depends>
+ </mbean>
+
+ <!--
+ HTTP Connector example
+ -->
+ <!--
+ <mbean code="org.jboss.remoting.transport.Connector"
+ name="jboss.messaging:service=Connector,transport=http"
+ display-name="HTTP transport Connector">
+ <attribute name="Configuration">
+ <config>
+ <invoker transport="http">
+ <attribute name="marshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
+ <attribute name="unmarshaller" isParam="true">org.jboss.jms.server.remoting.JMSWireFormat</attribute>
+ <!== Serialization type must be jms - do not change! ==>
+ <attribute name="serializationtype" isParam="true">jms</attribute>
+ <attribute name="dataType" isParam="true">jms</attribute>
+ <attribute name="serverBindAddress">${jboss.bind.address}</attribute>
+ <attribute name="serverBindPort">4458</attribute>
<attribute name="leasePeriod">20000</attribute>
+ <attribute name="callbackStore">org.jboss.remoting.callback.CallbackStore</attribute>
+ <attribute name="callbackPollPeriod" isParam="true">100</attribute>
</invoker>
<handlers>
<handler subsystem="JMS">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>
@@ -31,7 +68,9 @@
</attribute>
<depends>jboss.messaging:service=NetworkRegistry</depends>
</mbean>
+ -->
+
<!-- TODO: Do I need this> -->
<mbean code="org.jboss.remoting.network.NetworkRegistry"
name="jboss.messaging:service=NetworkRegistry"/>
Modified: trunk/HibernateExt/search/src/test-resources/deployers/jca-deployers-beans.xml
===================================================================
--- trunk/HibernateExt/search/src/test-resources/deployers/jca-deployers-beans.xml 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/deployers/jca-deployers-beans.xml 2007-05-31 12:50:33 UTC (rev 11602)
@@ -4,16 +4,19 @@
JCA Deployers
-->
<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
+ <bean name="JCAMetaDataRepository" class="org.jboss.resource.metadata.repository.DefaultJCAMetaDataRepository"/>
<!-- RAR Deployment -->
<bean name="RARParserDeployer" class="org.jboss.resource.deployers.RARParserDeployer">
+ <property name="metaDataRepository"><inject bean="JCAMetaDataRepository"/></property>
<install bean="MainDeployer" method="addDeployer">
<parameter><this/></parameter>
</install>
<uninstall bean="MainDeployer" method="removeDeployer">
<parameter><this/></parameter>
</uninstall>
+ <property name="type">rar</property>
</bean>
+
<bean name="RARDeployer" class="org.jboss.resource.deployers.RARDeployer">
<property name="workManagerName">jboss.jca:service=WorkManager</property>
<property name="XATerminatorName">jboss:service=TransactionManager</property>
@@ -23,9 +26,13 @@
<uninstall bean="MainDeployer" method="removeDeployer">
<parameter><this/></parameter>
</uninstall>
+ <property name="type">rar</property>
</bean>
- <!-- ConnectionFactory Deployment -->
+
+
+ <!-- ConnectionFactory Deployment -->
+
<bean name="ConnectionFactoryDeployer" class="org.jboss.system.deployers.ServiceXSLDeployer">
<property name="suffix">-ds.xml</property>
<property name="XSLPath">stylesheets/NoJRMPConnectionFactoryTemplate.xsl</property>
@@ -35,6 +42,7 @@
<uninstall bean="MainDeployer" method="removeDeployer">
<parameter><this/></parameter>
</uninstall>
+ <property name="type">jca-ds</property>
</bean>
</deployment>
Modified: trunk/HibernateExt/search/src/test-resources/jndi.properties
===================================================================
--- trunk/HibernateExt/search/src/test-resources/jndi.properties 2007-05-31 02:53:19 UTC (rev 11601)
+++ trunk/HibernateExt/search/src/test-resources/jndi.properties 2007-05-31 12:50:33 UTC (rev 11602)
@@ -1,4 +1,4 @@
# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
#
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.factory.initial=org.jboss.naming.JBossRemotingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
17 years, 6 months
Hibernate SVN: r11601 - in trunk/HibernateExt/search: src/java/org/hibernate/search and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-30 22:53:19 -0400 (Wed, 30 May 2007)
New Revision: 11601
Modified:
trunk/HibernateExt/search/build.xml
trunk/HibernateExt/search/changelog.txt
trunk/HibernateExt/search/readme.txt
trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java
Log:
Release
Modified: trunk/HibernateExt/search/build.xml
===================================================================
--- trunk/HibernateExt/search/build.xml 2007-05-31 02:48:08 UTC (rev 11600)
+++ trunk/HibernateExt/search/build.xml 2007-05-31 02:53:19 UTC (rev 11601)
@@ -16,7 +16,7 @@
<!-- Name of project and version, used to create filenames -->
<property name="Name" value="Hibernate Search"/>
<property name="name" value="hibernate-search"/>
- <property name="version" value="3.0.0.Beta1"/>
+ <property name="version" value="3.0.0.Beta2"/>
<property name="javadoc.packagenames" value="org.hibernate.search.*"/>
<property name="copy.test" value="true"/>
<property name="javac.source" value="1.5"/>
Modified: trunk/HibernateExt/search/changelog.txt
===================================================================
--- trunk/HibernateExt/search/changelog.txt 2007-05-31 02:48:08 UTC (rev 11600)
+++ trunk/HibernateExt/search/changelog.txt 2007-05-31 02:53:19 UTC (rev 11601)
@@ -1,6 +1,34 @@
Hibernate Search Changelog
==========================
+3.0.0.Beta2 (31-05-2007)
+------------------------
+
+** Bug
+ * [HSEARCH-37] - Verify that Serializable return type are not resolved by StringBridge built in type
+ * [HSEARCH-39] - event listener declaration example is wrong
+ * [HSEARCH-44] - Build the Lucene Document in the beforeComplete transaction phase
+ * [HSEARCH-50] - Null Booleans lead to NPE
+ * [HSEARCH-59] - Unable to index @indexEmbedded object through session.index when object is lazy and field access is used in object
+
+
+** Improvement
+ * [HSEARCH-36] - Meaningful exception message when Search Listeners are not initialized
+ * [HSEARCH-38] - Make the @IndexedEmbedded documentation example easier to understand
+ * [HSEARCH-51] - Optimization: Use a query rather than batch-size to load objects when a single entity (hierarchy) is expected
+ * [HSEARCH-63] - rename query.resultSize() to getResultSize()
+
+** New Feature
+ * [HSEARCH-4] - Be able to use a Lucene Sort on queries (Hardy Ferentschik)
+ * [HSEARCH-13] - Cache IndexReaders per SearchFactory
+ * [HSEARCH-40] - Be able to embed collections in lucene index (@IndexedEmbeddable in collections)
+ * [HSEARCH-43] - Expose resultSize and do not load object when only resultSize is retrieved
+ * [HSEARCH-52] - Ability to load more efficiently an object graph from a lucene query by customizing the fetch modes
+ * [HSEARCH-53] - Add support for projection (ie read the data from the index only)
+ * [HSEARCH-61] - Move from MultiSearcher to MultiReader
+ * [HSEARCH-62] - Support pluggable ReaderProvider strategies
+
+
3.0.0.Beta1 (19-03-2007)
------------------------
Modified: trunk/HibernateExt/search/readme.txt
===================================================================
--- trunk/HibernateExt/search/readme.txt 2007-05-31 02:48:08 UTC (rev 11600)
+++ trunk/HibernateExt/search/readme.txt 2007-05-31 02:53:19 UTC (rev 11601)
@@ -1,6 +1,6 @@
Hibernate Search
==================================================
-Version: 3.0.0.Beta1, 19.03.2007
+Version: 3.0.0.Beta2, 31.05.2007
Description
-----------
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java 2007-05-31 02:48:08 UTC (rev 11600)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/Version.java 2007-05-31 02:53:19 UTC (rev 11601)
@@ -10,7 +10,7 @@
* @author Emmanuel Bernard
*/
public class Version {
- public static final String VERSION = "3.0.0.Beta2-SNAPSHOT" + new Date();
+ public static final String VERSION = "3.0.0.Beta2" + new Date();
private static Log log = LogFactory.getLog( Version.class );
static {
17 years, 6 months
Hibernate SVN: r11600 - in trunk/HibernateExt/search: doc/reference/en/modules and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-30 22:48:08 -0400 (Wed, 30 May 2007)
New Revision: 11600
Modified:
trunk/HibernateExt/search/doc/reference/en/master.xml
trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml
trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml
trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml
trunk/HibernateExt/search/doc/reference/en/modules/query.xml
trunk/HibernateExt/search/src/java/org/hibernate/search/reader/ReaderProvider.java
Log:
HSEARCH-39
HSEARCH-38
Update search documentation
Modified: trunk/HibernateExt/search/doc/reference/en/master.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/master.xml 2007-05-30 20:25:23 UTC (rev 11599)
+++ trunk/HibernateExt/search/doc/reference/en/master.xml 2007-05-31 02:48:08 UTC (rev 11600)
@@ -1,25 +1,25 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3CR3//EN"
- "../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
- <!ENTITY architecture SYSTEM "modules/architecture.xml">
- <!ENTITY configuration SYSTEM "modules/configuration.xml">
- <!ENTITY mapping SYSTEM "modules/mapping.xml">
- <!ENTITY query SYSTEM "modules/query.xml">
- <!ENTITY batchindex SYSTEM "modules/batchindex.xml">
- ]>
+"../../../../../Hibernate3/doc/reference/support/docbook-dtd/docbookx.dtd" [
+<!ENTITY architecture SYSTEM "modules/architecture.xml">
+<!ENTITY configuration SYSTEM "modules/configuration.xml">
+<!ENTITY mapping SYSTEM "modules/mapping.xml">
+<!ENTITY query SYSTEM "modules/query.xml">
+<!ENTITY batchindex SYSTEM "modules/batchindex.xml">
+]>
<book lang="en">
<bookinfo>
<title>Hibernate Search</title>
- <subtitle>Apache <trademark>Lucene</trademark>
- Integration</subtitle>
+ <subtitle>Apache <trademark>Lucene</trademark> Integration</subtitle>
+
<subtitle>Reference Guide</subtitle>
- <releaseinfo>3.0.0.Beta1</releaseinfo>
+ <releaseinfo>3.0.0.Beta2</releaseinfo>
<mediaobject>
<imageobject>
- <imagedata fileref="images/hibernate_logo_a.png" format="png"/>
+ <imagedata fileref="images/hibernate_logo_a.png" format="png" />
</imageobject>
</mediaobject>
</bookinfo>
@@ -29,29 +29,29 @@
<preface id="preface" revision="2">
<title>Preface</title>
- <para>Full text search engines like <productname>Apache Lucene</productname>
- are a very powerful technology to
-bring free text/efficient queries to applications. If suffers several mismatches
-when dealing with a object domain model (keeping the index up to date, mismatch
-between the index structure and the domain model, querying mismatch...)
-Hibernate Search indexes your domain model thanks to a few annotations, takes
-care of the database / index synchronization and brings you back regular managed
-objects from free text queries.
-Hibernate Search is using <ulink url="http://lucene.apache.org">Apache Lucene</ulink>
-under the cover.</para>
+ <para>Full text search engines like <productname>Apache
+ Lucene</productname> are a very powerful technology to bring free
+ text/efficient queries to applications. If suffers several mismatches when
+ dealing with a object domain model (keeping the index up to date, mismatch
+ between the index structure and the domain model, querying mismatch...)
+ Hibernate Search indexes your domain model thanks to a few annotations,
+ takes care of the database / index synchronization and brings you back
+ regular managed objects from free text queries. Hibernate Search is using
+ <ulink url="http://lucene.apache.org">Apache Lucene</ulink> under the
+ cover.</para>
- <para>Hibernate Search is a work in progress and new features are cooking in
- this area. So expect some compatibility changes in subsequent
- versions.</para>
+ <para>Hibernate Search is a work in progress and new features are cooking
+ in this area. So expect some compatibility changes in subsequent
+ versions.</para>
</preface>
- &architecture;
+ &architecture;
- &configuration;
+ &configuration;
- &mapping;
+ &mapping;
- &query;
+ &query;
- &batchindex;
+ &batchindex;
</book>
\ No newline at end of file
Modified: trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml 2007-05-30 20:25:23 UTC (rev 11599)
+++ trunk/HibernateExt/search/doc/reference/en/modules/architecture.xml 2007-05-31 02:48:08 UTC (rev 11600)
@@ -6,31 +6,29 @@
engine. Both are backed by Apache Lucene.</para>
<para>When an entity is inserted, updated or removed to/from the database,
- Hibernate Search keeps track of this event
- (through the Hibernate event system) and schedule an index update. All the
- index updates are handled for you without you having to use the Apache
- Lucene APIs.</para>
+ Hibernate Search keeps track of this event (through the Hibernate event
+ system) and schedule an index update. All the index updates are handled for
+ you without you having to use the Apache Lucene APIs.</para>
<para>To interact with Apache Lucene indexes, Hibernate Search has the
notion of <classname>DirectoryProvider</classname> . A directory provider
will manage a given Lucene <classname>Directory</classname> type. You can
configure directory providers to adjust the directory target.</para>
- <para>Hibernate Search can also use a Lucene
- index to search an entity and return a (list of) managed entity saving you
- from the tedious Object / Lucene Document mapping and low level Lucene APIs.
- The same persistence context is shared between Hibernate and Hibernate
- Search ; as a matter of fact, the Seearch Session is built on top of the
- Hibernate Session. The application code use the unified
- <classname>org.hibernate.Query</classname> API exactly the way a HQL or
- native query would be done.</para>
+ <para>Hibernate Search can also use a Lucene index to search an entity and
+ return a (list of) managed entity saving you from the tedious Object /
+ Lucene Document mapping and low level Lucene APIs. The same persistence
+ context is shared between Hibernate and Hibernate Search ; as a matter of
+ fact, the Search Session is built on top of the Hibernate Session. The
+ application code use the unified <classname>org.hibernate.Query</classname>
+ API exactly the way a HQL or native query would be done.</para>
<section>
<title>Batching Scope</title>
- <para>To be more efficient, Hibernate Search batch the interactions with
- the Lucene index. There is currently two types of batching depending on
- the expected scope.</para>
+ <para>To be more efficient, Hibernate Search batch the write interactions
+ with the Lucene index. There is currently two types of batching depending
+ on the expected scope.</para>
<para>When out of transaction, the index update operation is executed
right after the actual database operation. This scope is really a no
@@ -55,9 +53,9 @@
the transaction is committed.</para>
<note>
- <para>Disclamer, the work in not ACID in the strict sense of it, but
- ACID behavior is rarely useful for full text search indexes since
- they can be rebuilt from the source at any time.</para>
+ <para>Disclaimer, the work in not ACID in the strict sense of it,
+ but ACID behavior is rarely useful for full text search indexes
+ since they can be rebuilt from the source at any time.</para>
</note>
</listitem>
</itemizedlist>
@@ -80,7 +78,7 @@
<para>Hibernate Search offers the ability to let the scoped work being
processed by different back ends. Two back ends are provided out of the
- box for 2 different scenarii.</para>
+ box for 2 different scenarios.</para>
<section>
<title>Lucene</title>
@@ -146,8 +144,8 @@
<title>Custom</title>
<para>Hibernate Search is an extensible architecture. While not yet part
- of the public API, pluging a third party back end is possible. Feel free
- to drop ideas to
+ of the public API, plugging a third party back end is possible. Feel
+ free to drop ideas to
<literal>hibernate-dev(a)lists.jboss.org</literal>.</para>
</section>
</section>
@@ -185,4 +183,44 @@
completely unrealistic way).</para>
</section>
</section>
+
+ <section id="search-architecture-readerstrategy" xreflabel="Reader strategy">
+ <title>Reader strategy</title>
+
+ <para>When executing a query, Hibernate Search interacts with the Apache
+ Lucene indexes through a reader strategy.</para>
+
+ <section>
+ <title>not-shared</title>
+
+ <para>Every time a query is executed, a Lucene IndexReader is opened.
+ This strategy is not the most efficient, opening and warming up an
+ IndexReader can be a relatively expensive operation. This strategy is
+ the default, but will be changed in the future.</para>
+ </section>
+
+ <section>
+ <title>shared</title>
+
+ <para>Hibernate Search will share the same IndexReader for a given index
+ provided that the IndexReader is still up-to-date. Generally speaking,
+ this strategy provides much better performance than the previous one. It
+ is especially true if the number of updates is much lower than the
+ read.</para>
+ </section>
+
+ <section>
+ <title>custom</title>
+
+ <para>You can write your own reader strategy that suits your application
+ needs by implementing
+ <classname>org.hibernate.search.reader.ReaderProvider</classname>. The
+ implementation must be thread safe.</para>
+
+ <note>
+ <para>Some additional strategies are planned in future versions of
+ Hibernate Search</para>
+ </note>
+ </section>
+ </section>
</chapter>
\ No newline at end of file
Modified: trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml 2007-05-30 20:25:23 UTC (rev 11599)
+++ trunk/HibernateExt/search/doc/reference/en/modules/configuration.xml 2007-05-31 02:48:08 UTC (rev 11600)
@@ -351,6 +351,26 @@
</section>
</section>
+ <section>
+ <title>Reader strategy configuration</title>
+
+ <para>The different reader strategies are described in <xref
+ linkend="search-architecture-readerstrategy" /> .The default reader
+ strategy is <literal>not-shared</literal>. This can be adjusted:</para>
+
+ <programlisting>hibernate.search.reader.strategy = shared</programlisting>
+
+ <para>Adding this property switch to the <literal>shared</literal>
+ strategy.</para>
+
+ <para>Or if you have a custom reader strategy:</para>
+
+ <programlisting>hibernate.search.reader.strategy = my.corp.myapp.CustomReaderProvider</programlisting>
+
+ <para>where <classname>my.corp.myapp.CustomReaderProvider</classname> is
+ the custom strategy implementation</para>
+ </section>
+
<section id="search-configuration-event" revision="2">
<title>Enabling automatic indexing</title>
@@ -367,18 +387,20 @@
configuration is not useful with Hibernate Annotations or Hibernate
EntityManager.</para>
- <programlisting><session-factory>
- ...
- <event type="post-update"
- <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
- </event>
- <event type="post-insert"
- <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
- </event>
- <event type="post-delete"
- <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
- </event>
-</session-factory></programlisting>
+ <programlisting><hibernate-configuration>
+ <session-factory>
+ ...
+ <event type="post-update"
+ <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
+ </event>
+ <event type="post-insert"
+ <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
+ </event>
+ <event type="post-delete"
+ <listener class="org.hibernate.search.event.FullTextIndexEventListener"/>
+ </event>
+ </session-factory>
+</hibernate-configuration></programlisting>
<para>Be sure to add the appropriate jar files in your classpath. Check
<literal>lib/README.TXT</literal> for the list of third party libraries. A
Modified: trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml 2007-05-30 20:25:23 UTC (rev 11599)
+++ trunk/HibernateExt/search/doc/reference/en/modules/mapping.xml 2007-05-31 02:48:08 UTC (rev 11600)
@@ -49,13 +49,14 @@
<listitem>
<para><literal>store</literal> : describe whether or not the
property is stored in the Lucene index. You can store the value
- <literal>Store.YES</literal> (comsuming more space in the index),
- store it in a compressed way <literal>Store.COMPRESS</literal> (this
- does consume more CPU), or avoid any storage
- <literal>Store.NO</literal> (this is the default value). When a
- property is stored, you can retrieve it from the Lucene Document
- (note that this is not related to whether the element is indexed or
- not).</para>
+ <literal>Store.YES</literal> (comsuming more space in the index but
+ allowing projection, see <xref linkend="search-query" /> for more
+ information), store it in a compressed way
+ <literal>Store.COMPRESS</literal> (this does consume more CPU), or
+ avoid any storage <literal>Store.NO</literal> (this is the default
+ value). When a property is stored, you can retrieve it from the
+ Lucene Document (note that this is not related to whether the
+ element is indexed or not).</para>
</listitem>
<listitem>
@@ -74,18 +75,22 @@
annotation.</para>
<para>Whether or not you want to store the data depends on how you wish
- to use the index query result. As of today, for a pure
- Hibernate Search usage, storing is not
- necessary. Whether or not you want to tokenize a property or not depends
- on whether you wish to search the element as is, or only normalized part
- of it. It make sense to tokenize a text field, but it does not to do it
- for a date field (or an id field).</para>
+ to use the index query result. For a regular Hibernate Search usage,
+ storing is not necessary. However you might want to store some fields to
+ subsequently project them (see <xref linkend="search-query" /> for more
+ information). </para>
+ <para>Whether or not you want to tokenize a property depends on whether
+ you wish to search the element as is, or by the words it contains. It
+ make sense to tokenize a text field, but it does not to do it for a date
+ field (or an id field). Note that fields used for sorting must not be
+ tokenized.</para>
+
<para>Finally, the id property of an entity is a special property used
- by Hibernate Search to ensure index unicity
- of a given entity. By design, an id has to be stored and must not be
- tokenized. To mark a property as index id, use the
- <literal>@DocumentId</literal> annotation.</para>
+ by Hibernate Search to ensure index unicity of a given entity. By
+ design, an id has to be stored and must not be tokenized. To mark a
+ property as index id, use the <literal>@DocumentId</literal>
+ annotation.</para>
<programlisting>@Entity
@Indexed(index="indexes/essays")
@@ -153,6 +158,58 @@
@Field(index=Index.TOKENIZED)
private String city;
+ <emphasis role="bold">@ContainedIn</emphasis>
+ @OneToMany(mappedBy="address")
+ private Set<Place> places;
+ ...
+}</programlisting>
+
+ <para>In this example, the place fields will be indexed in the
+ <literal>Place</literal> index. The <literal>Place</literal> index
+ documents will also contain the fields <literal>address.id</literal>,
+ <literal>address.street</literal>, and <literal>address.city</literal>
+ which you will be able to query from. This is done thanks to the
+ <literal>@IndexedEmbedded</literal> annotation.</para>
+
+ <para><literal>@ContainedIn</literal> is useful on embedded objects that
+ are also entities (like <literal>Address</literal> in the example): it
+ basically means that when an address entity is updated, the index
+ document of the associated <literal>Place</literal>(s), also have to be
+ updated.</para>
+
+ <para>Let's make our example a bit more complex:</para>
+
+ <programlisting>@Entity
+@Indexed
+public class Place {
+ @Id
+ @GeneratedValue
+ @DocumentId
+ private Long id;
+
+ @Field( index = Index.TOKENIZED )
+ private String name;
+
+ @OneToOne( cascade = { CascadeType.PERSIST, CascadeType.REMOVE } )
+ <emphasis role="bold">@IndexedEmbedded</emphasis>
+ private Address address;
+ ....
+}
+
+@Entity
+@Indexed
+public class Address {
+ @Id
+ @GeneratedValue
+ @DocumentId
+ private Long id;
+
+ @Field(index=Index.TOKENIZED)
+ private String street;
+
+ @Field(index=Index.TOKENIZED)
+ private String city;
+
<emphasis role="bold">@IndexedEmbedded(depth = 1, prefix = "ownedBy_")</emphasis>
private Owner ownedBy;
@@ -199,10 +256,11 @@
<para>The default prefix is <literal>propertyName.</literal>, following
the traditional object navigation convention. You can override it using
- the <literal>prefix</literal> attribute.</para>
+ the <literal>prefix</literal> attribute as it is shown on the
+ <literal>ownedBy</literal> property.</para>
<para><literal>depth</literal> is necessary when the object graph
- contains a cyclic dependency of classes (not instance). For example, if
+ contains a cyclic dependency of classes (not instances). For example, if
<classname>Owner</classname> points to <classname>Place</classname>.
Hibernate Search will stop including Indexed embedded atttributes after
reaching the expected depth (or is the object graph boundaries are
@@ -211,8 +269,9 @@
1, any <literal>@IndexedEmbedded</literal> attribute in Owner (if any)
will be ignored.</para>
- <para>Such a mapping is very useful to express queries refering to
- associated objects, such as:</para>
+ <para>Such a feature (<literal>@IndexedEmbedded</literal>) is very
+ useful to express queries refering to associated objects, such
+ as:</para>
<itemizedlist>
<listitem>
@@ -249,6 +308,15 @@
associated entity is updated (in ou example, a <literal>Place</literal>
index document has to be updated when the associated
<classname>Address</classname> instance is updated.</para>
+
+ <note>
+ <para><literal>@IndexedEmbedded</literal> is supported on collections
+ too (ie to index associated object included in collections). But the
+ support is only partially implemented. It will depend on how you
+ update collections (Check HSEARCH-56 in JIRA for more informations).
+ The workaround is to manually index the object
+ (session.index())</para>
+ </note>
</section>
<section>
@@ -302,10 +370,9 @@
<para>All field of a full text index in Lucene have to be represented as
Strings. Ones Java properties have to be indexed in a String form. For
- most of your properties, Hibernate Search does
- the translation job for you thanks to a built-in set of bridges. In some
- cases, though you need a fine grain control over the translation
- process.</para>
+ most of your properties, Hibernate Search does the translation job for you
+ thanks to a built-in set of bridges. In some cases, though you need a fine
+ grain control over the translation process.</para>
<section>
<title>Built-in bridges</title>
Modified: trunk/HibernateExt/search/doc/reference/en/modules/query.xml
===================================================================
--- trunk/HibernateExt/search/doc/reference/en/modules/query.xml 2007-05-30 20:25:23 UTC (rev 11599)
+++ trunk/HibernateExt/search/doc/reference/en/modules/query.xml 2007-05-31 02:48:08 UTC (rev 11600)
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="search-query">
+<chapter id="search-query" xreflabel="Querying">
<title>Querying</title>
<para>The second most important capability of <productname>Hibernate Search
</productname> is the ability to execute a Lucene query and retrieve
entities managed by an Hibernate session, providing the power of Lucene
- without living the Hibernate paradygm, and giving another dimension to the
+ without living the Hibernate paradigm, and giving another dimension to the
Hibernate classic search mechanisms (HQL, Criteria query, native SQL
query).</para>
<para>To access the <productname>Hibernate Search</productname> querying
facilities, you have to use an Hibernate
- <classname>FullTextSession</classname> . A SearchSession wrap an regular
+ <classname>FullTextSession</classname> . A Search Session wrap an regular
<classname>org.hibernate.Session</classname> to provide query and indexing
capabilities.</para>
@@ -30,33 +30,257 @@
List result = fullTextQuery.list(); //return a list of managed objects </programlisting>
<para>The Hibernate query built on top of the Lucene query is a regular
- <literal>org.hibernate.Query</literal> , you are is the same paradygm as the
+ <literal>org.hibernate.Query</literal> , you are is the same paradigm as the
other Hibernate query facilities (HQL, Native or Criteria). The regular
<literal>list()</literal> , <literal>uniqueResult()</literal> ,
<literal>iterate()</literal> and <literal>scroll()</literal> can be
used.</para>
- <para>If you expect a reasonnable result number and expect to work on all of
- them, <methodname>list()</methodname> or
- <methodname>uniqueResult()</methodname> are recommanded.
- <methodname>list()</methodname> work best if the entity
- <literal>batch-size</literal> is set up properly. Note that Hibernate Seach
- has to process all Lucene Hits elements when using
- <methodname>list()</methodname> , <methodname>uniqueResult()</methodname>
- and <methodname>iterate()</methodname> . If you wish to minimize Lucene
- document loading, <methodname>scroll()</methodname> is more appropriate,
- Don't forget to close the <classname>ScrollableResults</classname> object
- when you're done, since it keeps Lucene resources.</para>
+ <section>
+ <title>Building queries</title>
- <para>An efficient way to work with queries is to use pagination. The
- pagination API is exactly the one available in
- <classname>org.hibernate.Query</classname> :</para>
+ <para>Hibernate Search queries are built on top of a Lucene query. It
+ gives you a total freedom on the kind of Lucene queries you are willing to
+ execute. However, once built, Hibernate Search abstract the query
+ processing from your application using org.hibernate.Query as your primary
+ query manipulation API.</para>
- <programlisting><emphasis role="bold">org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery );
- </emphasis>
-fullTextQuery.setFirstResult(30);
-fullTextQuery.setMaxResult(20);
-fullTextQuery.list(); //will return a list of 20 elements starting from the 30th </programlisting>
+ <section>
+ <title>Building a Lucene query</title>
- <para>Only the relevant Lucene Documents are accessed.</para>
+ <para>This subject is generally speaking out of the scope of this
+ documentation. Please refer to the Lucene documentation or Lucene In
+ Action.</para>
+ </section>
+
+ <section>
+ <title>Building an Hibernate Search query</title>
+
+ <section>
+ <title>Generality</title>
+
+ <para>Once the Lucene query is built, it needs to be wrapped into an
+ Hibernate Query.</para>
+
+ <programlisting>FullTextSession fullTextSession = Search.createFullTextSession( session );
+org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery );</programlisting>
+
+ <para>If not specified, the query will be applied on all indexed,
+ potentially returning all types of indexed classes. It is advised, for
+ a performance point of view to restrict the returned types:</para>
+
+ <programlisting>org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, Customer.class );
+//or
+fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, Item.class, Actor.class );</programlisting>
+
+ <para>The first example returns only matching customers, the second
+ returns matching actors and items.</para>
+ </section>
+
+ <section>
+ <title>Pagination</title>
+
+ <para>It is recommended to restrict the number of returned objects per
+ query. It is a very common use case as well, the user usually navigate
+ from one page to an other. The way to define pagination is exactly the
+ way you would define pagination in a plain HQL or Criteria
+ query.</para>
+
+ <programlisting>org.hibernate.Query fullTextQuery = fullTextSession.createFullTextQuery( luceneQuery, Customer.class );
+fullTextQuery.setFirstResult(15); //start from the 15th element
+fullTextQuery.setMaxResults(10); //return 10 elements</programlisting>
+
+ <note>
+ <para>It is still possible to get the total number of matching
+ elements regardless of the pagination. See
+ <methodname>getResultSize()</methodname> below</para>
+ </note>
+ </section>
+
+ <section>
+ <title>Sorting</title>
+
+ <para>Apache Lucene provides a very flexible and powerful way to sort
+ results. While the default sorting (by relevance) is appropriate most
+ of the time, it can interesting to sort by one or several
+ properties.</para>
+
+ <para>Inject the Lucene Sort object to apply a Lucene sorting strategy
+ to an Hibernate Search.</para>
+
+ <programlisting>org.hibernate.search.FullTextQuery query = s.createFullTextQuery( query, Book.class );
+org.apache.lucene.search.Sort sort = new Sort(new SortField("title"));
+<emphasis role="bold">query.setSort(sort);</emphasis>
+List results = query.list();</programlisting>
+
+ <para>One can notice the <classname>FullTextQuery</classname>
+ interface which is a sub interface of
+ <classname>org.hibernate.Query</classname>.</para>
+
+ <para>Fields used for sorting ust not be tokenized.</para>
+ </section>
+
+ <section>
+ <title>Fetching strategy</title>
+
+ <para>When you restrict the return types to one class, Hibernate
+ Search load the objects and respect the static fetching strategy
+ defined in your domain model using a single query.</para>
+
+ <para>It is often useful, however, to refine the fetching strategy for
+ a specific use case.</para>
+
+ <programlisting>Criteria criteria = s.createCriteria( Book.class ).setFetchMode( "authors", FetchMode.JOIN );
+s.createFullTextQuery( luceneQuery ).setCriteriaQuery( criteria );</programlisting>
+
+ <para>In this example, the query will return all Books matching the
+ luceneQuery. The authors collection will be loaded from the same query
+ using an SQL outer join.</para>
+
+ <para>When defining a criteria query, it is not needed to restrict the
+ entity types returned while creating the Hibernate Search query from
+ the full text session: the type is guessed from the criteria query
+ itself.</para>
+
+ <para>One cannot use <methodname>setCriteriaQuery</methodname> if more
+ than one entity type is expected to be returned.</para>
+ </section>
+
+ <section>
+ <title>Projection</title>
+
+ <para>For some use cases, returning the domain object (graph) is
+ overkill. Only a small subset of the properties is necessary.
+ Hibernate Search allows you to return only some properties:</para>
+
+ <programlisting>org.hibernate.search.FullTextQuery query = s.createFullTextQuery( luceneQuery, Book.class );
+query.<emphasis role="bold">setIndexProjection( "id", "summary", "body", "mainAuthor.name" )</emphasis>;
+List results = query.list();
+Object[] firstResult = (Object[]) results.get(0);
+Integer id = firstResult[0];
+String summary = firstResult[1];
+String body = firstResult[2];
+String authorName = firstResult[3];</programlisting>
+
+ <para>Hibernate Search extracts the properties from the Lucene index
+ and convert them back to their object representation, returning a list
+ of <classname>Object[]</classname>. Projections avoid a potential
+ database round trip (useful if the query response time is critical),
+ but has some constraints:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>the properties projected must be stored in the index
+ (<literal>@Field(store=Store.YES)</literal>), which increase the
+ index size</para>
+ </listitem>
+
+ <listitem>
+ <para>the properties projected must use a
+ <literal>FieldBridge</literal> implementing
+ <classname>org.hibernate.search.bridge.TwoWayFieldBridge</classname>
+ or
+ <literal>org.hibernate.search.bridge.TwoWayStringBridge</literal>,
+ the latter being the simpler version</para>
+ </listitem>
+ </itemizedlist>
+
+ <para></para>
+ </section>
+ </section>
+ </section>
+
+ <section>
+ <title>Retrieving the results</title>
+
+ <para>Once the Hibernate Search query is built, executing it is in no way
+ different than executing a HQL or Criteria query. The same paradigm and
+ object semantic apply. All the common operations are available:
+ <methodname>list()</methodname>, <methodname>uniqueResult()</methodname>,
+ <methodname>iterate()</methodname>,
+ <methodname>scroll()</methodname>.</para>
+
+ <section>
+ <title>Performance considerations</title>
+
+ <para>If you expect a reasonable result number (for example using
+ pagination) and expect to work on all of them,
+ <methodname>list()</methodname> or
+ <methodname>uniqueResult()</methodname> are recommended.
+ <methodname>list()</methodname> work best if the entity
+ <literal>batch-size</literal> is set up properly. Note that Hibernate
+ Search has to process all Lucene Hits elements (within the pagination)
+ when using <methodname>list()</methodname> ,
+ <methodname>uniqueResult()</methodname> and
+ <methodname>iterate()</methodname>. If you wish to minimize Lucene
+ document loading, <methodname>scroll()</methodname> is more appropriate,
+ Don't forget to close the <classname>ScrollableResults</classname>
+ object when you're done, since it keeps Lucene resources. Pagination is
+ a preferred method over scrolling though.</para>
+ </section>
+
+ <section>
+ <title>Result size</title>
+
+ <para>It is sometime useful to know the total number of matching
+ documents:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>for the Google-like feature 1-10 of about 888,000,000 </para>
+ </listitem>
+
+ <listitem>
+ <para>to implement a fast pagination navigation</para>
+ </listitem>
+
+ <listitem>
+ <para>to implement a multi step search engine (adding approximation
+ if the restricted query return no or not enough results)</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>But it would be costly to retrieve all the matching
+ documents.</para>
+
+ <para>Hibernate Search allows you to retrieve the total number of
+ matching documents regardless of the pagination parameters. Even more
+ interesting, you can retrieve the number of matching elements without
+ even triggering a single object load.</para>
+
+ <programlisting>org.hibernate.search.FullTextQuery query = s.createFullTextQuery( luceneQuery, Book.class );
+assert 3245 == <emphasis role="bold">query.getResultSize()</emphasis>; //return the number of matching books without loading a single one
+
+org.hibernate.search.FullTextQuery query = s.createFullTextQuery( luceneQuery, Book.class );
+query.setMaxResult(10);
+List results = query.list();
+assert 3245 == <emphasis role="bold">query.getResultSize()</emphasis>; //return the total number of matching books regardless of pagination</programlisting>
+
+ <para></para>
+ </section>
+ </section>
+
+ <section>
+ <title>Optimizing the query process</title>
+
+ <para>Query performance depends on several criteria:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>the Lucene query itself: read the literature on this
+ subject</para>
+ </listitem>
+
+ <listitem>
+ <para>the number of object loaded: use pagination (always ;-) ) or
+ index projection (if needed)</para>
+ </listitem>
+
+ <listitem>
+ <para>the way Hibernate Search interacts with the Lucene readers:
+ defines the appropriate <xref
+ linkend="search-architecture-readerstrategy" />.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
</chapter>
\ No newline at end of file
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/reader/ReaderProvider.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/reader/ReaderProvider.java 2007-05-30 20:25:23 UTC (rev 11599)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/reader/ReaderProvider.java 2007-05-31 02:48:08 UTC (rev 11600)
@@ -12,6 +12,8 @@
* <p/>
* Not that the reader must be closed once opened.
*
+ * The ReaderProvider implementation must have a no-arg constructor
+ *
* @author Emmanuel Bernard
*/
public interface ReaderProvider {
17 years, 6 months
Hibernate SVN: r11599 - trunk/HibernateExt/search/src/java/org/hibernate/search/engine.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-30 16:25:23 -0400 (Wed, 30 May 2007)
New Revision: 11599
Modified:
trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java
Log:
Raise an exception if a field is not projectable
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java 2007-05-30 20:24:24 UTC (rev 11598)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/engine/DocumentBuilder.java 2007-05-30 20:25:23 UTC (rev 11599)
@@ -590,11 +590,12 @@
}
}
else {
- //FIXME else exception?
- if ( log.isTraceEnabled() ) {
- log.trace( "Field " + fieldName + " not projected: Store = " + store + " and isTwoWay = "
- + TwoWayFieldBridge.class.isAssignableFrom( fieldBridge.getClass() ) );
+ if ( store == Field.Store.NO ) {
+ throw new SearchException("Projecting an unstored field: " + fieldName);
}
+ else {
+ throw new SearchException( "FieldBridge is not a TwoWayFieldBridge: " + fieldBridge.getClass() );
+ }
}
}
}
17 years, 6 months
Hibernate SVN: r11598 - in trunk/HibernateExt/search/src: java/org/hibernate/search/query and 1 other directories.
by hibernate-commits@lists.jboss.org
Author: epbernard
Date: 2007-05-30 16:24:24 -0400 (Wed, 30 May 2007)
New Revision: 11598
Modified:
trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java
trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java
trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java
Log:
Rename setProjection to setIndexProjection
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java 2007-05-30 03:05:58 UTC (rev 11597)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/FullTextQuery.java 2007-05-30 20:24:24 UTC (rev 11598)
@@ -58,5 +58,5 @@
* If the projected field is not a projectable field, null is returned in the object[]
*
*/
- FullTextQuery setProjection(String... fields);
+ FullTextQuery setIndexProjection(String... fields);
}
Modified: trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java
===================================================================
--- trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java 2007-05-30 03:05:58 UTC (rev 11597)
+++ trunk/HibernateExt/search/src/java/org/hibernate/search/query/FullTextQueryImpl.java 2007-05-30 20:24:24 UTC (rev 11598)
@@ -63,7 +63,7 @@
private Integer resultSize;
private Sort sort;
private Criteria criteria;
- private String[] projection;
+ private String[] indexProjection;
/**
* classes must be immutable
@@ -105,9 +105,9 @@
Session sess = (Session) this.session;
List<EntityInfo> entityInfos = new ArrayList<EntityInfo>( max - first + 1 );
- DocumentExtractor extractor = new DocumentExtractor( searchFactory, projection );
+ DocumentExtractor extractor = new DocumentExtractor( searchFactory, indexProjection );
for ( int index = first; index <= max; index++ ) {
- //TODO use indexSearcher.getIndexReader().document( hits.id(index), FieldSelector(projection) );
+ //TODO use indexSearcher.getIndexReader().document( hits.id(index), FieldSelector(indexProjection) );
Document document = hits.doc( index );
entityInfos.add( extractor.extract( document ) );
}
@@ -128,7 +128,7 @@
}
private Loader getLoader(Session session, SearchFactory searchFactory) {
- if (projection != null) {
+ if ( indexProjection != null) {
ProjectionLoader loader = new ProjectionLoader();
loader.init( session, searchFactory );
return loader;
@@ -181,7 +181,7 @@
hits = getHits( searcher );
int first = first();
int max = max( first, hits );
- DocumentExtractor extractor = new DocumentExtractor( searchFactory, projection );
+ DocumentExtractor extractor = new DocumentExtractor( searchFactory, indexProjection );
Loader loader = getLoader( (Session) this.session, searchFactory );
return new ScrollableResultsImpl( searcher, hits, first, max, extractor, loader, searchFactory);
}
@@ -214,7 +214,7 @@
int max = max( first, hits );
Session sess = (Session) this.session;
List<EntityInfo> infos = new ArrayList<EntityInfo>( max - first + 1 );
- DocumentExtractor extractor = new DocumentExtractor( searchFactory, projection );
+ DocumentExtractor extractor = new DocumentExtractor( searchFactory, indexProjection );
for ( int index = first; index <= max; index++ ) {
Document document = hits.doc( index );
infos.add( extractor.extract( document ) );
@@ -374,12 +374,12 @@
return this;
}
- public FullTextQuery setProjection(String... fields) {
+ public FullTextQuery setIndexProjection(String... fields) {
if ( fields == null || fields.length == 0) {
- this.projection = null;
+ this.indexProjection = null;
}
else {
- this.projection = fields;
+ this.indexProjection = fields;
}
return this;
}
Modified: trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java
===================================================================
--- trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java 2007-05-30 03:05:58 UTC (rev 11597)
+++ trunk/HibernateExt/search/src/test/org/hibernate/search/test/query/ProjectionQueryTest.java 2007-05-30 20:24:24 UTC (rev 11598)
@@ -32,7 +32,7 @@
Query query = parser.parse( "summary:Festina" );
org.hibernate.search.FullTextQuery hibQuery = s.createFullTextQuery( query, Book.class );
- hibQuery.setProjection( "id", "summary", "body", "mainAuthor.name");
+ hibQuery.setIndexProjection( "id", "summary", "body", "mainAuthor.name");
List result = hibQuery.list();
assertNotNull( result );
@@ -44,14 +44,14 @@
assertEquals( "mainAuthor.name (embedded objects)", "Emmanuel", projection[3] );
hibQuery = s.createFullTextQuery( query, Book.class );
- hibQuery.setProjection();
+ hibQuery.setIndexProjection();
result = hibQuery.list();
assertNotNull( result );
assertEquals( 1, result.size() );
assertTrue( "Should not trigger projection", result.get(0) instanceof Book);
hibQuery = s.createFullTextQuery( query, Book.class );
- hibQuery.setProjection(null);
+ hibQuery.setIndexProjection(null);
result = hibQuery.list();
assertNotNull( result );
assertEquals( 1, result.size() );
17 years, 6 months
Hibernate SVN: r11597 - in trunk/sandbox/maven-poc: docbook and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-05-29 23:05:58 -0400 (Tue, 29 May 2007)
New Revision: 11597
Added:
trunk/sandbox/maven-poc/docbook/1.70.1/
Removed:
trunk/sandbox/maven-poc/1.70.1/
Log:
prep adding docbook 1.72
Copied: trunk/sandbox/maven-poc/docbook/1.70.1 (from rev 11596, trunk/sandbox/maven-poc/1.70.1)
17 years, 6 months
Hibernate SVN: r11596 - trunk/sandbox/maven-poc.
by hibernate-commits@lists.jboss.org
Author: steve.ebersole(a)jboss.com
Date: 2007-05-29 23:04:06 -0400 (Tue, 29 May 2007)
New Revision: 11596
Added:
trunk/sandbox/maven-poc/docbook/
Log:
prep adding docbook 1.72
17 years, 6 months