Hibernate SVN: r19886 - in search/trunk: hibernate-search and 5 other directories.
by hibernate-commits@lists.jboss.org
Author: hardy.ferentschik
Date: 2010-07-01 16:29:15 -0400 (Thu, 01 Jul 2010)
New Revision: 19886
Modified:
search/trunk/hibernate-search/pom.xml
search/trunk/hibernate-search/src/main/docbook/en-US/modules/configuration.xml
search/trunk/hibernate-search/src/main/docbook/en-US/modules/mapping.xml
search/trunk/hibernate-search/src/main/docbook/pot/master.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/architecture.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/batchindex.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/configuration.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/getting-started.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/lucene-native.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/mapping.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/optimize.pot
search/trunk/hibernate-search/src/main/docbook/pot/modules/query.pot
search/trunk/hibernate-search/src/main/docbook/zh-CN/master.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/architecture.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/batchindex.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/configuration.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/getting-started.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/lucene-native.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/mapping.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/optimize.po
search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/query.po
search/trunk/pom.xml
Log:
HSEARCH-487 Updated the jdocbook plugin configuration and applied some changes to documentation which stopped po2xml to work
Modified: search/trunk/hibernate-search/pom.xml
===================================================================
--- search/trunk/hibernate-search/pom.xml 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/pom.xml 2010-07-01 20:29:15 UTC (rev 19886)
@@ -151,39 +151,13 @@
<artifactId>maven-jdocbook-plugin</artifactId>
<configuration>
<sourceDocumentName>master.xml</sourceDocumentName>
- <sourceDirectory>${basedir}/src/main/docbook</sourceDirectory>
<masterTranslation>en-US</masterTranslation>
- <!-- translations>
+ <translations>
<translation>zh-CN</translation>
- </translations -->
+ </translations>
<imageResource>
<directory>${basedir}/src/main/docbook/en-US/images</directory>
</imageResource>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/pdf.xsl</stylesheetResource>
- <finalName>hibernate_search_reference.pdf</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl </stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl </stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
- <!-- could also locate the docbook dependency and inspect its version... -->
- <docbookVersion>1.72.0</docbookVersion>
- <localeSeparator>-</localeSeparator>
- </options>
<profiling>
<enabled>true</enabled>
</profiling>
Modified: search/trunk/hibernate-search/src/main/docbook/en-US/modules/configuration.xml
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/en-US/modules/configuration.xml 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/en-US/modules/configuration.xml 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1169,8 +1169,8 @@
exceptions are logged to the log output by default. It is possible to
explicitly declare the exception logging mechanism as seen below:</para>
- <para><programlisting>hibernate.search.error_handler log</programlisting>The
- default exception handling occurs for both synchronous and asynchronous
+ <para><programlisting>hibernate.search.error_handler log</programlisting>
+ The default exception handling occurs for both synchronous and asynchronous
indexing. Hibernate Search provides an easy mechanism to override the
default error handling implementation.</para>
@@ -1197,8 +1197,9 @@
//publish error context to some internal error handling system
...
}
-}</programlisting>To register this error handler with Hibernate Search you
- must declare the <code>CustomErrorHandler</code> fully qualified classname
+}</programlisting>
+ To register this error handler with Hibernate Search you must declare the
+ <code>CustomErrorHandler</code> fully qualified classname
in the configuration properties:</para>
<para><programlisting>hibernate.search.error_handler CustomerErrorHandler</programlisting></para>
</section>
Modified: search/trunk/hibernate-search/src/main/docbook/en-US/modules/mapping.xml
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/en-US/modules/mapping.xml 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/en-US/modules/mapping.xml 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1722,8 +1722,8 @@
....
}</programlisting>
</example></para>
- </example>The next section demonstrates how to programmatically define
- analyzers.</para>
+ </example>
+ The next section demonstrates how to programmatically define analyzers.</para>
</section>
<section>
Modified: search/trunk/hibernate-search/src/main/docbook/pot/master.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/master.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/master.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -0,0 +1,52 @@
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: master.xml:34
+#, no-c-format
+msgid "Hibernate Search"
+msgstr ""
+
+#. Tag: subtitle
+#: master.xml:36
+#, no-c-format
+msgid "Apache <trademark>Lucene</trademark> Integration"
+msgstr ""
+
+#. Tag: subtitle
+#: master.xml:38
+#, no-c-format
+msgid "Reference Guide"
+msgstr ""
+
+#. Tag: title
+#: master.xml:58
+#, no-c-format
+msgid "Preface"
+msgstr ""
+
+#. Tag: para
+#: master.xml:60
+#, no-c-format
+msgid "Full text search engines like Apache Lucene are very powerful technologies to add efficient free text search capabilities to applications. However, Lucene suffers several mismatches when dealing with object domain model. Amongst other things indexes have to be kept up to date and mismatches between index structure and domain model as well as query mismatches have to be avoided."
+msgstr ""
+
+#. Tag: para
+#: master.xml:67
+#, no-c-format
+msgid "Hibernate Search addresses these shortcomings - it indexes your domain model with the help of a few annotations, takes care of database/index synchronization and brings back regular managed objects from free text queries. To achieve this Hibernate Search is combining the power of <ulink url=\"http://www.hibernate.org\">Hibernate</ulink> and <ulink url=\"http://lucene.apache.org\">Apache Lucene</ulink>."
+msgstr ""
+
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/architecture.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/architecture.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/architecture.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
@@ -158,110 +158,122 @@
msgid "This mode targets clustered environments where throughput is critical, and index update delays are affordable. Reliability is ensured by the JMS provider and by having the slaves working on a local copy of the index."
msgstr ""
+#. Tag: title
+#: architecture.xml:178
+#, no-c-format
+msgid "JGroups"
+msgstr ""
+
+#. Tag: para
+#: architecture.xml:180
+#, no-c-format
+msgid "The JGroups based back end works similarly as the JMS one. Designed on the same master/slave pattern, instead of JMS the JGroups toolkit is used as a replication mechanism. This back end can be used as an alternative to JMS one when response time is still critical, but i.e. JNDI service is not available."
+msgstr ""
+
#. Tag: note
-#: architecture.xml:177
+#: architecture.xml:186
#, no-c-format
msgid "Hibernate Search is an extensible architecture. Feel free to drop ideas for other third party back ends to <literal>hibernate-dev(a)lists.jboss.org</literal>."
msgstr ""
#. Tag: title
-#: architecture.xml:183
+#: architecture.xml:192
#, no-c-format
msgid "Work execution"
msgstr ""
#. Tag: para
-#: architecture.xml:185
+#: architecture.xml:194
#, no-c-format
msgid "The indexing work (done by the back end) can be executed synchronously with the transaction commit (or update operation if out of transaction), or asynchronously."
msgstr ""
#. Tag: title
-#: architecture.xml:190
+#: architecture.xml:199
#, no-c-format
msgid "Synchronous"
msgstr ""
#. Tag: para
-#: architecture.xml:192
+#: architecture.xml:201
#, no-c-format
msgid "This is the safe mode where the back end work is executed in concert with the transaction commit. Under highly concurrent environment, this can lead to throughput limitations (due to the Apache Lucene lock mechanism) and it can increase the system response time if the backend is significantly slower than the transactional process and if a lot of IO operations are involved."
msgstr ""
#. Tag: title
-#: architecture.xml:201
+#: architecture.xml:210
#, no-c-format
msgid "Asynchronous"
msgstr ""
#. Tag: para
-#: architecture.xml:203
+#: architecture.xml:212
#, no-c-format
msgid "This mode delegates the work done by the back end to a different thread. That way, throughput and response time are (to a certain extend) decorrelated from the back end performance. The drawback is that a small delay appears between the transaction commit and the index update and a small overhead is introduced to deal with thread management."
msgstr ""
#. Tag: para
-#: architecture.xml:210
+#: architecture.xml:219
#, no-c-format
msgid "It is recommended to use synchronous execution first and evaluate asynchronous execution if performance problems occur and after having set up a proper benchmark (ie not a lonely cowboy hitting the system in a completely unrealistic way)."
msgstr ""
#. Tag: title
-#: architecture.xml:219
+#: architecture.xml:228
#, no-c-format
msgid "Reader strategy"
msgstr ""
#. Tag: para
-#: architecture.xml:221
+#: architecture.xml:230
#, no-c-format
msgid "When executing a query, Hibernate Search interacts with the Apache Lucene indexes through a reader strategy. Choosing a reader strategy will depend on the profile of the application (frequent updates, read mostly, asynchronous index update etc). See also"
msgstr ""
#. Tag: title
-#: architecture.xml:228
+#: architecture.xml:237
#, no-c-format
msgid "Shared"
msgstr ""
#. Tag: para
-#: architecture.xml:230
+#: architecture.xml:239
#, no-c-format
msgid "With this strategy, Hibernate Search will share the same <classname>IndexReader</classname>, for a given Lucene index, across multiple queries and threads provided that the <classname>IndexReader</classname> is still up-to-date. If the <classname>IndexReader</classname> is not up-to-date, a new one is opened and provided. Each <classname>IndexReader</classname> is made of several <classname>SegmentReader</classname>s. This strategy only reopens segments that have been modified or created after last opening and shares the already loaded segments from the previous instance. This strategy is the default."
msgstr ""
#. Tag: para
-#: architecture.xml:241
+#: architecture.xml:250
#, no-c-format
msgid "The name of this strategy is <literal>shared</literal>."
msgstr ""
#. Tag: title
-#: architecture.xml:245
+#: architecture.xml:254
#, no-c-format
msgid "Not-shared"
msgstr ""
#. Tag: para
-#: architecture.xml:247
+#: architecture.xml:256
#, no-c-format
msgid "Every time a query is executed, a Lucene <classname>IndexReader</classname> is opened. This strategy is not the most efficient since opening and warming up an <classname>IndexReader</classname> can be a relatively expensive operation."
msgstr ""
#. Tag: para
-#: architecture.xml:253
+#: architecture.xml:262
#, no-c-format
msgid "The name of this strategy is <literal>not-shared</literal>."
msgstr ""
#. Tag: title
-#: architecture.xml:257
+#: architecture.xml:266
#, no-c-format
msgid "Custom"
msgstr ""
#. Tag: para
-#: architecture.xml:259
+#: architecture.xml:268
#, no-c-format
msgid "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."
msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/batchindex.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/batchindex.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/batchindex.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -0,0 +1,357 @@
+# SOME DESCRIPTIVE TITLE.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: application/x-xml2pot; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Tag: title
+#: batchindex.xml:30
+#, no-c-format
+msgid "Manual index changes"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:32
+#, no-c-format
+msgid "As Hibernate core applies changes to the Database, Hibernate Search detects these changes and will update the index automatically (unless the EventListeners are disabled). Sometimes changes are made to the database without using Hibernate, as when backup is restored or your data is otherwise affected; for these cases Hibernate Search exposes the Manual Index APIs to explicitly update or remove a single entity from the index, or rebuild the index for the whole database, or remove all references to a specific type."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:40
+#, no-c-format
+msgid "All these methods affect the Lucene Index only, no changes are applied to the Database."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:44
+#, no-c-format
+msgid "Adding instances to the Index"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:46
+#, no-c-format
+msgid "Using <classname>FullTextSession</classname>.<methodname>index(T entity)</methodname> you can directly add or update a specific object instance to the index. If this entity was already indexed, then the index will be updated. Changes to the index are only applied at transaction commit."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:52
+#, no-c-format
+msgid "Indexing an entity via <methodname>FullTextSession.index(T entity)</methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:55
+#, no-c-format
+msgid ""
+ "FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
+ "Transaction tx = fullTextSession.beginTransaction();\n"
+ "Object customer = fullTextSession.load( Customer.class, 8 );\n"
+ "<emphasis role=\"bold\">fullTextSession.index(customer);</emphasis>\n"
+ "tx.commit(); //index only updated at commit time"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:58
+#, no-c-format
+msgid "In case you want to add all instances for a type, or for all indexed types, the recommended approach is to use a <classname>MassIndexer</classname>: see <xref linkend=\"search-batchindex-massindexer\"/> for more details."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:65
+#, no-c-format
+msgid "Deleting instances from the Index: Purging"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:67
+#, no-c-format
+msgid "It is equally possible to remove an entity or all entities of a given type from a Lucene index without the need to physically remove them from the database. This operation is named purging and is also done through the <classname>FullTextSession</classname>."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:73
+#, no-c-format
+msgid "Purging a specific instance of an entity from the index"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:75
+#, no-c-format
+msgid ""
+ "FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
+ "Transaction tx = fullTextSession.beginTransaction();\n"
+ "for (Customer customer : customers) {\n"
+ " <emphasis role=\"bold\">fullTextSession.purge( Customer.class, customer.getId() );</emphasis>\n"
+ "}\n"
+ "tx.commit(); //index is updated at commit time"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:78
+#, no-c-format
+msgid "Purging will remove the entity with the given id from the Lucene index but will not touch the database."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:81
+#, no-c-format
+msgid "If you need to remove all entities of a given type, you can use the <methodname>purgeAll</methodname> method. This operation removes all entities of the type passed as a parameter as well as all its subtypes."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:87
+#, no-c-format
+msgid "Purging all instances of an entity from the index"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:89
+#, no-c-format
+msgid ""
+ "FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
+ "Transaction tx = fullTextSession.beginTransaction();\n"
+ "<emphasis role=\"bold\">fullTextSession.purgeAll( Customer.class );</emphasis>\n"
+ "//optionally optimize the index\n"
+ "//fullTextSession.getSearchFactory().optimize( Customer.class );\n"
+ "tx.commit(); //index changes are applied at commit time"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:92
+#, no-c-format
+msgid "It is recommended to optimize the index after such an operation."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:96
+#, no-c-format
+msgid "Methods <methodname>index</methodname>, <methodname>purge</methodname> and <methodname>purgeAll</methodname> are available on <classname>FullTextEntityManager</classname> as well."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:102
+#, no-c-format
+msgid "All manual indexing methods (<methodname>index</methodname>, <methodname>purge</methodname> and <methodname>purgeAll</methodname>) only affect the index, not the database, nevertheless they are transactional and as such they won't be applied until the transaction is successfully committed, or you make use of <methodname>flushToIndexes</methodname>."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:112
+#, no-c-format
+msgid "Rebuilding the whole Index"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:114
+#, no-c-format
+msgid "If you change the entity mapping to the index, chances are that the whole Index needs to be updated; For example if you decide to index a an existing field using a different analyzer you'll need to rebuild the index for affected types. Also if the Database is replaced (like restored from a backup, imported from a legacy system) you'll want to be able to rebuild the index from existing data. Hibernate Search provides two main strategies to choose from:"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:124
+#, no-c-format
+msgid "Using <classname>FullTextSession</classname>.<methodname>flushToIndexes()</methodname> periodically, while using <classname>FullTextSession</classname>.<methodname>index()</methodname> on all entities."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:129
+#, no-c-format
+msgid "Use a <classname>MassIndexer</classname>."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:134
+#, no-c-format
+msgid "Using flushToIndexes()"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:136
+#, no-c-format
+msgid "This strategy consists in removing the existing index and then adding all entities back to the index using <classname>FullTextSession</classname>.<methodname>purgeAll()</methodname> and <classname>FullTextSession</classname>.<methodname>index()</methodname>, however there are some memory and efficiency contraints. For maximum efficiency Hibernate Search batches index operations and executes them at commit time. If you expect to index a lot of data you need to be careful about memory consumption since all documents are kept in a queue until the transaction commit. You can potentially face an <classname>OutOfMemoryException</classname> if you don't empty the queue periodically: to do this you can use <methodname>fullTextSession.flushToIndexes()</methodname>. Every time <methodname>fullTextSession.flushToIndexes()</methodname> is called (or if the transaction is committed), the batch queue is processed applying all index changes. Be aware that, once flushed, the changes!
cannot be rolled back."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:154
+#, no-c-format
+msgid "Index rebuilding using index() and flushToIndexes()"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:156
+#, no-c-format
+msgid ""
+ "fullTextSession.setFlushMode(FlushMode.MANUAL);\n"
+ "fullTextSession.setCacheMode(CacheMode.IGNORE);\n"
+ "transaction = fullTextSession.beginTransaction();\n"
+ "//Scrollable results will avoid loading too many objects in memory\n"
+ "ScrollableResults results = fullTextSession.createCriteria( Email.class )\n"
+ " .setFetchSize(BATCH_SIZE)\n"
+ " .scroll( ScrollMode.FORWARD_ONLY );\n"
+ "int index = 0;\n"
+ "while( results.next() ) {\n"
+ " index++;\n"
+ " fullTextSession.index( results.get(0) ); //index each element\n"
+ " if (index % BATCH_SIZE == 0) {\n"
+ " fullTextSession.flushToIndexes(); //apply changes to indexes\n"
+ " fullTextSession.clear(); //free memory since the queue is processed\n"
+ " }\n"
+ "}\n"
+ "transaction.commit();"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:160
+#, no-c-format
+msgid "<literal>hibernate.search.worker.batch_size</literal> has been deprecated in favor of this explicit API which provides better control"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:164
+#, no-c-format
+msgid "Try to use a batch size that guarantees that your application will not run out of memory: with a bigger batch size objects are fetched faster from database but more memory is needed."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:171
+#, no-c-format
+msgid "Using a MassIndexer"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:172
+#, no-c-format
+msgid "Hibernate Search's <classname>MassIndexer</classname> uses several parallel threads to rebuild the index; you can optionally select which entities need to be reloaded or have it reindex all entities. This approach is optimized for best performance but requires to set the application in maintenance mode: making queries to the index is not recommended when a MassIndexer is busy."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:179
+#, no-c-format
+msgid "Index rebuilding using a MassIndexer"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:180
+#, no-c-format
+msgid "fullTextSession.createIndexer().startAndWait();"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:181
+#, no-c-format
+msgid "This will rebuild the index, deleting it and then reloading all entities from the database. Although it's simple to use, some tweaking is recommended to speed up the process: there are several parameters configurable."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:186
+#, no-c-format
+msgid "During the progress of a MassIndexer the content of the index is undefined, make sure that nobody will try to make some query during index rebuilding! If somebody should query the index it will not corrupt but most results will likely be missing."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:192
+#, no-c-format
+msgid "Using a tuned MassIndexer"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:193
+#, no-c-format
+msgid ""
+ "fullTextSession\n"
+ " .createIndexer( User.class )\n"
+ " .batchSizeToLoadObjects( 25 )\n"
+ " .cacheMode( CacheMode.NORMAL )\n"
+ " .threadsToLoadObjects( 5 )\n"
+ " .threadsForSubsequentFetching( 20 )\n"
+ " .startAndWait();"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:194
+#, no-c-format
+msgid "This will rebuild the index of all User instances (and subtypes), and will create 5 parallel threads to load the User instances using batches of 25 objects per query; these loaded User instances are then pipelined to 20 parallel threads to load the attached lazy collections of User containing some information needed for the index."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:199
+#, no-c-format
+msgid "It is recommended to leave cacheMode to <literal>CacheMode.IGNORE</literal> (the default), as in most reindexing situations the cache will be a useless additional overhead; it might be useful to enable some other <literal>CacheMode</literal> depending on your data: it might increase performance if the main entity is relating to enum-like data included in the index."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:205
+#, no-c-format
+msgid "The \"sweet spot\" of number of threads to achieve best performance is highly dependent on your overall architecture, database design and even data values. To find out the best number of threads for your application it is recommended to use a profiler: all internal thread groups have meaningful names to be easily identified with most tools."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:214
+#, no-c-format
+msgid "The MassIndexer was designed for speed and is unaware of transactions, so there is no need to begin one or committing. Also because it is not transactional it is not recommended to let users use the system during it's processing, as it is unlikely people will be able to find results and the system load might be too high anyway."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:223
+#, no-c-format
+msgid "Other parameters which also affect indexing time and memory consumption are:"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:228
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].exclusive_index_use"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:232
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].indexwriter.batch.max_buffered_docs"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:236
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].indexwriter.batch.max_field_length"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:240
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].indexwriter.batch.max_merge_docs"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:244
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].indexwriter.batch.merge_factor"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:248
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].indexwriter.batch.ram_buffer_size"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:252
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].indexwriter.batch.term_index_interval"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:256
+#, no-c-format
+msgid "All <literal>.indexwriter</literal> parameters are Lucene specific and Hibernate Search is just passing these parameters through - see <xref linkend=\"lucene-indexing-performance\"/> for more details."
+msgstr ""
+
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/configuration.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/configuration.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/configuration.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
@@ -39,13 +39,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:52 configuration.xml:811
+#: configuration.xml:52 configuration.xml:932
#, no-c-format
msgid "Class"
msgstr ""
#. Tag: entry
-#: configuration.xml:54 configuration.xml:349 configuration.xml:635 configuration.xml:813
+#: configuration.xml:54 configuration.xml:372 configuration.xml:735 configuration.xml:934
#, no-c-format
msgid "Description"
msgstr ""
@@ -69,7 +69,7 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:68 configuration.xml:868
+#: configuration.xml:68 configuration.xml:989
#, no-c-format
msgid "none"
msgstr ""
@@ -271,65 +271,95 @@
#. Tag: para
#: configuration.xml:203
#, no-c-format
-msgid "In some extreme cases involving huge indexes (in size), it is necessary to split (shard) the indexing data of a given entity type into several Lucene indexes. This solution is not recommended until you reach significant index sizes and index update times are slowing the application down. The main drawback of index sharding is that searches will end up being slower since more files have to be opened for a single search. In other words don't do it until you have problems :)"
+msgid "In some cases, it is necessary to split (shard) the indexing data of a given entity type into several Lucene indexes. This solution is not recommended unless there is a pressing need because by default, searches will be slower as all shards have to be opened for a single search. In other words don't do it until you have problems :)"
msgstr ""
#. Tag: para
-#: configuration.xml:211
+#: configuration.xml:209
#, no-c-format
-msgid "Despite this strong warning, Hibernate Search allows you to index a given entity type into several sub indexes. Data is sharded into the different sub indexes thanks to an <classname>IndexShardingStrategy</classname>. By default, no sharding strategy is enabled, unless the number of shards is configured. To configure the number of shards use the following property"
+msgid "For example, sharding may be desirable if:"
msgstr ""
+#. Tag: para
+#: configuration.xml:213
+#, no-c-format
+msgid "A single index is so huge that index update times are slowing the application down."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:218
+#, no-c-format
+msgid "A typical search will only hit a sub-set of the index, such as when data is naturally segmented by customer, region or application."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:224
+#, no-c-format
+msgid "Hibernate Search allows you to index a given entity type into several sub indexes. Data is sharded into the different sub indexes thanks to an <classname>IndexShardingStrategy</classname>. By default, no sharding strategy is enabled, unless the number of shards is configured. To configure the number of shards use the following property"
+msgstr ""
+
#. Tag: title
-#: configuration.xml:219
+#: configuration.xml:231
#, no-c-format
msgid "Enabling index sharding by specifying nbr_of_shards for a specific index"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:222
+#: configuration.xml:234
#, no-c-format
msgid "hibernate.search.<indexName>.sharding_strategy.nbr_of_shards 5"
msgstr ""
#. Tag: para
-#: configuration.xml:225
+#: configuration.xml:237
#, no-c-format
msgid "This will use 5 different shards."
msgstr ""
#. Tag: para
-#: configuration.xml:227
+#: configuration.xml:239
#, no-c-format
msgid "The default sharding strategy, when shards are set up, splits the data according to the hash value of the id string representation (generated by the Field Bridge). This ensures a fairly balanced sharding. You can replace the strategy by implementing <literal>IndexShardingStrategy</literal> and by setting the following property"
msgstr ""
#. Tag: title
-#: configuration.xml:235
+#: configuration.xml:247
#, no-c-format
msgid "Specifying a custom sharding strategy"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:237
+#: configuration.xml:249
#, no-c-format
msgid "hibernate.search.<indexName>.sharding_strategy my.shardingstrategy.Implementation"
msgstr ""
#. Tag: para
-#: configuration.xml:240
+#: configuration.xml:252
#, no-c-format
-msgid "Each shard has an independent directory provider configuration as described in <xref linkend=\"search-configuration-directory\"/>. The DirectoryProvider default name for the previous example are <literal><indexName>.0</literal> to <literal><indexName>.4</literal>. In other words, each shard has the name of it's owning index followed by <constant>.</constant> (dot) and its index number."
+msgid "Using a custom <classname>IndexShardingStrategy</classname> implementation, it's possible to define what shard a given entity is indexed to."
msgstr ""
+#. Tag: para
+#: configuration.xml:256
+#, no-c-format
+msgid "It also allows for optimizing searches by selecting which shard to run the query onto. By activating a filter (see <xref linkend=\"query-filter-shard\"/>), a sharding strategy can select a subset of the shards used to answer a query (<classname>IndexShardingStrategy.getDirectoryProvidersForQuery</classname>) and thus speed up the query execution."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:263
+#, no-c-format
+msgid "Each shard has an independent directory provider configuration as described in <xref linkend=\"search-configuration-directory\"/>. The <classname>DirectoryProvider</classname> default name for the previous example are <literal><indexName>.0</literal> to <literal><indexName>.4</literal>. In other words, each shard has the name of it's owning index followed by <constant>.</constant> (dot) and its index number."
+msgstr ""
+
#. Tag: title
-#: configuration.xml:249
+#: configuration.xml:272
#, no-c-format
msgid "Configuring the sharding configuration for an example entity <classname>Animal</classname>"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:252
+#: configuration.xml:275
#, no-c-format
msgid ""
"hibernate.search.default.indexBase /usr/lucene/indexes\n"
@@ -342,67 +372,67 @@
msgstr ""
#. Tag: para
-#: configuration.xml:255
+#: configuration.xml:278
#, no-c-format
msgid "This configuration uses the default id string hashing strategy and shards the Animal index into 5 subindexes. All subindexes are <classname>FSDirectoryProvider</classname> instances and the directory where each subindex is stored is as followed:"
msgstr ""
#. Tag: para
-#: configuration.xml:262
+#: configuration.xml:285
#, no-c-format
msgid "for subindex 0: /usr/lucene/indexes/Animal00 (shared indexBase but overridden indexName)"
msgstr ""
#. Tag: para
-#: configuration.xml:267
+#: configuration.xml:290
#, no-c-format
msgid "for subindex 1: /usr/lucene/indexes/Animal.1 (shared indexBase, default indexName)"
msgstr ""
#. Tag: para
-#: configuration.xml:272
+#: configuration.xml:295
#, no-c-format
msgid "for subindex 2: /usr/lucene/indexes/Animal.2 (shared indexBase, default indexName)"
msgstr ""
#. Tag: para
-#: configuration.xml:277
+#: configuration.xml:300
#, no-c-format
msgid "for subindex 3: /usr/lucene/shared/Animal03 (overridden indexBase, overridden indexName)"
msgstr ""
#. Tag: para
-#: configuration.xml:282
+#: configuration.xml:305
#, no-c-format
msgid "for subindex 4: /usr/lucene/indexes/Animal.4 (shared indexBase, default indexName)"
msgstr ""
#. Tag: title
-#: configuration.xml:289
+#: configuration.xml:312
#, no-c-format
msgid "Sharing indexes (two entities into the same directory)"
msgstr ""
#. Tag: para
-#: configuration.xml:292
+#: configuration.xml:315
#, no-c-format
msgid "This is only presented here so that you know the option is available. There is really not much benefit in sharing indexes."
msgstr ""
#. Tag: para
-#: configuration.xml:296
+#: configuration.xml:319
#, no-c-format
msgid "It is technically possible to store the information of more than one entity into a single Lucene index. There are two ways to accomplish this:"
msgstr ""
#. Tag: para
-#: configuration.xml:302
+#: configuration.xml:325
#, no-c-format
msgid "Configuring the underlying directory providers to point to the same physical index directory. In practice, you set the property <literal>hibernate.search.[fully qualified entity name].indexName</literal> to the same value. As an example let’s use the same index (directory) for the <classname>Furniture</classname> and <classname>Animal</classname> entity. We just set <literal>indexName</literal> for both entities to for example “Animal”. Both entities will then be stored in the Animal directory"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:312
+#: configuration.xml:335
#, no-c-format
msgid ""
"<code>hibernate.search.org.hibernate.search.test.shards.Furniture.indexName = Animal\n"
@@ -410,163 +440,211 @@
msgstr ""
#. Tag: para
-#: configuration.xml:316
+#: configuration.xml:339
#, no-c-format
msgid "Setting the <code>@Indexed</code> annotation’s <methodname>index</methodname> attribute of the entities you want to merge to the same value. If we again wanted all <classname>Furniture</classname> instances to be indexed in the <classname>Animal</classname> index along with all instances of <classname>Animal</classname> we would specify <code>@Indexed(index=”Animal”)</code> on both <classname>Animal</classname> and <classname>Furniture</classname> classes."
msgstr ""
#. Tag: title
-#: configuration.xml:330
+#: configuration.xml:353
#, no-c-format
msgid "Worker configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:332
+#: configuration.xml:355
#, no-c-format
msgid "It is possible to refine how Hibernate Search interacts with Lucene through the worker configuration. The work can be executed to the Lucene directory or sent to a JMS queue for later processing. When processed to the Lucene directory, the work can be processed synchronously or asynchronously to the transaction commit."
msgstr ""
#. Tag: para
-#: configuration.xml:338
+#: configuration.xml:361
#, no-c-format
msgid "You can define the worker configuration using the following properties"
msgstr ""
#. Tag: title
-#: configuration.xml:342
+#: configuration.xml:365
#, no-c-format
msgid "worker configuration"
msgstr ""
#. Tag: entry
-#: configuration.xml:347 configuration.xml:633
+#: configuration.xml:370 configuration.xml:733
#, no-c-format
msgid "Property"
msgstr ""
#. Tag: literal
-#: configuration.xml:353
+#: configuration.xml:376
#, no-c-format
msgid "hibernate.search.worker.backend"
msgstr ""
#. Tag: entry
-#: configuration.xml:355
+#: configuration.xml:378
#, no-c-format
-msgid "Out of the box support for the Apache Lucene back end and the JMS back end. Default to <literal>lucene</literal>. Supports also <literal>jms</literal> and <literal>blackhole</literal>."
+msgid "Out of the box support for the Apache Lucene back end and the JMS back end. Default to <literal>lucene</literal>. Supports also <literal>jms</literal>, <literal>blackhole</literal>, <literal>jgroupsMaster</literal> and <literal>jgroupsSlave</literal>."
msgstr ""
#. Tag: literal
-#: configuration.xml:361
+#: configuration.xml:385
#, no-c-format
msgid "hibernate.search.worker.execution"
msgstr ""
#. Tag: entry
-#: configuration.xml:363
+#: configuration.xml:387
#, no-c-format
msgid "Supports synchronous and asynchronous execution. Default to <literal><literal>sync</literal></literal>. Supports also <literal>async</literal>."
msgstr ""
#. Tag: literal
-#: configuration.xml:369
+#: configuration.xml:393
#, no-c-format
msgid "hibernate.search.worker.thread_pool.size"
msgstr ""
#. Tag: entry
-#: configuration.xml:371
+#: configuration.xml:395
#, no-c-format
msgid "Defines the number of threads in the pool. useful only for asynchronous execution. Default to 1."
msgstr ""
#. Tag: literal
-#: configuration.xml:376
+#: configuration.xml:400
#, no-c-format
msgid "hibernate.search.worker.buffer_queue.max"
msgstr ""
#. Tag: entry
-#: configuration.xml:378
+#: configuration.xml:402
#, no-c-format
msgid "Defines the maximal number of work queue if the thread poll is starved. Useful only for asynchronous execution. Default to infinite. If the limit is reached, the work is done by the main thread."
msgstr ""
#. Tag: literal
-#: configuration.xml:385
+#: configuration.xml:409
#, no-c-format
msgid "hibernate.search.worker.jndi.*"
msgstr ""
#. Tag: entry
-#: configuration.xml:387
+#: configuration.xml:411
#, no-c-format
msgid "Defines the JNDI properties to initiate the InitialContext (if needed). JNDI is only used by the JMS back end."
msgstr ""
#. Tag: literal
-#: configuration.xml:392
+#: configuration.xml:416
#, no-c-format
msgid "hibernate.search.worker.jms.connection_factory"
msgstr ""
#. Tag: entry
-#: configuration.xml:395
+#: configuration.xml:419
#, no-c-format
msgid "Mandatory for the JMS back end. Defines the JNDI name to lookup the JMS connection factory from (<literal>/ConnectionFactory</literal> by default in JBoss AS)"
msgstr ""
#. Tag: literal
-#: configuration.xml:402
+#: configuration.xml:426
#, no-c-format
msgid "hibernate.search.worker.jms.queue"
msgstr ""
#. Tag: entry
-#: configuration.xml:404
+#: configuration.xml:428
#, no-c-format
msgid "Mandatory for the JMS back end. Defines the JNDI name to lookup the JMS queue from. The queue will be used to post work messages."
msgstr ""
+#. Tag: literal
+#: configuration.xml:434
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.clusterName"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:436
+#, no-c-format
+msgid "Optional for JGroups back end. Defines the name of JGroups channel."
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:440
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.configurationFile"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:442
+#, no-c-format
+msgid "Optional JGroups network stack configuration. Defines the name of a JGroups configuration file, which must exist on classpath."
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:447
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.configurationXml"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:449
+#, no-c-format
+msgid "Optional JGroups network stack configuration. Defines a String representing JGroups configuration as XML."
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:454
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.configurationString"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:456
+#, no-c-format
+msgid "Optional JGroups network stack configuration. Provides JGroups configuration in plain text."
+msgstr ""
+
#. Tag: title
-#: configuration.xml:414
+#: configuration.xml:466
#, no-c-format
msgid "JMS Master/Slave configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:416
+#: configuration.xml:468
#, no-c-format
msgid "This section describes in greater detail how to configure the Master / Slaves Hibernate Search architecture."
msgstr ""
#. Tag: para
-#: configuration.xml:429
+#: configuration.xml:481
#, no-c-format
msgid "JMS back end configuration."
msgstr ""
#. Tag: title
-#: configuration.xml:433
+#: configuration.xml:485 configuration.xml:548
#, no-c-format
msgid "Slave nodes"
msgstr ""
#. Tag: para
-#: configuration.xml:435
+#: configuration.xml:487
#, no-c-format
msgid "Every index update operation is sent to a JMS queue. Index querying operations are executed on a local index copy."
msgstr ""
#. Tag: title
-#: configuration.xml:439
+#: configuration.xml:491
#, no-c-format
msgid "JMS Slave configuration"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:441
+#: configuration.xml:493
#, no-c-format
msgid ""
"### slave configuration\n"
@@ -597,37 +675,37 @@
msgstr ""
#. Tag: para
-#: configuration.xml:444
+#: configuration.xml:496
#, no-c-format
msgid "A file system local copy is recommended for faster search results."
msgstr ""
#. Tag: para
-#: configuration.xml:447 configuration.xml:463
+#: configuration.xml:499 configuration.xml:515
#, no-c-format
msgid "The refresh period should be higher that the expected time copy."
msgstr ""
#. Tag: title
-#: configuration.xml:452
+#: configuration.xml:504 configuration.xml:558
#, no-c-format
msgid "Master node"
msgstr ""
#. Tag: para
-#: configuration.xml:454
+#: configuration.xml:506
#, no-c-format
msgid "Every index update operation is taken from a JMS queue and executed. The master index is copied on a regular basis."
msgstr ""
#. Tag: title
-#: configuration.xml:458
+#: configuration.xml:510
#, no-c-format
msgid "JMS Master configuration"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:460
+#: configuration.xml:512
#, no-c-format
msgid ""
"### master configuration\n"
@@ -650,19 +728,19 @@
msgstr ""
#. Tag: para
-#: configuration.xml:466
+#: configuration.xml:518
#, no-c-format
msgid "In addition to the Hibernate Search framework configuration, a Message Driven Bean should be written and set up to process the index works queue through JMS."
msgstr ""
#. Tag: title
-#: configuration.xml:471
+#: configuration.xml:523
#, no-c-format
msgid "Message Driven Bean processing the indexing queue"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:473
+#: configuration.xml:525
#, no-c-format
msgid ""
"@MessageDriven(activationConfig = {\n"
@@ -685,103 +763,239 @@
msgstr ""
#. Tag: para
-#: configuration.xml:476
+#: configuration.xml:528
#, no-c-format
msgid "This example inherits from the abstract JMS controller class available in the Hibernate Search source code and implements a JavaEE 5 MDB. This implementation is given as an example and, while most likely be more complex, can be adjusted to make use of non Java EE Message Driven Beans. For more information about the <methodname>getSession()</methodname> and <methodname>cleanSessionIfNeeded()</methodname>, please check <classname>AbstractJMSHibernateSearchController</classname>'s javadoc."
msgstr ""
#. Tag: title
-#: configuration.xml:489
+#: configuration.xml:541
#, no-c-format
+msgid "JGroups Master/Slave configuration"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:542
+#, no-c-format
+msgid "Describes how to configure JGroups Master/Slave back end. Configuration examples illustrated in JMS Master/Slave configuration section (<xref linkend=\"jms-backend\"/>) also apply here, only a different backend needs to be set."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:549
+#, no-c-format
+msgid "Every index update operation is sent through a JGroups channel to the master node. Index querying operations are executed on a local index copy."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:552
+#, no-c-format
+msgid "JGroups Slave configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:553
+#, no-c-format
+msgid ""
+ "### slave configuration\n"
+ "## Backend configuration\n"
+ "hibernate.search.worker.backend = jgroupsSlave"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:559
+#, no-c-format
+msgid "Every index update operation is taken from a JGroups channel and executed. The master index is copied on a regular basis."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:562
+#, no-c-format
+msgid "JGroups Master configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:563
+#, no-c-format
+msgid ""
+ "### master configuration\n"
+ "## Backend configuration\n"
+ "hibernate.search.worker.backend = jgroupsMaster"
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:567
+#, no-c-format
+msgid "JGroups channel configuration"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:568
+#, no-c-format
+msgid "Optionally configuration for JGroups transport protocols (UDP, TCP) and channel name can be defined. It can be applied to both master and slave nodes. There are several ways to configure JGroups transport details. If it is not defined explicity, configuration found in the <literal> flush-udp.xml</literal> file is used."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:573
+#, no-c-format
+msgid "JGroups transport protocols configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:574
+#, no-c-format
+msgid ""
+ "## configuration\n"
+ "#udp.xml file needs to be located in the classpath\n"
+ "hibernate.search.worker.backend.jgroups.configurationFile = udp.xml\n"
+ "\n"
+ "#protocol stack configuration provided in XML format\n"
+ "hibernate.search.worker.backend.jgroups.configurationXml =\n"
+ "\n"
+ "<config xmlns=\"urn:org:jgroups\"\n"
+ "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+ "xsi:schemaLocation=\"urn:org:jgroups file:schema/JGroups-2.8.xsd\">\n"
+ "<UDP\n"
+ "mcast_addr=\"${jgroups.udp.mcast_addr:228.10.10.10}\"\n"
+ "mcast_port=\"${jgroups.udp.mcast_port:45588}\"\n"
+ "tos=\"8\"\n"
+ "thread_naming_pattern=\"pl\"\n"
+ "thread_pool.enabled=\"true\"\n"
+ "thread_pool.min_threads=\"2\"\n"
+ "thread_pool.max_threads=\"8\"\n"
+ "thread_pool.keep_alive_time=\"5000\"\n"
+ "thread_pool.queue_enabled=\"false\"\n"
+ "thread_pool.queue_max_size=\"100\"\n"
+ "thread_pool.rejection_policy=\"Run\"/>\n"
+ "<PING timeout=\"1000\" num_initial_members=\"3\"/>\n"
+ "<MERGE2 max_interval=\"30000\" min_interval=\"10000\"/>\n"
+ "<FD_SOCK/>\n"
+ "<FD timeout=\"3000\" max_tries=\"3\"/>\n"
+ "<VERIFY_SUSPECT timeout=\"1500\"/>\n"
+ "<pbcast.STREAMING_STATE_TRANSFER/>\n"
+ "<pbcast.FLUSH timeout=\"0\"/>\n"
+ "</config>\n"
+ "\n"
+ "#protocol stack configuration provided in \"old style\" jgroups format\n"
+ "hibernate.search.worker.backend.jgroups.configurationString =\n"
+ "\n"
+ "UDP(mcast_addr=228.1.2.3;mcast_port=45566;ip_ttl=32):PING(timeout=3000;\n"
+ "num_initial_members=6):FD(timeout=5000):VERIFY_SUSPECT(timeout=1500):\n"
+ "pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):UNICAST(timeout=5000):\n"
+ "FRAG:pbcast.GMS(join_timeout=3000;shun=false;print_local_addr=true)"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:576
+#, no-c-format
+msgid "Master and slave nodes communicate over JGroups channel that is identified by this same name. Name of the channel can be defined explicity, if not default <literal>HSearchCluster</literal> is used."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:579
+#, no-c-format
+msgid "JGroups channel name configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:580
+#, no-c-format
+msgid ""
+ "## Backend configuration\n"
+ "hibernate.search.worker.backend.jgroups.clusterName = Hibernate-Search-Cluster"
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:586
+#, no-c-format
msgid "Reader strategy configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:491
+#: configuration.xml:588
#, no-c-format
msgid "The different reader strategies are described in <xref linkend=\"search-architecture-readerstrategy\"/>. Out of the box strategies are:"
msgstr ""
#. Tag: para
-#: configuration.xml:497
+#: configuration.xml:594
#, no-c-format
msgid "<literal>shared</literal>: share index readers across several queries. This strategy is the most efficient."
msgstr ""
#. Tag: para
-#: configuration.xml:502
+#: configuration.xml:599
#, no-c-format
msgid "<literal>not-shared</literal>: create an index reader for each individual query"
msgstr ""
#. Tag: para
-#: configuration.xml:507
+#: configuration.xml:604
#, no-c-format
msgid "The default reader strategy is <literal>shared</literal>. This can be adjusted:"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:510
+#: configuration.xml:607
#, no-c-format
msgid "hibernate.search.reader.strategy = not-shared"
msgstr ""
#. Tag: para
-#: configuration.xml:512
+#: configuration.xml:609
#, no-c-format
msgid "Adding this property switches to the <literal>not-shared</literal> strategy."
msgstr ""
#. Tag: para
-#: configuration.xml:515
+#: configuration.xml:612
#, no-c-format
msgid "Or if you have a custom reader strategy:"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:517
+#: configuration.xml:614
#, no-c-format
msgid "hibernate.search.reader.strategy = my.corp.myapp.CustomReaderProvider"
msgstr ""
#. Tag: para
-#: configuration.xml:519
+#: configuration.xml:616
#, no-c-format
msgid "where <classname>my.corp.myapp.CustomReaderProvider</classname> is the custom strategy implementation."
msgstr ""
#. Tag: title
-#: configuration.xml:524
+#: configuration.xml:621
#, no-c-format
msgid "Enabling Hibernate Search and automatic indexing"
msgstr ""
#. Tag: title
-#: configuration.xml:527
+#: configuration.xml:624
#, no-c-format
msgid "Enabling Hibernate Search"
msgstr ""
#. Tag: para
-#: configuration.xml:529
+#: configuration.xml:626
#, no-c-format
-msgid "Hibernate Search is enabled out of the box when using Hibernate Annotations or Hibernate EntityManager. If, for some reason you need to disable it, set <literal>hibernate.search.autoregister_listeners</literal> to false. Note that there is no performance penalty when the listeners are enabled even though no entities are indexed."
+msgid "Hibernate Search is enabled out of the box when using Hibernate Annotations or Hibernate EntityManager. If, for some reason you need to disable it, set <literal>hibernate.search.autoregister_listeners</literal> to false. Note that there is no performance penalty when the listeners are enabled but no entities are annotated as indexed."
msgstr ""
#. Tag: para
-#: configuration.xml:536
+#: configuration.xml:633
#, no-c-format
msgid "To enable Hibernate Search in Hibernate Core (ie. if you don't use Hibernate Annotations), add the <literal>FullTextIndexEventListener</literal> for the following six Hibernate events and also add it after the default <literal>DefaultFlushEventListener</literal>, as in the following example."
msgstr ""
#. Tag: title
-#: configuration.xml:543
+#: configuration.xml:641
#, no-c-format
msgid "Explicitly enabling Hibernate Search by configuring the <classname>FullTextIndexEventListener</classname>"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:546
+#: configuration.xml:644
#, no-c-format
msgid ""
"<hibernate-configuration>\n"
@@ -814,448 +1028,478 @@
msgstr ""
#. Tag: title
-#: configuration.xml:551
+#: configuration.xml:649
#, no-c-format
msgid "Automatic indexing"
msgstr ""
#. Tag: para
-#: configuration.xml:553
+#: configuration.xml:651
#, no-c-format
msgid "By default, every time an object is inserted, updated or deleted through Hibernate, Hibernate Search updates the according Lucene index. It is sometimes desirable to disable that features if either your index is read-only or if index updates are done in a batch way (see <xref linkend=\"search-batchindex\"/>)."
msgstr ""
#. Tag: para
-#: configuration.xml:559
+#: configuration.xml:657
#, no-c-format
msgid "To disable event based indexing, set"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:561
+#: configuration.xml:659
#, no-c-format
msgid "hibernate.search.indexing_strategy manual"
msgstr ""
#. Tag: para
-#: configuration.xml:564
+#: configuration.xml:662
#, no-c-format
msgid "In most case, the JMS backend provides the best of both world, a lightweight event based system keeps track of all changes in the system, and the heavyweight indexing process is done by a separate process or machine."
msgstr ""
#. Tag: title
-#: configuration.xml:573
+#: configuration.xml:671
#, no-c-format
msgid "Tuning Lucene indexing performance"
msgstr ""
#. Tag: para
-#: configuration.xml:575
+#: configuration.xml:673
#, no-c-format
msgid "Hibernate Search allows you to tune the Lucene indexing performance by specifying a set of parameters which are passed through to underlying Lucene <literal>IndexWriter</literal> such as <literal>mergeFactor</literal>, <literal>maxMergeDocs</literal> and <literal>maxBufferedDocs</literal>. You can specify these parameters either as default values applying for all indexes, on a per index basis, or even per shard."
msgstr ""
#. Tag: para
-#: configuration.xml:583
+#: configuration.xml:681
#, no-c-format
-msgid "There are two sets of parameters allowing for different performance settings depending on the use case. During indexing operations triggered by database modifications, the parameters are grouped by the <literal>transaction</literal> keyword: <programlisting>hibernate.search.[default|<indexname>].indexwriter.transaction.<parameter_name></programlisting> When indexing occurs via <literal>FullTextSession.index()</literal> (see <xref linkend=\"search-batchindex\"/>), the used properties are those grouped under the <literal>batch</literal> keyword:"
+msgid "There are two sets of parameters allowing for different performance settings depending on the use case. During indexing operations triggered by database modifications, the parameters are grouped by the <literal>transaction</literal> keyword: <programlisting>hibernate.search.[default|<indexname>].indexwriter.transaction.<parameter_name></programlisting> When indexing occurs via <literal>FullTextSession.index()</literal> or via a <classname>MassIndexer</classname> (see <xref linkend=\"search-batchindex\"/>), the used properties are those grouped under the <literal>batch</literal> keyword:"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:589
+#: configuration.xml:688
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.batch.<parameter_name>"
msgstr ""
#. Tag: para
-#: configuration.xml:591
+#: configuration.xml:690
#, no-c-format
msgid ""
- "Unless the corresponding <literal>.batch</literal> property is explicitly set, the value will default to the <literal>.transaction</literal> property. If no value is set for a <literal>.batch</literal> value in a specific shard configuration, Hibernate Search will look at the index section, then at the default section and after that it will look for a <literal>.transaction</literal> in the same order: <programlisting>hibernate.search.Animals.2.indexwriter.transaction.max_merge_docs 10\n"
+ "If no value is set for a <literal>.batch</literal> value in a specific shard configuration, Hibernate Search will look at the index section, then at the default section: <programlisting>hibernate.search.Animals.2.indexwriter.transaction.max_merge_docs 10\n"
"hibernate.search.Animals.2.indexwriter.transaction.merge_factor 20\n"
"hibernate.search.default.indexwriter.batch.max_merge_docs 100</programlisting> This configuration will result in these settings applied to the second shard of Animals index:"
msgstr ""
#. Tag: para
-#: configuration.xml:603
+#: configuration.xml:699
#, no-c-format
msgid "<literal>transaction.max_merge_docs</literal> = 10"
msgstr ""
#. Tag: para
-#: configuration.xml:607
+#: configuration.xml:703
#, no-c-format
msgid "<literal>batch.max_merge_docs</literal> = 100"
msgstr ""
#. Tag: para
-#: configuration.xml:611
+#: configuration.xml:707
#, no-c-format
msgid "<literal>transaction.merge_factor</literal> = 20"
msgstr ""
#. Tag: para
-#: configuration.xml:615
+#: configuration.xml:711
#, no-c-format
-msgid "<literal>batch.merge_factor</literal> = 20"
+msgid "<literal>batch.merge_factor</literal> = Lucene default"
msgstr ""
#. Tag: para
-#: configuration.xml:619
+#: configuration.xml:715
#, no-c-format
msgid "All other values will use the defaults defined in Lucene."
msgstr ""
#. Tag: para
-#: configuration.xml:621
+#: configuration.xml:717
#, no-c-format
msgid "The default for all values is to leave them at Lucene's own default, so the listed values in the following table actually depend on the version of Lucene you are using; values shown are relative to version <literal>2.4</literal>. For more information about Lucene indexing performances, please refer to the Lucene documentation."
msgstr ""
+#. Tag: para
+#: configuration.xml:723
+#, no-c-format
+msgid "Previous versions had the <literal>batch</literal> parameters inherit from <literal>transaction</literal> properties. This needs now to be explicitly set."
+msgstr ""
+
#. Tag: title
-#: configuration.xml:628
+#: configuration.xml:728
#, no-c-format
msgid "List of indexing performance and behavior properties"
msgstr ""
#. Tag: entry
-#: configuration.xml:637
+#: configuration.xml:737
#, no-c-format
msgid "Default Value"
msgstr ""
#. Tag: literal
-#: configuration.xml:643
+#: configuration.xml:744
#, no-c-format
+msgid "hibernate.search.[default|<indexname>].exclusive_index_use"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:746
+#, no-c-format
+msgid "Set to <literal>true</literal> when no other process will need to write to the same index: this will enable Hibernate Search to work in exlusive mode on the index and improve performance in writing changes to the index."
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:751
+#, no-c-format
+msgid "<literal>false</literal> (releases locks as soon as possible)"
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:755
+#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].max_buffered_delete_terms"
msgstr ""
#. Tag: para
-#: configuration.xml:645
+#: configuration.xml:757
#, no-c-format
msgid "Determines the minimal number of delete terms required before the buffered in-memory delete terms are applied and flushed. If there are documents buffered in memory at the time, they are merged and a new segment is created."
msgstr ""
#. Tag: entry
-#: configuration.xml:650 configuration.xml:660
+#: configuration.xml:762 configuration.xml:772
#, no-c-format
msgid "Disabled (flushes by RAM usage)"
msgstr ""
#. Tag: literal
-#: configuration.xml:654
+#: configuration.xml:766
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].max_buffered_docs"
msgstr ""
#. Tag: para
-#: configuration.xml:656
+#: configuration.xml:768
#, no-c-format
msgid "Controls the amount of documents buffered in memory during indexing. The bigger the more RAM is consumed."
msgstr ""
#. Tag: literal
-#: configuration.xml:664
+#: configuration.xml:776
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].max_field_length"
msgstr ""
#. Tag: para
-#: configuration.xml:666
+#: configuration.xml:778
#, no-c-format
msgid "The maximum number of terms that will be indexed for a single field. This limits the amount of memory required for indexing so that very large data will not crash the indexing process by running out of memory. This setting refers to the number of running terms, not to the number of different terms."
msgstr ""
#. Tag: para
-#: configuration.xml:671
+#: configuration.xml:783
#, no-c-format
msgid "This silently truncates large documents, excluding from the index all terms that occur further in the document. If you know your source documents are large, be sure to set this value high enough to accommodate the expected size. If you set it to Integer.MAX_VALUE, then the only limit is your memory, but you should anticipate an OutOfMemoryError."
msgstr ""
#. Tag: para
-#: configuration.xml:676
+#: configuration.xml:789
#, no-c-format
msgid "If setting this value in <literal>batch</literal> differently than in <literal>transaction</literal> you may get different data (and results) in your index depending on the indexing mode."
msgstr ""
#. Tag: entry
-#: configuration.xml:682
+#: configuration.xml:794
#, no-c-format
msgid "10000"
msgstr ""
#. Tag: literal
-#: configuration.xml:686
+#: configuration.xml:798
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].max_merge_docs"
msgstr ""
#. Tag: para
-#: configuration.xml:688
+#: configuration.xml:800
#, no-c-format
msgid "Defines the largest number of documents allowed in a segment. Larger values are best for batched indexing and speedier searches. Small values are best for transaction indexing."
msgstr ""
#. Tag: entry
-#: configuration.xml:693
+#: configuration.xml:805
#, no-c-format
msgid "Unlimited (Integer.MAX_VALUE)"
msgstr ""
#. Tag: literal
-#: configuration.xml:697
+#: configuration.xml:809
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].merge_factor"
msgstr ""
#. Tag: para
-#: configuration.xml:699
+#: configuration.xml:811
#, no-c-format
msgid "Controls segment merge frequency and size."
msgstr ""
#. Tag: para
-#: configuration.xml:700
+#: configuration.xml:812
#, no-c-format
msgid "Determines how often segment indexes are merged when insertion occurs. With smaller values, less RAM is used while indexing, and searches on unoptimized indexes are faster, but indexing speed is slower. With larger values, more RAM is used during indexing, and while searches on unoptimized indexes are slower, indexing is faster. Thus larger values (> 10) are best for batch index creation, and smaller values (< 10) for indexes that are interactively maintained. The value must no be lower than 2."
msgstr ""
#. Tag: entry
-#: configuration.xml:710
+#: configuration.xml:822
#, no-c-format
msgid "<entry>10</entry>"
msgstr ""
#. Tag: literal
-#: configuration.xml:714
+#: configuration.xml:826
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].ram_buffer_size"
msgstr ""
#. Tag: para
-#: configuration.xml:716
+#: configuration.xml:828
#, no-c-format
msgid "Controls the amount of RAM in MB dedicated to document buffers. When used together max_buffered_docs a flush occurs for whichever event happens first."
msgstr ""
#. Tag: para
-#: configuration.xml:718
+#: configuration.xml:830
#, no-c-format
msgid "Generally for faster indexing performance it's best to flush by RAM usage instead of document count and use as large a RAM buffer as you can."
msgstr ""
#. Tag: entry
-#: configuration.xml:723
+#: configuration.xml:835
#, no-c-format
msgid "16 MB"
msgstr ""
#. Tag: literal
-#: configuration.xml:727
+#: configuration.xml:839
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].term_index_interval"
msgstr ""
#. Tag: para
-#: configuration.xml:729
+#: configuration.xml:841
#, no-c-format
msgid "Expert: Set the interval between indexed terms."
msgstr ""
#. Tag: para
-#: configuration.xml:730
+#: configuration.xml:842
#, no-c-format
msgid "Large values cause less memory to be used by IndexReader, but slow random-access to terms. Small values cause more memory to be used by an IndexReader, and speed random-access to terms. See Lucene documentation for more details."
msgstr ""
#. Tag: entry
-#: configuration.xml:736
+#: configuration.xml:848
#, no-c-format
msgid "<entry>128</entry>"
msgstr ""
#. Tag: literal
-#: configuration.xml:740
+#: configuration.xml:852
#, no-c-format
msgid "hibernate.search.[default|<indexname>].indexwriter.[transaction|batch].use_compound_file"
msgstr ""
#. Tag: entry
-#: configuration.xml:742
+#: configuration.xml:854
#, no-c-format
msgid "The advantage of using the compound file format is that less file descriptors are used. The disadvantage is that indexing takes more time and temporary disk space. You can set this parameter to <literal>false</literal> in an attempt to improve the indexing time, but you could run out of file descriptors if <literal>mergeFactor</literal> is also large."
msgstr ""
#. Tag: para
-#: configuration.xml:748
+#: configuration.xml:860
#, no-c-format
msgid "Boolean parameter, use \"<literal>true</literal>\" or \"<literal>false</literal>\". The default value for this option is <literal>true</literal>."
msgstr ""
#. Tag: entry
-#: configuration.xml:753
+#: configuration.xml:865
#, no-c-format
msgid "true"
msgstr ""
#. Tag: para
-#: configuration.xml:759
+#: configuration.xml:871
#, no-c-format
+msgid "When your architecture permits it, always set <literal>hibernate.search.default.exclusive_index_use=true</literal> as it greatly improves efficiency in index writing."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:876
+#, no-c-format
msgid "To tune the indexing speed it might be useful to time the object loading from database in isolation from the writes to the index. To achieve this set the <literal>blackhole</literal> as worker backend and start you indexing routines. This backend does not disable Hibernate Search: it will still generate the needed changesets to the index, but will discard them instead of flushing them to the index. As opposite to setting the <literal>hibernate.search.indexing_strategy</literal> to <literal>manual</literal> when using <literal>blackhole</literal> it will possibly load more data to rebuild the index from associated entities."
msgstr ""
#. Tag: programlisting
-#: configuration.xml:769
+#: configuration.xml:887
#, no-c-format
msgid "hibernate.search.worker.backend blackhole"
msgstr ""
#. Tag: para
-#: configuration.xml:771
+#: configuration.xml:889
#, no-c-format
msgid "The recommended approach is to focus first on optimizing the object loading, and then use the timings you achieve as a baseline to tune the indexing process."
msgstr ""
#. Tag: para
-#: configuration.xml:773
+#: configuration.xml:893
#, no-c-format
msgid "The <literal>blackhole</literal> backend is not meant to be used in production, only as a tool to identify indexing bottlenecks."
msgstr ""
#. Tag: title
-#: configuration.xml:781
+#: configuration.xml:900
#, no-c-format
msgid "LockFactory configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:785
+#: configuration.xml:904
#, no-c-format
msgid "Lucene Directories have default locking strategies which work well for most cases, but it's possible to specify for each index managed by Hibernate Search which LockingFactory you want to use."
msgstr ""
#. Tag: para
-#: configuration.xml:789
+#: configuration.xml:910
#, no-c-format
msgid "Some of these locking strategies require a filesystem level lock and may be used even on RAM based indexes, but this is not recommended and of no practical use."
msgstr ""
#. Tag: para
-#: configuration.xml:795
+#: configuration.xml:916
#, no-c-format
msgid "To select a locking factory, set the <literal>hibernate.search.<index>.locking_strategy</literal> option to one of <literal>simple</literal>, <literal>native</literal>, <literal>single</literal> or <literal>none</literal>, or set it to the fully qualified name of an implementation of <literal>org.hibernate.search.store.LockFactoryFactory</literal>; Implementing this interface you can provide a custom <literal>org.apache.lucene.store.LockFactory</literal>."
msgstr ""
#. Tag: title
-#: configuration.xml:804
+#: configuration.xml:925
#, no-c-format
msgid "List of available LockFactory implementations"
msgstr ""
#. Tag: entry
-#: configuration.xml:809
+#: configuration.xml:930
#, no-c-format
msgid "name"
msgstr ""
#. Tag: entry
-#: configuration.xml:819
+#: configuration.xml:940
#, no-c-format
msgid "simple"
msgstr ""
#. Tag: entry
-#: configuration.xml:821
+#: configuration.xml:942
#, no-c-format
msgid "org.apache.lucene.store.SimpleFSLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:824
+#: configuration.xml:945
#, no-c-format
msgid "Safe implementation based on Java's File API, it marks the usage of the index by creating a marker file."
msgstr ""
#. Tag: para
-#: configuration.xml:827
+#: configuration.xml:948
#, no-c-format
msgid "If for some reason you had to kill your application, you will need to remove this file before restarting it."
msgstr ""
#. Tag: para
-#: configuration.xml:830
+#: configuration.xml:951
#, no-c-format
msgid "This is the default implementation for <literal>FSDirectoryProvider</literal>,<literal>FSMasterDirectoryProvider</literal> and <literal>FSSlaveDirectoryProvider</literal>."
msgstr ""
#. Tag: entry
-#: configuration.xml:837
+#: configuration.xml:958
#, no-c-format
msgid "native"
msgstr ""
#. Tag: entry
-#: configuration.xml:839
+#: configuration.xml:960
#, no-c-format
msgid "org.apache.lucene.store.NativeFSLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:842
+#: configuration.xml:963
#, no-c-format
msgid "As does <literal>simple</literal> this also marks the usage of the index by creating a marker file, but this one is using native OS file locks so that even if your application crashes the locks will be cleaned up."
msgstr ""
#. Tag: para
-#: configuration.xml:847
+#: configuration.xml:968
#, no-c-format
msgid "This implementation has known problems on NFS."
msgstr ""
#. Tag: entry
-#: configuration.xml:852
+#: configuration.xml:973
#, no-c-format
msgid "single"
msgstr ""
#. Tag: entry
-#: configuration.xml:854
+#: configuration.xml:975
#, no-c-format
msgid "org.apache.lucene.store.SingleInstanceLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:857
+#: configuration.xml:978
#, no-c-format
msgid "This LockFactory doesn't use a file marker but is a Java object lock held in memory; therefore it's possible to use it only when you are sure the index is not going to be shared by any other process."
msgstr ""
#. Tag: para
-#: configuration.xml:862
+#: configuration.xml:983
#, no-c-format
msgid "This is the default implementation for <literal>RAMDirectoryProvider</literal>."
msgstr ""
#. Tag: entry
-#: configuration.xml:870
+#: configuration.xml:991
#, no-c-format
msgid "org.apache.lucene.store.NoLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:873
+#: configuration.xml:994
#, no-c-format
msgid "All changes to this index are not coordinated by any lock; test your application carefully and make sure you know what it means."
msgstr ""
#. Tag: section
-#: configuration.xml:880
+#: configuration.xml:1001
#, no-c-format
msgid "Configuration example:"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:884
+#: configuration.xml:1005
#, no-c-format
msgid ""
"hibernate.search.default.locking_strategy simple\n"
@@ -1263,3 +1507,76 @@
"hibernate.search.Books.locking_strategy org.custom.components.MyLockingFactory"
msgstr ""
+#. Tag: title
+#: configuration.xml:1015
+#, no-c-format
+msgid "Exception Handling Configuration"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1017
+#, no-c-format
+msgid "Hibernate Search allows you to configure how exceptions are handled during the indexing process. If no configuration is provided then exceptions are logged to the log output by default. It is possible to explicitly declare the exception logging mechanism as seen below:"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1022
+#, no-c-format
+msgid "hibernate.search.error_handler log"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1022
+#, no-c-format
+msgid "The default exception handling occurs for both synchronous and asynchronous indexing. Hibernate Search provides an easy mechanism to override the default error handling implementation."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1027
+#, no-c-format
+msgid "In order to provide your own implementation you must implement the <code>ErrorHandler</code> interface, which provides <code>handle ( ErrorContext context )</code> method. The <code>ErrorContext</code> provides a reference to the primary <code>LuceneWork</code> that failed, the underlying exception and any subsequent <code>LuceneWork</code> that could not be processed due to the primary exception."
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1034
+#, no-c-format
+msgid ""
+ "public interface ErrorContext {\n"
+ " List<LuceneWork> getFailingOperations();\n"
+ " LuceneWork getOperationAtFault();\n"
+ " Throwable getThrowable();\n"
+ " boolean hasErrors();\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1036
+#, no-c-format
+msgid "The following provides an example implementation of <code>ErrorHandler</code>:"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1039
+#, no-c-format
+msgid ""
+ "public class CustomErrorHandler implements ErrorHandler {\n"
+ " public void handle ( ErrorContext context ) {\n"
+ " ...\n"
+ " //publish error context to some internal error handling system\n"
+ " ...\n"
+ " }\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1039
+#, no-c-format
+msgid "To register this error handler with Hibernate Search you must declare the <code>CustomErrorHandler</code> fully qualified classname in the configuration properties:"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1043
+#, no-c-format
+msgid "hibernate.search.error_handler CustomerErrorHandler"
+msgstr ""
+
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/getting-started.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/getting-started.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/getting-started.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
@@ -15,217 +15,245 @@
"Content-Transfer-Encoding: 8bit\n"
#. Tag: title
-#: getting-started.xml:30
+#: getting-started.xml:31
#, no-c-format
msgid "Getting started"
msgstr ""
#. Tag: para
-#: getting-started.xml:32
+#: getting-started.xml:33
#, no-c-format
-msgid "Welcome to Hibernate Search! The following chapter will guide you through the initial steps required to integrate Hibernate Search into an existing Hibernate enabled application. In case you are a Hibernate new timer we recommend you start <ulink url=\"http://hibernate.org/152.html\">here</ulink>."
+msgid "Welcome to Hibernate Search. The following chapter will guide you through the initial steps required to integrate Hibernate Search into an existing Hibernate enabled application. In case you are a Hibernate new timer we recommend you start <ulink url=\"http://hibernate.org/152.html\">here</ulink>."
msgstr ""
#. Tag: title
-#: getting-started.xml:39
+#: getting-started.xml:40
#, no-c-format
msgid "System Requirements"
msgstr ""
#. Tag: title
-#: getting-started.xml:42
+#: getting-started.xml:43
#, no-c-format
msgid "System requirements"
msgstr ""
#. Tag: entry
-#: getting-started.xml:47
+#: getting-started.xml:48
#, no-c-format
msgid "Java Runtime"
msgstr ""
#. Tag: entry
-#: getting-started.xml:49
+#: getting-started.xml:50
#, no-c-format
msgid "A JDK or JRE version <emphasis>5</emphasis> or greater. You can download a Java Runtime for Windows/Linux/Solaris <ulink url=\"http://java.sun.com/javase/downloads/\">here</ulink>."
msgstr ""
#. Tag: entry
-#: getting-started.xml:55
+#: getting-started.xml:56
#, no-c-format
msgid "Hibernate Search"
msgstr ""
#. Tag: entry
-#: getting-started.xml:57
+#: getting-started.xml:58
#, no-c-format
-msgid "<literal>hibernate-search.jar</literal> and all runtime dependencies from the <literal>lib</literal> directory of the Hibernate Search distribution. Please refer to <filename>README.txt </filename>in the lib directory to understand which dependencies are required."
+msgid "<literal>hibernate-search.jar</literal> and all runtime dependencies from the <literal>dist/lib</literal> directory of the Hibernate Search distribution."
msgstr ""
#. Tag: entry
-#: getting-started.xml:65
+#: getting-started.xml:64
#, no-c-format
msgid "Hibernate Core"
msgstr ""
#. Tag: entry
-#: getting-started.xml:67
+#: getting-started.xml:66
#, no-c-format
-msgid "This instructions have been tested against Hibernate 3.3.x. You will need <literal>hibernate-core.jar</literal> and its transitive dependencies from the <literal>lib</literal> directory of the distribution. Refer to <literal>README.txt</literal> in the <literal>lib</literal> directory of the distribution to determine the minimum runtime requirements."
+msgid "This instructions have been tested against Hibernate 3.5. You will need <literal>hibernate-core.jar</literal> and its transitive dependencies from the <literal>lib</literal> directory of the distribution. Refer to <literal>README.txt</literal> in the <literal>lib</literal> directory of the distribution to determine the minimum runtime requirements."
msgstr ""
#. Tag: entry
-#: getting-started.xml:76
+#: getting-started.xml:75
#, no-c-format
msgid "Hibernate Annotations"
msgstr ""
#. Tag: entry
-#: getting-started.xml:78
+#: getting-started.xml:77
#, no-c-format
-msgid "Even though Hibernate Search can be used without Hibernate Annotations the following instructions will use them for basic entity configuration (<emphasis>@Entity, @Id, @OneToMany,...</emphasis>). This part of the configuration could also be expressed in xml or code. However, Hibernate Search itself has its own set of annotations (<emphasis>@Indexed, @DocumentId, @Field,...</emphasis>) for which there exists so far no alternative configuration. The tutorial is tested against version 3.4.x of Hibernate Annotations."
+msgid "Even though Hibernate Search can be used without Hibernate Annotations the following instructions will use them for basic entity configuration (<emphasis>@Entity, @Id, @OneToMany,...</emphasis>). This part of the configuration could also be expressed in xml or code. However, Hibernate Search itself has its own set of annotations (<emphasis>@Indexed, @DocumentId, @Field,...</emphasis>) for which there exists so far no alternative configuration. The tutorial is tested against version 3.5 of Hibernate Annotations (part of the Hibernate Core distribution)."
msgstr ""
#. Tag: para
#: getting-started.xml:92
#, no-c-format
-msgid "You can download all dependencies from the Hibernate <ulink url=\"http://www.hibernate.org/6.html\">download site</ulink>. You can also verify the dependency versions against the <ulink url=\"http://www.hibernate.org/6.html#A3\">Hibernate Compatibility Matrix</ulink>."
+msgid "You can download all dependencies from the Hibernate download site."
msgstr ""
#. Tag: title
-#: getting-started.xml:100
+#: getting-started.xml:97
#, no-c-format
msgid "Using Maven"
msgstr ""
#. Tag: para
-#: getting-started.xml:102
+#: getting-started.xml:99
#, no-c-format
-msgid "Instead of managing all dependencies manually, maven users have the possibility to use the <ulink url=\"http://repository.jboss.com/maven2\">JBoss maven repository</ulink>. Just add the JBoss repository url to the <emphasis>repositories</emphasis> section of your <filename>pom.xml</filename> or <filename>settings.xml</filename>:"
+msgid "Instead of managing all dependencies manually, maven users have the possibility to use the <ulink url=\"https://repository.jboss.org/nexus/content/groups/public/\">JBoss maven repository</ulink>. Add the following to your Maven <filename>settings.xml file</filename> (see also <ulink url=\"http://community.jboss.org/wiki/MavenGettingStarted-Users\">Maven Getting Started</ulink>):"
msgstr ""
#. Tag: title
-#: getting-started.xml:110
+#: getting-started.xml:108
#, no-c-format
msgid "Adding the JBoss maven repository to <filename>settings.xml</filename>"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:113
+#: getting-started.xml:111
#, no-c-format
msgid ""
- "<repository>\n"
- " <id>repository.jboss.org</id>\n"
- " <name>JBoss Maven Repository</name>\n"
- " <url>http://repository.jboss.org/maven2</url>\n"
- " <layout>default</layout>\n"
- "</repository>"
+ "<settings>\n"
+ " ...\n"
+ " <profiles>\n"
+ " ...\n"
+ " <profile>\n"
+ " <id>jboss-public-repository</id>\n"
+ " <repositories>\n"
+ " <repository>\n"
+ " <id>jboss-public-repository-group</id>\n"
+ " <name>JBoss Public Maven Repository Group</name>\n"
+ " <url>https://repository.jboss.org/nexus/content/groups/public/</url&..."
+ " <layout>default</layout>\n"
+ " <releases>\n"
+ " <enabled>true</enabled>\n"
+ " <updatePolicy>never</updatePolicy>\n"
+ " </releases>\n"
+ " <snapshots>\n"
+ " <enabled>true</enabled>\n"
+ " <updatePolicy>never</updatePolicy>\n"
+ " </snapshots>\n"
+ " </repository>\n"
+ " </repositories>\n"
+ " <pluginRepositories>\n"
+ " <pluginRepository>\n"
+ " <id>jboss-public-repository-group</id>\n"
+ " <name>JBoss Public Maven Repository Group</name>\n"
+ " <url>https://repository.jboss.org/nexus/content/groups/public/</url&..."
+ " <layout>default</layout>\n"
+ " <releases>\n"
+ " <enabled>true</enabled>\n"
+ " <updatePolicy>never</updatePolicy>\n"
+ " </releases>\n"
+ " <snapshots>\n"
+ " <enabled>true</enabled>\n"
+ " <updatePolicy>never</updatePolicy>\n"
+ " </snapshots>\n"
+ " </pluginRepository>\n"
+ " </pluginRepositories>\n"
+ " </profile>\n"
+ "\n"
+ " </profiles>\n"
+ "\n"
+ " <activeProfiles>\n"
+ " <activeProfile>jboss-public-repository</activeProfile>\n"
+ " </activeProfiles>\n"
+ " ...\n"
+ "</settings>"
msgstr ""
#. Tag: para
-#: getting-started.xml:116
+#: getting-started.xml:114
#, no-c-format
msgid "Then add the following dependencies to your pom.xml:"
msgstr ""
#. Tag: title
-#: getting-started.xml:119
+#: getting-started.xml:117
#, no-c-format
msgid "Maven dependencies for Hibernate Search"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:121
+#: getting-started.xml:119
#, no-c-format
msgid ""
"<dependency>\n"
" <groupId>org.hibernate</groupId>\n"
" <artifactId>hibernate-search</artifactId>\n"
- " <version>3.1.0.GA</version>\n"
+ " <version>&version;</version>\n"
"</dependency>\n"
"<dependency>\n"
" <groupId>org.hibernate</groupId>\n"
- " <artifactId>hibernate-annotations</artifactId>\n"
- " <version>3.4.0.GA</version>\n"
- "</dependency>\n"
- "<dependency>\n"
- " <groupId>org.hibernate</groupId>\n"
" <artifactId>hibernate-entitymanager</artifactId>\n"
- " <version>3.4.0.GA</version>\n"
- "</dependency>\n"
- "<dependency>\n"
- " <groupId>org.apache.solr</groupId>\n"
- " <artifactId>solr-common</artifactId>\n"
- " <version>1.3.0</version>\n"
- "</dependency>\n"
- "<dependency>\n"
- " <groupId>org.apache.solr</groupId>\n"
- " <artifactId>solr-core</artifactId>\n"
- " <version>1.3.0</version>\n"
- "</dependency>\n"
- "<dependency>\n"
- " <groupId>org.apache.lucene</groupId>\n"
- " <artifactId>lucene-snowball</artifactId>\n"
- " <version>2.4.0</version>\n"
+ " <version>3.5.0-Final</version>\n"
"</dependency>"
msgstr ""
#. Tag: para
-#: getting-started.xml:124
+#: getting-started.xml:122
#, no-c-format
-msgid "Not all dependencies are required. Only the <emphasis>hibernate-search</emphasis> dependency is mandatory. This dependency, together with its required transitive dependencies, contain all required classes needed to use Hibernate Search. <emphasis>hibernate-annotations</emphasis> is only needed if you want to use annotations to configure your domain model as we do in this tutorial. However, even if you choose not to use Hibernate Annotations you still have to use the Hibernate Search specific annotations, which are bundled with the hibernate-search jar file, to configure your Lucene index. Currently there is no XML configuration available for Hibernate Search. <emphasis>hibernate-entitymanager</emphasis> is required if you want to use Hibernate Search in conjunction with JPA. The Solr dependencies are needed if you want to utilize Solr's analyzer framework. More about this later. And finally, the <literal>lucene-snowball</literal> dependency is needed if you want to u!
se Lucene's snowball stemmer."
+msgid "Only the <emphasis>hibernate-search</emphasis> dependency is mandatory, because it contains together with its required transitive dependencies all required classes needed to use Hibernate Search.<emphasis> hibernate-entitymanager</emphasis> is only required if you want to use Hibernate Search in conjunction with JPA."
msgstr ""
+#. Tag: para
+#: getting-started.xml:129
+#, no-c-format
+msgid "There is no XML configuration available for Hibernate Search but we provide a powerful programmatic mapping API that elegantly replace this kind of deployment form (see <xref linkend=\"hsearch-mapping-programmaticapi\"/> for more information)."
+msgstr ""
+
#. Tag: title
-#: getting-started.xml:142
+#: getting-started.xml:138
#, no-c-format
msgid "Configuration"
msgstr ""
#. Tag: para
-#: getting-started.xml:144
+#: getting-started.xml:140
#, no-c-format
msgid "Once you have downloaded and added all required dependencies to your application you have to add a couple of properties to your hibernate configuration file. If you are using Hibernate directly this can be done in <literal>hibernate.properties</literal> or <literal>hibernate.cfg.xml</literal>. If you are using Hibernate via JPA you can also add the properties to <literal>persistence.xml</literal>. The good news is that for standard use most properties offer a sensible default. An example <filename>persistence.xml</filename> configuration could look like this:"
msgstr ""
#. Tag: title
-#: getting-started.xml:155
+#: getting-started.xml:151
#, no-c-format
msgid "Basic configuration options to be added to <literal><filename>hibernate.properties</filename></literal>, <literal><filename>hibernate.cfg.xml</filename></literal> or <filename>persistence.xml</filename>"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:160
+#: getting-started.xml:156
#, no-c-format
msgid ""
"...\n"
"<property name=\"hibernate.search.default.directory_provider\" \n"
- " value=\"org.hibernate.search.store.FSDirectoryProvider\"/> \n"
+ " value=\"org.hibernate.search.store.FSDirectoryProvider\"/> \n"
"\n"
- "<property name=\"hibernate.search.default.indexBase\" value=\"/var/lucene/indexes\"/> \n"
+ "<property name=\"hibernate.search.default.indexBase\" \n"
+ " value=\"/var/lucene/indexes\"/> \n"
"..."
msgstr ""
#. Tag: para
-#: getting-started.xml:163
+#: getting-started.xml:159
#, no-c-format
msgid "First you have to tell Hibernate Search which <classname>DirectoryProvider</classname> to use. This can be achieved by setting the <literal>hibernate.search.default.directory_provider</literal> property. Apache Lucene has the notion of a <literal>Directory</literal> to store the index files. Hibernate Search handles the initialization and configuration of a Lucene <literal>Directory</literal> instance via a <literal>DirectoryProvider</literal>. In this tutorial we will use a subclass of <literal>DirectoryProvider</literal> called <classname>FSDirectoryProvider</classname>. This will give us the ability to physically inspect the Lucene indexes created by Hibernate Search (eg via <ulink url=\"http://www.getopt.org/luke/\">Luke</ulink>). Once you have a working configuration you can start experimenting with other directory providers (see <xref linkend=\"search-configuration-directory\"/>). Next to the directory provider you also have to specify the default root director!
y for all indexes via <literal>hibernate.search.default.indexBase</literal>."
msgstr ""
#. Tag: para
-#: getting-started.xml:180
+#: getting-started.xml:176
#, no-c-format
msgid "Lets assume that your application contains the Hibernate managed classes <classname>example.Book</classname> and <classname>example.Author</classname> and you want to add free text search capabilities to your application in order to search the books contained in your database."
msgstr ""
#. Tag: title
-#: getting-started.xml:187
+#: getting-started.xml:183
#, no-c-format
msgid "Example entities Book and Author before adding Hibernate Search specific annotations"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:190
+#: getting-started.xml:186
#, no-c-format
msgid ""
"package example;\n"
@@ -246,8 +274,7 @@
"\n"
" private Date publicationDate;\n"
" \n"
- " public Book() {\n"
- " } \n"
+ " public Book() {} \n"
" \n"
" // standard getters/setters follow here\n"
" ...\n"
@@ -255,7 +282,7 @@
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:192
+#: getting-started.xml:188
#, no-c-format
msgid ""
"package example;\n"
@@ -269,8 +296,7 @@
"\n"
" private String name;\n"
"\n"
- " public Author() {\n"
- " } \n"
+ " public Author() {} \n"
" \n"
" // standard getters/setters follow here\n"
" ...\n"
@@ -278,49 +304,49 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:195
+#: getting-started.xml:191
#, no-c-format
msgid "To achieve this you have to add a few annotations to the <classname>Book</classname> and <classname>Author</classname> class. The first annotation <literal>@Indexed</literal> marks <classname>Book</classname> as indexable. By design Hibernate Search needs to store an untokenized id in the index to ensure index unicity for a given entity. <literal>@DocumentId</literal> marks the property to use for this purpose and is in most cases the same as the database primary key. In fact since the 3.1.0 release of Hibernate Search <literal>@DocumentId</literal> is optional in the case where an <classname>@Id</classname> annotation exists."
msgstr ""
#. Tag: para
-#: getting-started.xml:206
+#: getting-started.xml:202
#, no-c-format
msgid "Next you have to mark the fields you want to make searchable. Let's start with <literal>title</literal> and <literal>subtitle</literal> and annotate both with <literal>@Field</literal>. The parameter <literal>index=Index.TOKENIZED</literal> will ensure that the text will be tokenized using the default Lucene analyzer. Usually, tokenizing means chunking a sentence into individual words and potentially excluding common words like <literal>'a'</literal> or '<literal>the</literal>'. We will talk more about analyzers a little later on. The second parameter we specify within <literal>@Field</literal>,<literal> store=Store.NO</literal>, ensures that the actual data will not be stored in the index. Whether this data is stored in the index or not has nothing to do with the ability to search for it. From Lucene's perspective it is not necessary to keep the data once the index is created. The benefit of storing it is the ability to retrieve it via projections (<xref linkend=\"p!
rojections\"/>)."
msgstr ""
#. Tag: para
-#: getting-started.xml:222
+#: getting-started.xml:218
#, no-c-format
msgid "Without projections, Hibernate Search will per default execute a Lucene query in order to find the database identifiers of the entities matching the query critera and use these identifiers to retrieve managed objects from the database. The decision for or against projection has to be made on a case to case basis. The default behaviour - <literal>Store.NO</literal> - is recommended since it returns managed objects whereas projections only return object arrays."
msgstr ""
#. Tag: para
-#: getting-started.xml:230
+#: getting-started.xml:226
#, no-c-format
msgid "After this short look under the hood let's go back to annotating the <classname>Book</classname> class. Another annotation we have not yet discussed is <literal>@DateBridge</literal>. This annotation is one of the built-in field bridges in Hibernate Search. The Lucene index is purely string based. For this reason Hibernate Search must convert the data types of the indexed fields to strings and vice versa. A range of predefined bridges are provided, including the <classname>DateBridge</classname> which will convert a <classname>java.util.Date</classname> into a <classname>String</classname> with the specified resolution. For more details see <xref linkend=\"search-mapping-bridge\"/>."
msgstr ""
#. Tag: para
-#: getting-started.xml:241
+#: getting-started.xml:237
#, no-c-format
msgid "This leaves us with <literal>@IndexedEmbedded. </literal>This annotation is used to index associated entities (<literal>@ManyToMany</literal>, <literal>@*ToOne</literal> and <literal>@Embedded</literal>) as part of the owning entity. This is needed since a Lucene index document is a flat data structure which does not know anything about object relations. To ensure that the authors' name wil be searchable you have to make sure that the names are indexed as part of the book itself. On top of <literal>@IndexedEmbedded</literal> you will also have to mark all fields of the associated entity you want to have included in the index with <literal>@Indexed</literal>. For more details see <xref linkend=\"search-mapping-associated\"/>."
msgstr ""
#. Tag: para
-#: getting-started.xml:253
+#: getting-started.xml:249
#, no-c-format
msgid "These settings should be sufficient for now. For more details on entity mapping refer to <xref linkend=\"search-mapping-entity\"/>."
msgstr ""
#. Tag: title
-#: getting-started.xml:257
+#: getting-started.xml:253
#, no-c-format
msgid "Example entities after adding Hibernate Search annotations"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:260
+#: getting-started.xml:256
#, no-c-format
msgid ""
"package example;\n"
@@ -331,7 +357,6 @@
"\n"
" @Id\n"
" @GeneratedValue\n"
- " <emphasis role=\"bold\">@DocumentId</emphasis>\n"
" private Integer id;\n"
" \n"
" <emphasis role=\"bold\">@Field(index=Index.TOKENIZED, store=Store.NO)</emphasis>\n"
@@ -357,7 +382,7 @@
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:262
+#: getting-started.xml:258
#, no-c-format
msgid ""
"package example;\n"
@@ -381,87 +406,72 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:267
+#: getting-started.xml:263
#, no-c-format
msgid "Indexing"
msgstr ""
#. Tag: para
-#: getting-started.xml:269
+#: getting-started.xml:265
#, no-c-format
-msgid "Hibernate Search will transparently index every entity persisted, updated or removed through Hibernate Core. However, you have to trigger an initial indexing to populate the Lucene index with the data already present in your database. Once you have added the above properties and annotations it is time to trigger an initial batch index of your books. You can achieve this by using one of the following code snippets (see also <xref linkend=\"search-batchindex\"/>):"
+msgid "Hibernate Search will transparently index every entity persisted, updated or removed through Hibernate Core. However, you have to create an initial Lucene index for the data already present in your database. Once you have added the above properties and annotations it is time to trigger an initial batch index of your books. You can achieve this by using one of the following code snippets (see also <xref linkend=\"search-batchindex\"/>):"
msgstr ""
#. Tag: title
-#: getting-started.xml:278
+#: getting-started.xml:274
#, no-c-format
msgid "Using Hibernate Session to index data"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:280
+#: getting-started.xml:276
#, no-c-format
msgid ""
"FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
- "Transaction tx = fullTextSession.beginTransaction();\n"
- "\n"
- "List books = session.createQuery(\"from Book as book\").list();\n"
- "for (Book book : books) {\n"
- " <emphasis role=\"bold\">fullTextSession.index(book);</emphasis>\n"
- "}\n"
- "\n"
- "tx.commit(); //index is written at commit time"
+ "fullTextSession.createIndexer().startAndWait();"
msgstr ""
#. Tag: title
-#: getting-started.xml:284
+#: getting-started.xml:280
#, no-c-format
msgid "Using JPA to index data"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:286
+#: getting-started.xml:282
#, no-c-format
msgid ""
"EntityManager em = entityManagerFactory.createEntityManager();\n"
"FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(em);\n"
- "em.getTransaction().begin();\n"
- "\n"
- "List books = em.createQuery(\"select book from Book as book\").getResultList();\n"
- "for (Book book : books) {\n"
- " <emphasis role=\"bold\">fullTextEntityManager.index(book);</emphasis>\n"
- "} \n"
- "\n"
- "em.getTransaction().commit();\n"
- "em.close();"
+ "fullTextEntityManager.createIndexer().startAndWait();"
msgstr ""
#. Tag: para
-#: getting-started.xml:289
+#: getting-started.xml:285
#, no-c-format
msgid "After executing the above code, you should be able to see a Lucene index under <literal>/var/lucene/indexes/example.Book</literal>. Go ahead an inspect this index with <ulink url=\"http://www.getopt.org/luke/\">Luke</ulink>. It will help you to understand how Hibernate Search works."
msgstr ""
#. Tag: title
-#: getting-started.xml:297
+#: getting-started.xml:293
#, no-c-format
msgid "Searching"
msgstr ""
#. Tag: para
-#: getting-started.xml:299
+#: getting-started.xml:295
#, no-c-format
msgid "Now it is time to execute a first search. The general approach is to create a native Lucene query and then wrap this query into a org.hibernate.Query in order to get all the functionality one is used to from the Hibernate API. The following code will prepare a query against the indexed fields, execute it and return a list of <classname>Book</classname>s."
msgstr ""
#. Tag: title
-#: getting-started.xml:307
+#: getting-started.xml:303
#, no-c-format
msgid "Using Hibernate Session to create and execute a search"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:309
+#: getting-started.xml:305
#, no-c-format
msgid ""
"FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
@@ -483,18 +493,18 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:313
+#: getting-started.xml:309
#, no-c-format
msgid "Using JPA to create and execute a search"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:315
+#: getting-started.xml:311
#, no-c-format
msgid ""
"EntityManager em = entityManagerFactory.createEntityManager();\n"
"FullTextEntityManager fullTextEntityManager = \n"
- " org.hibernate.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
+ " org.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
"em.getTransaction().begin();\n"
"\n"
"// create native Lucene query\n"
@@ -513,61 +523,61 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:320
+#: getting-started.xml:316
#, no-c-format
msgid "Analyzer"
msgstr ""
#. Tag: para
-#: getting-started.xml:322
+#: getting-started.xml:318
#, no-c-format
msgid "Let's make things a little more interesting now. Assume that one of your indexed book entities has the title \"Refactoring: Improving the Design of Existing Code\" and you want to get hits for all of the following queries: \"refactor\", \"refactors\", \"refactored\" and \"refactoring\". In Lucene this can be achieved by choosing an analyzer class which applies word stemming during the indexing <emphasis role=\"bold\">as well as</emphasis> search process. Hibernate Search offers several ways to configure the analyzer to use (see <xref linkend=\"analyzer\"/>):"
msgstr ""
#. Tag: para
-#: getting-started.xml:333
+#: getting-started.xml:329
#, no-c-format
msgid "Setting the <literal>hibernate.search.analyzer</literal> property in the configuration file. The specified class will then be the default analyzer."
msgstr ""
#. Tag: para
-#: getting-started.xml:339
+#: getting-started.xml:335
#, no-c-format
msgid "Setting the <literal><literal>@Analyzer</literal></literal> annotation at the entity level."
msgstr ""
#. Tag: para
-#: getting-started.xml:344
+#: getting-started.xml:340
#, no-c-format
msgid "Setting the <literal>@<literal>Analyzer</literal></literal> annotation at the field level."
msgstr ""
#. Tag: para
-#: getting-started.xml:349
+#: getting-started.xml:345
#, no-c-format
-msgid "When using the <literal>@Analyzer</literal> annotation one can either specify the fully qualified classname of the analyzer to use or one can refer to an analyzer definition defined by the <literal>@AnalyzerDef</literal> annotation. In the latter case the Solr analyzer framework with its factories approach is utilized. To find out more about the factory classes available you can either browse the Solr JavaDoc or read the corresponding section on the <ulink url=\"http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters\">Solr Wiki.</ulink> Note that depending on the chosen factory class additional libraries on top of the Solr dependencies might be required. For example, the <classname>PhoneticFilterFactory</classname> depends on <ulink url=\"http://commons.apache.org/codec\">commons-codec</ulink>."
+msgid "When using the <literal>@Analyzer</literal> annotation one can either specify the fully qualified classname of the analyzer to use or one can refer to an analyzer definition defined by the <literal>@AnalyzerDef</literal> annotation. In the latter case the Solr analyzer framework with its factories approach is utilized. To find out more about the factory classes available you can either browse the Solr JavaDoc or read the corresponding section on the <ulink url=\"http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters\">Solr Wiki.</ulink>"
msgstr ""
#. Tag: para
-#: getting-started.xml:362
+#: getting-started.xml:355
#, no-c-format
msgid "In the example below a <classname>StandardTokenizerFactory</classname> is used followed by two filter factories, <classname>LowerCaseFilterFactory</classname> and <classname>SnowballPorterFilterFactory</classname>. The standard tokenizer splits words at punctuation characters and hyphens while keeping email addresses and internet hostnames intact. It is a good general purpose tokenizer. The lowercase filter lowercases the letters in each token whereas the snowball filter finally applies language specific stemming."
msgstr ""
#. Tag: para
-#: getting-started.xml:372
+#: getting-started.xml:365
#, no-c-format
msgid "Generally, when using the Solr framework you have to start with a tokenizer followed by an arbitrary number of filters."
msgstr ""
#. Tag: title
-#: getting-started.xml:376
+#: getting-started.xml:369
#, no-c-format
msgid "Using <classname>@AnalyzerDef</classname> and the Solr framework to define and use an analyzer"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:379
+#: getting-started.xml:372
#, no-c-format
msgid ""
"package example;\n"
@@ -614,43 +624,14 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:384
+#: getting-started.xml:377
#, no-c-format
msgid "What's next"
msgstr ""
#. Tag: para
-#: getting-started.xml:386
+#: getting-started.xml:379
#, no-c-format
-msgid "The above paragraphs hopefully helped you getting an overview of Hibernate Search. Using the maven archetype plugin and the following command you can create an initial runnable maven project structure populated with the example code of this tutorial."
+msgid "The above paragraphs helped you getting an overview of Hibernate Search. The next step after this tutorial is to get more familiar with the overall architecture of Hibernate Search (<xref linkend=\"search-architecture\"/>) and explore the basic features in more detail. Two topics which were only briefly touched in this tutorial were analyzer configuration (<xref linkend=\"analyzer\"/>) and field bridges (<xref linkend=\"search-mapping-bridge\"/>), both important features required for more fine-grained indexing. More advanced topics cover clustering (<xref linkend=\"jms-backend\"/>) and large indexes handling (<xref linkend=\"search-configuration-directory-sharding\"/>)."
msgstr ""
-#. Tag: title
-#: getting-started.xml:392
-#, no-c-format
-msgid "Using the Maven archetype to create tutorial sources"
-msgstr ""
-
-#. Tag: programlisting
-#: getting-started.xml:394
-#, no-c-format
-msgid ""
- "mvn archetype:create \\ \n"
- " -DarchetypeGroupId=org.hibernate \\\n"
- " -DarchetypeArtifactId=hibernate-search-quickstart \\ \n"
- " -DarchetypeVersion=3.1.0.GA \\\n"
- " -DgroupId=my.company -DartifactId=quickstart"
-msgstr ""
-
-#. Tag: para
-#: getting-started.xml:397
-#, no-c-format
-msgid "Using the maven project you can execute the examples, inspect the file system based index and search and retrieve a list of managed objects. Just run <emphasis>mvn package</emphasis> to compile the sources and run the unit tests."
-msgstr ""
-
-#. Tag: para
-#: getting-started.xml:402
-#, no-c-format
-msgid "The next step after this tutorial is to get more familiar with the overall architecture of Hibernate Search (<xref linkend=\"search-architecture\"/>) and explore the basic features in more detail. Two topics which were only briefly touched in this tutorial were analyzer configuration (<xref linkend=\"analyzer\"/>) and field bridges (<xref linkend=\"search-mapping-bridge\"/>), both important features required for more fine-grained indexing. More advanced topics cover clustering (<xref linkend=\"jms-backend\"/>) and large indexes handling (<xref linkend=\"search-configuration-directory-sharding\"/>)."
-msgstr ""
-
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/lucene-native.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/lucene-native.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/lucene-native.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
@@ -258,3 +258,9 @@
"}</programlisting>As an example, let's assume it is not important how often a term appears in a document. Documents with a single occurrence of the term should be scored the same as documents with multiple occurrences. In this case your custom implementation of the method <methodname>tf(float freq)</methodname> should return 1.0."
msgstr ""
+#. Tag: para
+#: lucene-native.xml:196
+#, no-c-format
+msgid "When two entities share the same index they must declare the same <classname>Similarity</classname> implementation. Classes in the same class hierarchy always share the index, so it's not allowed to override the <classname>Similarity</classname> implementation in a subtype."
+msgstr ""
+
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/mapping.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/mapping.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/mapping.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 16:41+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
@@ -23,7 +23,7 @@
#. Tag: para
#: mapping.xml:32
#, no-c-format
-msgid "All the metadata information needed to index entities is described through annotations. There is no need for xml mapping files. In fact there is currently no xml configuration option available (see <ulink url=\"http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-210\">HSEARCH-210</ulink>). You can still use hibernate mapping files for the basic Hibernate configuration, but the Search specific configuration has to be expressed via annotations."
+msgid "All the metadata information needed to index entities is described through annotations. There is no need for xml mapping files. In fact there is currently no xml configuration option available (see <ulink url=\"http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-210\">HSEARCH-210</ulink>). You can still use Hibernate mapping files for the basic Hibernate configuration, but the Hibernate Search specific configuration has to be expressed via annotations."
msgstr ""
#. Tag: title
@@ -70,7 +70,7 @@
#. Tag: para
#: mapping.xml:70
#, no-c-format
-msgid "For each property (or attribute) of your entity, you have the ability to describe how it will be indexed. The default (no annotation present) means that the property is completely ignored by the indexing process. <literal>@Field</literal> does declare a property as indexed. When indexing an element to a Lucene document you can specify how it is indexed:"
+msgid "For each property (or attribute) of your entity, you have the ability to describe how it will be indexed. The default (no annotation present) means that the property is ignored by the indexing process. <literal>@Field</literal> does declare a property as indexed. When indexing an element to a Lucene document you can specify how it is indexed:"
msgstr ""
#. Tag: para
@@ -184,23 +184,29 @@
#. Tag: para
#: mapping.xml:178
#, no-c-format
-msgid "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 tokenizing a date field probably not. Note that fields used for sorting must not be tokenized."
+msgid "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 probably not a date field."
msgstr ""
#. Tag: para
-#: mapping.xml:184
+#: mapping.xml:182
#, no-c-format
+msgid "Fields used for sorting must not be tokenized."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:185
+#, no-c-format
msgid "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. If you are using Hibernate Annotations and you have specified @Id you can omit @DocumentId. The chosen entity id will also be used as document id."
msgstr ""
#. Tag: title
-#: mapping.xml:193
+#: mapping.xml:194
#, no-c-format
msgid "Adding <classname>@DocumentId</classname> ad <classname>@Field</classname> annotations to an indexed entity"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:196
+#: mapping.xml:197
#, no-c-format
msgid ""
"@Entity\n"
@@ -222,31 +228,31 @@
msgstr ""
#. Tag: para
-#: mapping.xml:199
+#: mapping.xml:200
#, no-c-format
-msgid "The above annotations define an index with three fields: <literal>id</literal> , <literal>Abstract</literal> and <literal>text</literal> . Note that by default the field name is decapitalized, following the JavaBean specification"
+msgid "define an index with three fields: <literal>id</literal> , <literal>Abstract</literal> and <literal>text</literal> . Note that by default the field name is decapitalized, following the JavaBean specification"
msgstr ""
#. Tag: title
-#: mapping.xml:206
+#: mapping.xml:207
#, no-c-format
msgid "Mapping properties multiple times"
msgstr ""
#. Tag: para
-#: mapping.xml:208
+#: mapping.xml:209
#, no-c-format
msgid "Sometimes one has to map a property multiple times per index, with slightly different indexing strategies. For example, sorting a query by field requires the field to be <literal>UN_TOKENIZED</literal>. If one wants to search by words in this property and still sort it, one need to index it twice - once tokenized and once untokenized. @Fields allows to achieve this goal."
msgstr ""
#. Tag: title
-#: mapping.xml:216
+#: mapping.xml:217
#, no-c-format
msgid "Using @Fields to map a property multiple times"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:218
+#: mapping.xml:219
#, no-c-format
msgid ""
"@Entity\n"
@@ -265,49 +271,49 @@
msgstr ""
#. Tag: para
-#: mapping.xml:221
+#: mapping.xml:222
#, no-c-format
-msgid "The field <literal>summary</literal> is indexed twice, once as <literal>summary</literal> in a tokenized way, and once as <literal>summary_forSort</literal> in an untokenized way. @Field supports 2 attributes useful when @Fields is used:"
+msgid "In <xref linkend=\"example-fields-annotation\"/> the field <literal>summary</literal> is indexed twice, once as <literal>summary</literal> in a tokenized way, and once as <literal>summary_forSort</literal> in an untokenized way. @Field supports 2 attributes useful when @Fields is used:"
msgstr ""
#. Tag: para
-#: mapping.xml:228
+#: mapping.xml:230
#, no-c-format
msgid "analyzer: defines a @Analyzer annotation per field rather than per property"
msgstr ""
#. Tag: para
-#: mapping.xml:233
+#: mapping.xml:235
#, no-c-format
msgid "bridge: defines a @FieldBridge annotation per field rather than per property"
msgstr ""
#. Tag: para
-#: mapping.xml:238
+#: mapping.xml:240
#, no-c-format
msgid "See below for more information about analyzers and field bridges."
msgstr ""
#. Tag: title
-#: mapping.xml:243
+#: mapping.xml:245
#, no-c-format
msgid "Embedded and associated objects"
msgstr ""
#. Tag: para
-#: mapping.xml:245
+#: mapping.xml:247
#, no-c-format
msgid "Associated objects as well as embedded objects can be indexed as part of the root entity index. This is useful if you expect to search a given entity based on properties of associated objects. In the following example the aim is to return places where the associated city is Atlanta (In the Lucene query parser language, it would translate into <code>address.city:Atlanta</code>)."
msgstr ""
#. Tag: title
-#: mapping.xml:253
+#: mapping.xml:255
#, no-c-format
msgid "Using @IndexedEmbedded to index associations"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:255
+#: mapping.xml:257
#, no-c-format
msgid ""
"@Entity\n"
@@ -347,37 +353,37 @@
msgstr ""
#. Tag: para
-#: mapping.xml:258
+#: mapping.xml:260
#, no-c-format
msgid "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. This is enabled by the <literal>@IndexedEmbedded</literal> annotation."
msgstr ""
#. Tag: para
-#: mapping.xml:265
+#: mapping.xml:267
#, no-c-format
msgid "Be careful. Because the data is denormalized in the Lucene index when using the <classname>@IndexedEmbedded</classname> technique, Hibernate Search needs to be aware of any change in the <classname>Place</classname> object and any change in the <classname>Address</classname> object to keep the index up to date. To make sure the <literal><classname>Place</classname></literal> Lucene document is updated when it's <classname>Address</classname> changes, you need to mark the other side of the bidirectional relationship with <classname>@ContainedIn</classname>."
msgstr ""
#. Tag: para
-#: mapping.xml:275
+#: mapping.xml:277
#, no-c-format
msgid "<literal>@ContainedIn</literal> is only useful on associations pointing to entities as opposed to embedded (collection of) objects."
msgstr ""
#. Tag: para
-#: mapping.xml:279
+#: mapping.xml:281
#, no-c-format
msgid "Let's make our example a bit more complex:"
msgstr ""
#. Tag: title
-#: mapping.xml:282
+#: mapping.xml:284
#, no-c-format
msgid "Nested usage of <classname>@IndexedEmbedded</classname> and <classname>@ContainedIn</classname>"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:285
+#: mapping.xml:287
#, no-c-format
msgid ""
"@Entity\n"
@@ -427,121 +433,121 @@
msgstr ""
#. Tag: para
-#: mapping.xml:288
+#: mapping.xml:290
#, no-c-format
msgid "Any <literal>@*ToMany, @*ToOne</literal> and <literal>@Embedded</literal> attribute can be annotated with <literal>@IndexedEmbedded</literal>. The attributes of the associated class will then be added to the main entity index. In the previous example, the index will contain the following fields"
msgstr ""
#. Tag: para
-#: mapping.xml:296
+#: mapping.xml:298
#, no-c-format
msgid "<para>id</para>"
msgstr ""
#. Tag: para
-#: mapping.xml:300
+#: mapping.xml:302
#, no-c-format
msgid "name"
msgstr ""
#. Tag: para
-#: mapping.xml:304
+#: mapping.xml:306
#, no-c-format
msgid "address.street"
msgstr ""
#. Tag: para
-#: mapping.xml:308
+#: mapping.xml:310
#, no-c-format
msgid "address.city"
msgstr ""
#. Tag: para
-#: mapping.xml:312
+#: mapping.xml:314
#, no-c-format
msgid "address.ownedBy_name"
msgstr ""
#. Tag: para
-#: mapping.xml:316
+#: mapping.xml:318
#, no-c-format
msgid "The default prefix is <literal>propertyName.</literal>, following the traditional object navigation convention. You can override it using the <literal>prefix</literal> attribute as it is shown on the <literal>ownedBy</literal> property."
msgstr ""
#. Tag: para
-#: mapping.xml:322
+#: mapping.xml:324
#, no-c-format
msgid "The prefix cannot be set to the empty string."
msgstr ""
#. Tag: para
-#: mapping.xml:325
+#: mapping.xml:327
#, no-c-format
msgid "The<literal> depth</literal> property is necessary when the object graph 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 attributes after reaching the expected depth (or the object graph boundaries are reached). A class having a self reference is an example of cyclic dependency. In our example, because <literal>depth</literal> is set to 1, any <literal>@IndexedEmbedded</literal> attribute in Owner (if any) will be ignored."
msgstr ""
#. Tag: para
-#: mapping.xml:336
+#: mapping.xml:338
#, no-c-format
msgid "Using <literal>@IndexedEmbedded</literal> for object associations allows you to express queries such as:"
msgstr ""
#. Tag: para
-#: mapping.xml:341
+#: mapping.xml:343
#, no-c-format
msgid "Return places where name contains JBoss and where address city is Atlanta. In Lucene query this would be"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:344
+#: mapping.xml:346
#, no-c-format
msgid "+name:jboss +address.city:atlanta"
msgstr ""
#. Tag: para
-#: mapping.xml:348
+#: mapping.xml:350
#, no-c-format
msgid "Return places where name contains JBoss and where owner's name contain Joe. In Lucene query this would be"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:351
+#: mapping.xml:353
#, no-c-format
msgid "+name:jboss +address.orderBy_name:joe"
msgstr ""
#. Tag: para
-#: mapping.xml:355
+#: mapping.xml:357
#, no-c-format
msgid "In a way it mimics the relational join operation in a more efficient way (at the cost of data duplication). Remember that, out of the box, Lucene indexes have no notion of association, the join operation is simply non-existent. It might help to keep the relational model normalized while benefiting from the full text index speed and feature richness."
msgstr ""
#. Tag: para
-#: mapping.xml:363
+#: mapping.xml:365
#, no-c-format
msgid "An associated object can itself (but does not have to) be <literal>@Indexed</literal>"
msgstr ""
#. Tag: para
-#: mapping.xml:367
+#: mapping.xml:369
#, no-c-format
msgid "When @IndexedEmbedded points to an entity, the association has to be directional and the other side has to be annotated <literal>@ContainedIn</literal> (as seen in the previous example). If not, Hibernate Search has no way to update the root index when the associated entity is updated (in our example, a <literal>Place</literal> index document has to be updated when the associated <classname>Address</classname> instance is updated)."
msgstr ""
#. Tag: para
-#: mapping.xml:375
+#: mapping.xml:377
#, no-c-format
msgid "Sometimes, the object type annotated by <classname>@IndexedEmbedded</classname> is not the object type targeted by Hibernate and Hibernate Search. This is especially the case when interfaces are used in lieu of their implementation. For this reason you can override the object type targeted by Hibernate Search using the <methodname>targetElement</methodname> parameter."
msgstr ""
#. Tag: title
-#: mapping.xml:383
+#: mapping.xml:385
#, no-c-format
msgid "Using the <literal>targetElement</literal> property of <classname>@IndexedEmbedded</classname>"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:386
+#: mapping.xml:388
#, no-c-format
msgid ""
"@Entity\n"
@@ -568,25 +574,25 @@
msgstr ""
#. Tag: title
-#: mapping.xml:391
+#: mapping.xml:393
#, no-c-format
msgid "Boost factor"
msgstr ""
#. Tag: para
-#: mapping.xml:393
+#: mapping.xml:395
#, no-c-format
msgid "Lucene has the notion of <emphasis>boost factor</emphasis>. It's a way to give more weight to a field or to an indexed element over others during the indexation process. You can use <literal>@Boost</literal> at the @Field, method or class level."
msgstr ""
#. Tag: title
-#: mapping.xml:399
+#: mapping.xml:401
#, no-c-format
msgid "Using different ways of increasing the weight of an indexed element using a boost factor"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:402
+#: mapping.xml:404
#, no-c-format
msgid ""
"@Entity\n"
@@ -615,37 +621,74 @@
msgstr ""
#. Tag: para
-#: mapping.xml:405
+#: mapping.xml:407
#, no-c-format
msgid "In our example, <classname>Essay</classname>'s probability to reach the top of the search list will be multiplied by 1.7. The <methodname>summary</methodname> field will be 3.0 (2 * 1.5 - <methodname>@Field.boost</methodname> and <classname>@Boost</classname> on a property are cumulative) more important than the <methodname>isbn</methodname> field. The <methodname>text</methodname> field will be 1.2 times more important than the <methodname>isbn</methodname> field. Note that this explanation in strictest terms is actually wrong, but it is simple and close enough to reality for all practical purposes. Please check the Lucene documentation or the excellent <citetitle>Lucene In Action </citetitle> from Otis Gospodnetic and Erik Hatcher."
msgstr ""
#. Tag: title
-#: mapping.xml:420
+#: mapping.xml:422
#, no-c-format
+msgid "Dynamic boost factor"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:424
+#, no-c-format
+msgid ""
+ "The <literal>@Boost </literal>annotation used in <xref linkend=\"section-boost-annotation\"/> defines a static boost factor which is is independent of the state of of the indexed entity at runtime. However, there are usecases in which the boost factor may depends on the actual state of the entity. In this case you can use the <literal>@DynamicBoost </literal>annotation together with an accompanying custom <classname>BoostStrategy</classname>.<example id=\"example-dynamic-boosting\"> <title>Dynamic boost examle</title> <programlisting>public enum PersonType {\n"
+ " NORMAL,\n"
+ " VIP\n"
+ "}\n"
+ "\n"
+ "@Entity\n"
+ "@Indexed\n"
+ "<emphasis role=\"bold\">@DynamicBoost(impl = VIPBoostStrategy.class)</emphasis>\n"
+ "public class Person {\n"
+ " private PersonType type; \n"
+ " \n"
+ " // ....\n"
+ "}\n"
+ "\n"
+ "public class VIPBoostStrategy implements BoostStrategy {\n"
+ " <emphasis role=\"bold\">public float defineBoost(Object value)</emphasis> {\n"
+ " Person person = ( Person ) value;\n"
+ " if ( person.getType().equals( PersonType.VIP ) ) {\n"
+ " return 2.0f;\n"
+ " }\n"
+ " else {\n"
+ " return 1.0f;\n"
+ " }\n"
+ " }\n"
+ "}</programlisting> </example>In <xref linkend=\"example-dynamic-boosting\"/> a dynamic boost is defined on class level specifying <classname>VIPBoostStrategy</classname> as implementation of the <classname>BoostStrategy</classname> interface to be used at indexing time. You can place the <literal>@DynamicBoost</literal> either at class or field level. Depending on the placement of the annotation either the whole entity is passed to the <methodname>defineBoost</methodname> method or just the annotated field/property value. It's up to you to cast the passed object to the correct type. In the example all indexed values of a VIP person would be double as important as the values of a normal person.<note> <para>The specified <classname>BoostStrategy</classname> implementation must define a public no-arg constructor.</para> </note>Of course you can mix and match <literal>@Boost</literal> and <literal>@DynamicBoost</literal> annotations in your entity. All defined boost fact!
ors are cummulative as described in <xref linkend=\"section-boost-annotation\"/>."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:455
+#, no-c-format
msgid "Analyzer"
msgstr ""
#. Tag: para
-#: mapping.xml:422
+#: mapping.xml:457
#, no-c-format
msgid "The default analyzer class used to index tokenized fields is configurable through the <literal>hibernate.search.analyzer</literal> property. The default value for this property is <classname>org.apache.lucene.analysis.standard.StandardAnalyzer</classname>."
msgstr ""
#. Tag: para
-#: mapping.xml:427
+#: mapping.xml:462
#, no-c-format
msgid "You can also define the analyzer class per entity, property and even per @Field (useful when multiple fields are indexed from a single property)."
msgstr ""
#. Tag: title
-#: mapping.xml:432
+#: mapping.xml:467
#, no-c-format
msgid "Different ways of specifying an analyzer"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:434
+#: mapping.xml:469
#, no-c-format
msgid ""
"@Entity\n"
@@ -672,64 +715,75 @@
msgstr ""
#. Tag: para
-#: mapping.xml:437
+#: mapping.xml:472
#, no-c-format
msgid "In this example, <classname>EntityAnalyzer</classname> is used to index all tokenized properties (eg. <literal>name</literal>), except <literal>summary</literal> and <literal>body</literal> which are indexed with <classname>PropertyAnalyzer</classname> and <classname>FieldAnalyzer</classname> respectively."
msgstr ""
#. Tag: para
-#: mapping.xml:444
+#: mapping.xml:479
#, no-c-format
msgid "Mixing different analyzers in the same entity is most of the time a bad practice. It makes query building more complex and results less predictable (for the novice), especially if you are using a QueryParser (which uses the same analyzer for the whole query). As a rule of thumb, for any given field the same analyzer should be used for indexing and querying."
msgstr ""
#. Tag: title
-#: mapping.xml:453
+#: mapping.xml:488
#, no-c-format
msgid "Analyzer definitions"
msgstr ""
#. Tag: para
-#: mapping.xml:455
+#: mapping.xml:490
#, no-c-format
msgid "Analyzers can become quite complex to deal with for which reason Hibernate Search introduces the notion of analyzer definitions. An analyzer definition can be reused by many <classname>@Analyzer</classname> declarations. An analyzer definition is composed of:"
msgstr ""
#. Tag: para
-#: mapping.xml:463
+#: mapping.xml:498
#, no-c-format
msgid "a name: the unique string used to refer to the definition"
msgstr ""
#. Tag: para
-#: mapping.xml:468
+#: mapping.xml:503
#, no-c-format
+msgid "a list of char filters: each char filter is responsible to pre-process input characters before the tokenization. Char filters can add, change or remove characters; one common usage is for characters normalization"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:509
+#, no-c-format
msgid "a tokenizer: responsible for tokenizing the input stream into individual words"
msgstr ""
#. Tag: para
-#: mapping.xml:473
+#: mapping.xml:514
#, no-c-format
msgid "a list of filters: each filter is responsible to remove, modify or sometimes even add words into the stream provided by the tokenizer"
msgstr ""
#. Tag: para
-#: mapping.xml:479
+#: mapping.xml:520
#, no-c-format
-msgid "This separation of tasks - a tokenizer followed by a list of filters - allows for easy reuse of each individual component and let you build your customized analyzer in a very flexible way (just like Lego). Generally speaking the <classname>Tokenizer</classname> starts the analysis process by turning the character input into tokens which are then further processed by the <classname>TokenFilter</classname>s. Hibernate Search supports this infrastructure by utilizing the Solr analyzer framework. Make sure to add<filename> solr-core.jar and </filename><filename>solr-common.jar</filename> to your classpath to use analyzer definitions. In case you also want to utilizing a snowball stemmer also include the <filename>lucene-snowball.jar.</filename> Other Solr analyzers might depend on more libraries. For example, the <classname>PhoneticFilterFactory</classname> depends on <ulink url=\"http://commons.apache.org/codec\">commons-codec</ulink>. Your distribution of Hibernate Sea!
rch provides these dependencies in its <filename>lib</filename> directory."
+msgid "This separation of tasks - a list of char filters, and a tokenizer followed by a list of filters - allows for easy reuse of each individual component and let you build your customized analyzer in a very flexible way (just like Lego). Generally speaking the <classname>char filters</classname> do some pre-processing in the character input, then the <classname>Tokenizer</classname> starts the tokenizing process by turning the character input into tokens which are then further processed by the <classname>TokenFilter</classname>s. Hibernate Search supports this infrastructure by utilizing the Solr analyzer framework. Make sure to add<filename> solr-core.jar and </filename><filename>solr-solrj.jar</filename> to your classpath to use analyzer definitions. In case you also want to use the snowball stemmer also include the <filename>lucene-snowball.jar.</filename> Other Solr analyzers might depend on more libraries. For example, the <classname>PhoneticFilterFactory</classname!
> depends on <ulink url=\"http://commons.apache.org/codec\">commons-codec</ulink>. Your distribution of Hibernate Search provides these dependencies in its <filename>lib</filename> directory."
msgstr ""
#. Tag: title
-#: mapping.xml:498
+#: mapping.xml:540
#, no-c-format
msgid "<classname>@AnalyzerDef</classname> and the Solr framework"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:501
+#: mapping.xml:543
#, no-c-format
msgid ""
"@AnalyzerDef(name=\"customanalyzer\",\n"
+ " charFilters = {\n"
+ " @CharFilterDef(factory = MappingCharFilterFactory.class, params = {\n"
+ " @Parameter(name = \"mapping\", value = \"org/hibernate/search/test/analyzer/solr/mapping-chars.properties\")\n"
+ " })\n"
+ " },\n"
" tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
" filters = {\n"
" @TokenFilterDef(factory = ISOLatin1AccentFilterFactory.class),\n"
@@ -745,31 +799,31 @@
msgstr ""
#. Tag: para
-#: mapping.xml:504
+#: mapping.xml:546
#, no-c-format
-msgid "A tokenizer is defined by its factory which is responsible for building the tokenizer and using the optional list of parameters. This example use the standard tokenizer. A filter is defined by its factory which is responsible for creating the filter instance using the optional parameters. In our example, the StopFilter filter is built reading the dedicated words property file and is expected to ignore case. The list of parameters is dependent on the tokenizer or filter factory."
+msgid "A char filter is defined by its factory which is responsible for building the char filter and using the optional list of parameters. In our example, a mapping char filter is used, and will replace characters in the input based on the rules specified in the mapping file. A tokenizer is also defined by its factory. This example use the standard tokenizer. A filter is defined by its factory which is responsible for creating the filter instance using the optional parameters. In our example, the StopFilter filter is built reading the dedicated words property file and is expected to ignore case. The list of parameters is dependent on the tokenizer or filter factory."
msgstr ""
#. Tag: para
-#: mapping.xml:514
+#: mapping.xml:559
#, no-c-format
-msgid "Filters are applied in the order they are defined in the <classname>@AnalyzerDef</classname> annotation. Make sure to think twice about this order."
+msgid "Filters and char filters are applied in the order they are defined in the <classname>@AnalyzerDef</classname> annotation. Make sure to think twice about this order."
msgstr ""
#. Tag: para
-#: mapping.xml:519
+#: mapping.xml:564
#, no-c-format
msgid "Once defined, an analyzer definition can be reused by an <classname>@Analyzer</classname> declaration using the definition name rather than declaring an implementation class."
msgstr ""
#. Tag: title
-#: mapping.xml:524
+#: mapping.xml:569
#, no-c-format
msgid "Referencing an analyzer by name"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:526
+#: mapping.xml:571
#, no-c-format
msgid ""
"@Entity\n"
@@ -793,205 +847,250 @@
msgstr ""
#. Tag: para
-#: mapping.xml:529
+#: mapping.xml:574
#, no-c-format
msgid "Analyzer instances declared by <classname>@AnalyzerDef</classname> are available by their name in the <classname>SearchFactory</classname>."
msgstr ""
#. Tag: programlisting
-#: mapping.xml:533
+#: mapping.xml:578
#, no-c-format
msgid "Analyzer analyzer = fullTextSession.getSearchFactory().getAnalyzer(\"customanalyzer\");"
msgstr ""
#. Tag: para
-#: mapping.xml:535
+#: mapping.xml:580
#, no-c-format
msgid "This is quite useful wen building queries. Fields in queries should be analyzed with the same analyzer used to index the field so that they speak a common \"language\": the same tokens are reused between the query and the indexing process. This rule has some exceptions but is true most of the time. Respect it unless you know what you are doing."
msgstr ""
#. Tag: title
-#: mapping.xml:544
+#: mapping.xml:589
#, no-c-format
msgid "Available analyzers"
msgstr ""
#. Tag: para
-#: mapping.xml:546
+#: mapping.xml:591
#, no-c-format
-msgid "Solr and Lucene come with a lot of useful default tokenizers and filters. You can find a complete list of tokenizer factories and filter factories at <ulink url=\"http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters\">http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters</ulink>. Let check a few of them."
+msgid "Solr and Lucene come with a lot of useful default char filters, tokenizers and filters. You can find a complete list of char filter factories, tokenizer factories and filter factories at <ulink url=\"http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters\">http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters</ulink>. Let check a few of them."
msgstr ""
#. Tag: title
-#: mapping.xml:553
+#: mapping.xml:598
#, no-c-format
-msgid "Some of the available tokenizers"
+msgid "Some of the available char filters"
msgstr ""
#. Tag: entry
-#: mapping.xml:558 mapping.xml:593
+#: mapping.xml:602 mapping.xml:639 mapping.xml:674
#, no-c-format
msgid "Factory"
msgstr ""
#. Tag: entry
-#: mapping.xml:560 mapping.xml:595
+#: mapping.xml:604 mapping.xml:641 mapping.xml:676
#, no-c-format
msgid "Description"
msgstr ""
#. Tag: entry
-#: mapping.xml:562 mapping.xml:597
+#: mapping.xml:606 mapping.xml:643 mapping.xml:678
#, no-c-format
msgid "parameters"
msgstr ""
#. Tag: entry
-#: mapping.xml:568
+#: mapping.xml:611
#, no-c-format
-msgid "StandardTokenizerFactory"
+msgid "MappingCharFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:570
+#: mapping.xml:613
#, no-c-format
-msgid "Use the Lucene StandardTokenizer"
+msgid "Replaces one or more characters with one or more characters, based on mappings specified in the resource file"
msgstr ""
+#. Tag: para
+#: mapping.xml:616
+#, no-c-format
+msgid "<literal>mapping</literal>: points to a resource file containing the mappings using the format:"
+msgstr ""
+
+#. Tag: literallayout
+#: mapping.xml:618
+#, no-c-format
+msgid ""
+ "\"á\" => \"a\"\n"
+ " \"ñ\" => \"n\"\n"
+ " \"ø\" => \"o\""
+msgstr ""
+
#. Tag: entry
-#: mapping.xml:572 mapping.xml:581 mapping.xml:607 mapping.xml:615 mapping.xml:647
+#: mapping.xml:622
#, no-c-format
+msgid "HTMLStripCharFilterFactory"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:624
+#, no-c-format
+msgid "Remove HTML standard tags, keeping the text"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:626 mapping.xml:653 mapping.xml:662 mapping.xml:688 mapping.xml:696 mapping.xml:728
+#, no-c-format
msgid "none"
msgstr ""
+#. Tag: title
+#: mapping.xml:634
+#, no-c-format
+msgid "Some of the available tokenizers"
+msgstr ""
+
#. Tag: entry
-#: mapping.xml:576
+#: mapping.xml:649
#, no-c-format
+msgid "StandardTokenizerFactory"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:651
+#, no-c-format
+msgid "Use the Lucene StandardTokenizer"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:657
+#, no-c-format
msgid "HTMLStripStandardTokenizerFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:578
+#: mapping.xml:659
#, no-c-format
-msgid "Remove HTML tags, keep the text and pass it to a StandardTokenizer"
+msgid "Remove HTML tags, keep the text and pass it to a StandardTokenizer. @Deprecated, use the HTMLStripCharFilterFactory instead"
msgstr ""
#. Tag: title
-#: mapping.xml:588
+#: mapping.xml:669
#, no-c-format
msgid "Some of the available filters"
msgstr ""
#. Tag: entry
-#: mapping.xml:603
+#: mapping.xml:684
#, no-c-format
msgid "StandardFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:605
+#: mapping.xml:686
#, no-c-format
msgid "Remove dots from acronyms and 's from words"
msgstr ""
#. Tag: entry
-#: mapping.xml:611
+#: mapping.xml:692
#, no-c-format
msgid "LowerCaseFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:613
+#: mapping.xml:694
#, no-c-format
msgid "Lowercase words"
msgstr ""
#. Tag: entry
-#: mapping.xml:619
+#: mapping.xml:700
#, no-c-format
msgid "StopFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:621
+#: mapping.xml:702
#, no-c-format
msgid "remove words (tokens) matching a list of stop words"
msgstr ""
#. Tag: para
-#: mapping.xml:624
+#: mapping.xml:705
#, no-c-format
msgid "<literal>words</literal>: points to a resource file containing the stop words"
msgstr ""
#. Tag: para
-#: mapping.xml:625
+#: mapping.xml:706
#, no-c-format
msgid "ignoreCase: true if <literal>case</literal> should be ignore when comparing stop words, <literal>false</literal> otherwise"
msgstr ""
#. Tag: entry
-#: mapping.xml:631
+#: mapping.xml:712
#, no-c-format
msgid "SnowballPorterFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:633
+#: mapping.xml:714
#, no-c-format
msgid "Reduces a word to it's root in a given language. (eg. protect, protects, protection share the same root). Using such a filter allows searches matching related words."
msgstr ""
#. Tag: entry
-#: mapping.xml:637
+#: mapping.xml:718
#, no-c-format
msgid "<literal>language</literal>: Danish, Dutch, English, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, Swedish and a few more"
msgstr ""
#. Tag: entry
-#: mapping.xml:643
+#: mapping.xml:724
#, no-c-format
msgid "ISOLatin1AccentFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:645
+#: mapping.xml:726
#, no-c-format
msgid "remove accents for languages like French"
msgstr ""
#. Tag: para
-#: mapping.xml:653
+#: mapping.xml:734
#, no-c-format
msgid "We recommend to check all the implementations of <classname>org.apache.solr.analysis.TokenizerFactory</classname> and <classname>org.apache.solr.analysis.TokenFilterFactory</classname> in your IDE to see the implementations available."
msgstr ""
#. Tag: title
-#: mapping.xml:660
+#: mapping.xml:741
#, no-c-format
msgid "Analyzer discriminator (experimental)"
msgstr ""
#. Tag: para
-#: mapping.xml:662
+#: mapping.xml:743
#, no-c-format
-msgid "So far all the introduced ways to specify an analyzer were static. However, there are use cases where it is useful to select an analyzer depending on the current state of the entity to be indexed, for example in multilingual application. For an <classname>BlogEntry</classname> class for example the analyzer could depend on the language property of the entry. Depending on this property the correct language specific stemmer should be chosen to index the actual text."
+msgid "So far all the introduced ways to specify an analyzer were static. However, there are use cases where it is useful to select an analyzer depending on the current state of the entity to be indexed, for example in multilingual applications. For an <classname>BlogEntry</classname> class for example the analyzer could depend on the language property of the entry. Depending on this property the correct language specific stemmer should be chosen to index the actual text."
msgstr ""
#. Tag: para
-#: mapping.xml:671
+#: mapping.xml:752
#, no-c-format
msgid "To enable this dynamic analyzer selection Hibernate Search introduces the <classname>AnalyzerDiscriminator</classname> annotation. The following example demonstrates the usage of this annotation:"
msgstr ""
#. Tag: title
-#: mapping.xml:677
+#: mapping.xml:758
#, no-c-format
msgid "Usage of @AnalyzerDiscriminator in order to select an analyzer depending on the entity state"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:680
+#: mapping.xml:761
#, no-c-format
msgid ""
"@Entity\n"
@@ -1033,7 +1132,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:682
+#: mapping.xml:763
#, no-c-format
msgid ""
"public class LanguageDiscriminator implements Discriminator {\n"
@@ -1048,55 +1147,55 @@
msgstr ""
#. Tag: para
-#: mapping.xml:685
+#: mapping.xml:766
#, no-c-format
msgid "The prerequisite for using <classname>@AnalyzerDiscriminator</classname> is that all analyzers which are going to be used are predefined via <classname>@AnalyzerDef</classname> definitions. If this is the case one can place the <classname>@AnalyzerDiscriminator</classname> annotation either on the class or on a specific property of the entity for which to dynamically select an analyzer. Via the <literal>impl</literal> parameter of the <classname>AnalyzerDiscriminator</classname> you specify a concrete implementation of the <classname>Discriminator</classname> interface. It is up to you to provide an implementation for this interface. The only method you have to implement is <classname>getAnalyzerDefinitionName()</classname> which gets called for each field added to the Lucene document. The entity which is getting indexed is also passed to the interface method. The <literal>value</literal> parameter is only set if the <classname>AnalyzerDiscriminator</classname> is pl!
aced on property level instead of class level. In this case the value represents the current value of this property."
msgstr ""
#. Tag: para
-#: mapping.xml:705
+#: mapping.xml:786
#, no-c-format
msgid "An implemention of the <classname>Discriminator</classname> interface has to return the name of an existing analyzer definition if the analyzer should be set dynamically or <classname>null</classname> if the default analyzer should not be overridden. The given example assumes that the language parameter is either 'de' or 'en' which matches the specified names in the <classname>@AnalyzerDef</classname>s."
msgstr ""
#. Tag: para
-#: mapping.xml:714
+#: mapping.xml:795
#, no-c-format
msgid "The <classname>@AnalyzerDiscriminator</classname> is currently still experimental and the API might still change. We are hoping for some feedback from the community about the usefulness and usability of this feature."
msgstr ""
#. Tag: title
-#: mapping.xml:722
+#: mapping.xml:803
#, no-c-format
msgid "Retrieving an analyzer"
msgstr ""
#. Tag: para
-#: mapping.xml:724
+#: mapping.xml:805
#, no-c-format
msgid "During indexing time, Hibernate Search is using analyzers under the hood for you. In some situations, retrieving analyzers can be handy. If your domain model makes use of multiple analyzers (maybe to benefit from stemming, use phonetic approximation and so on), you need to make sure to use the same analyzers when you build your query."
msgstr ""
#. Tag: para
-#: mapping.xml:732
+#: mapping.xml:813
#, no-c-format
msgid "This rule can be broken but you need a good reason for it. If you are unsure, use the same analyzers."
msgstr ""
#. Tag: para
-#: mapping.xml:736
+#: mapping.xml:817
#, no-c-format
msgid "You can retrieve the scoped analyzer for a given entity used at indexing time by Hibernate Search. A scoped analyzer is an analyzer which applies the right analyzers depending on the field indexed: multiple analyzers can be defined on a given entity each one working on an individual field, a scoped analyzer unify all these analyzers into a context-aware analyzer. While the theory seems a bit complex, using the right analyzer in a query is very easy."
msgstr ""
#. Tag: title
-#: mapping.xml:745
+#: mapping.xml:826
#, no-c-format
msgid "Using the scoped analyzer when building a full-text query"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:748
+#: mapping.xml:829
#, no-c-format
msgid ""
"org.apache.lucene.queryParser.QueryParser parser = new QueryParser(\n"
@@ -1114,109 +1213,109 @@
msgstr ""
#. Tag: para
-#: mapping.xml:751
+#: mapping.xml:832
#, no-c-format
msgid "In the example above, the song title is indexed in two fields: the standard analyzer is used in the field <literal>title</literal> and a stemming analyzer is used in the field <literal>title_stemmed</literal>. By using the analyzer provided by the search factory, the query uses the appropriate analyzer depending on the field targeted."
msgstr ""
#. Tag: para
-#: mapping.xml:758
+#: mapping.xml:839
#, no-c-format
msgid "If your query targets more that one query and you wish to use your standard analyzer, make sure to describe it using an analyzer definition. You can retrieve analyzers by their definition name using <code>searchFactory.getAnalyzer(String)</code>."
msgstr ""
#. Tag: title
-#: mapping.xml:767
+#: mapping.xml:848
#, no-c-format
msgid "Property/Field Bridge"
msgstr ""
#. Tag: para
-#: mapping.xml:769
+#: mapping.xml:850
#, no-c-format
msgid "In Lucene all index fields have to be represented as Strings. For this reason all entity properties annotated with <literal>@Field</literal> 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 more fine grain control over the translation process."
msgstr ""
#. Tag: title
-#: mapping.xml:777
+#: mapping.xml:858
#, no-c-format
msgid "Built-in bridges"
msgstr ""
#. Tag: para
-#: mapping.xml:779
+#: mapping.xml:860
#, no-c-format
msgid "Hibernate Search comes bundled with a set of built-in bridges between a Java property type and its full text representation."
msgstr ""
#. Tag: term
-#: mapping.xml:784
+#: mapping.xml:865
#, no-c-format
msgid "null"
msgstr ""
#. Tag: para
-#: mapping.xml:787
+#: mapping.xml:868
#, no-c-format
msgid "null elements are not indexed. Lucene does not support null elements and this does not make much sense either."
msgstr ""
#. Tag: term
-#: mapping.xml:793
+#: mapping.xml:874
#, no-c-format
msgid "java.lang.String"
msgstr ""
#. Tag: para
-#: mapping.xml:796
+#: mapping.xml:877
#, no-c-format
msgid "String are indexed as is"
msgstr ""
#. Tag: term
-#: mapping.xml:801
+#: mapping.xml:882
#, no-c-format
msgid "short, Short, integer, Integer, long, Long, float, Float, double, Double, BigInteger, BigDecimal"
msgstr ""
#. Tag: para
-#: mapping.xml:805
+#: mapping.xml:886
#, no-c-format
msgid "Numbers are converted in their String representation. Note that numbers cannot be compared by Lucene (ie used in ranged queries) out of the box: they have to be padded"
msgstr ""
#. Tag: para
-#: mapping.xml:808
+#: mapping.xml:889
#, no-c-format
msgid "Using a Range query is debatable and has drawbacks, an alternative approach is to use a Filter query which will filter the result query to the appropriate range."
msgstr ""
#. Tag: para
-#: mapping.xml:812
+#: mapping.xml:893
#, no-c-format
msgid "Hibernate Search will support a padding mechanism"
msgstr ""
#. Tag: term
-#: mapping.xml:818
+#: mapping.xml:899
#, no-c-format
msgid "java.util.Date"
msgstr ""
#. Tag: para
-#: mapping.xml:821
+#: mapping.xml:902
#, no-c-format
msgid "Dates are stored as yyyyMMddHHmmssSSS in GMT time (200611072203012 for Nov 7th of 2006 4:03PM and 12ms EST). You shouldn't really bother with the internal format. What is important is that when using a DateRange Query, you should know that the dates have to be expressed in GMT time."
msgstr ""
#. Tag: para
-#: mapping.xml:827
+#: mapping.xml:908
#, no-c-format
msgid "Usually, storing the date up to the millisecond is not necessary. <literal>@DateBridge</literal> defines the appropriate resolution you are willing to store in the index ( <literal> <literal>@DateBridge(resolution=Resolution.DAY)</literal> </literal> ). The date pattern will then be truncated accordingly."
msgstr ""
#. Tag: programlisting
-#: mapping.xml:834
+#: mapping.xml:915
#, no-c-format
msgid ""
"@Entity \n"
@@ -1229,67 +1328,67 @@
msgstr ""
#. Tag: para
-#: mapping.xml:837
+#: mapping.xml:918
#, no-c-format
msgid "A Date whose resolution is lower than <literal>MILLISECOND</literal> cannot be a <literal>@DocumentId</literal>"
msgstr ""
#. Tag: term
-#: mapping.xml:845
+#: mapping.xml:926
#, no-c-format
msgid "java.net.URI, java.net.URL"
msgstr ""
#. Tag: para
-#: mapping.xml:848
+#: mapping.xml:929
#, no-c-format
msgid "URI and URL are converted to their string representation"
msgstr ""
#. Tag: term
-#: mapping.xml:854
+#: mapping.xml:935
#, no-c-format
msgid "java.lang.Class"
msgstr ""
#. Tag: para
-#: mapping.xml:857
+#: mapping.xml:938
#, no-c-format
msgid "Class are converted to their fully qualified class name. The thread context classloader is used when the class is rehydrated"
msgstr ""
#. Tag: title
-#: mapping.xml:866
+#: mapping.xml:947
#, no-c-format
msgid "Custom Bridge"
msgstr ""
#. Tag: para
-#: mapping.xml:868
+#: mapping.xml:949
#, no-c-format
msgid "Sometimes, the built-in bridges of Hibernate Search do not cover some of your property types, or the String representation used by the bridge does not meet your requirements. The following paragraphs describe several solutions to this problem."
msgstr ""
#. Tag: title
-#: mapping.xml:874
+#: mapping.xml:955
#, no-c-format
msgid "StringBridge"
msgstr ""
#. Tag: para
-#: mapping.xml:876
+#: mapping.xml:957
#, no-c-format
msgid "The simplest custom solution is to give Hibernate Search an implementation of your expected <emphasis><classname>Object</classname> </emphasis>to <classname>String</classname> bridge. To do so you need to implements the <literal>org.hibernate.search.bridge.StringBridge</literal> interface. All implementations have to be thread-safe as they are used concurrently."
msgstr ""
#. Tag: title
-#: mapping.xml:885
+#: mapping.xml:966
#, no-c-format
msgid "Implementing your own <classname>StringBridge</classname>"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:888
+#: mapping.xml:969
#, no-c-format
msgid ""
"/**\n"
@@ -1316,13 +1415,13 @@
msgstr ""
#. Tag: para
-#: mapping.xml:891
+#: mapping.xml:972
#, no-c-format
msgid "Then any property or field can use this bridge thanks to the <literal>@FieldBridge</literal> annotation"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:894
+#: mapping.xml:975
#, no-c-format
msgid ""
"<emphasis role=\"bold\">@FieldBridge(impl = PaddedIntegerBridge.class)</emphasis>\n"
@@ -1330,19 +1429,19 @@
msgstr ""
#. Tag: para
-#: mapping.xml:896
+#: mapping.xml:977
#, no-c-format
msgid "Parameters can be passed to the Bridge implementation making it more flexible. The Bridge implementation implements a <classname>ParameterizedBridge</classname> interface, and the parameters are passed through the <literal>@FieldBridge</literal> annotation."
msgstr ""
#. Tag: title
-#: mapping.xml:903
+#: mapping.xml:984
#, no-c-format
msgid "Passing parameters to your bridge implementation"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:905
+#: mapping.xml:986
#, no-c-format
msgid ""
"public class PaddedIntegerBridge implements StringBridge, <emphasis\n"
@@ -1377,31 +1476,31 @@
msgstr ""
#. Tag: para
-#: mapping.xml:908
+#: mapping.xml:989
#, no-c-format
msgid "The <classname>ParameterizedBridge</classname> interface can be implemented by <classname>StringBridge</classname>, <classname>TwoWayStringBridge</classname>, <classname>FieldBridge</classname> implementations."
msgstr ""
#. Tag: para
-#: mapping.xml:913
+#: mapping.xml:994
#, no-c-format
msgid "All implementations have to be thread-safe, but the parameters are set during initialization and no special care is required at this stage."
msgstr ""
#. Tag: para
-#: mapping.xml:917
+#: mapping.xml:998
#, no-c-format
-msgid "If you expect to use your bridge implementation on an id property (ie annotated with <literal>@DocumentId</literal> ), you need to use a slightly extended version of <literal>StringBridge</literal> named <classname>TwoWayStringBridge</classname>. Hibernate Search needs to read the string representation of the identifier and generate the object out of it. There is not difference in the way the <literal>@FieldBridge</literal> annotation is used."
+msgid "If you expect to use your bridge implementation on an id property (ie annotated with <literal>@DocumentId</literal> ), you need to use a slightly extended version of <literal>StringBridge</literal> named <classname>TwoWayStringBridge</classname>. Hibernate Search needs to read the string representation of the identifier and generate the object out of it. There is no difference in the way the <literal>@FieldBridge</literal> annotation is used."
msgstr ""
#. Tag: title
-#: mapping.xml:926
+#: mapping.xml:1007
#, no-c-format
msgid "Implementing a TwoWayStringBridge which can for example be used for id properties"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:929
+#: mapping.xml:1010
#, no-c-format
msgid ""
"public class PaddedIntegerBridge implements TwoWayStringBridge, ParameterizedBridge {\n"
@@ -1439,43 +1538,42 @@
msgstr ""
#. Tag: para
-#: mapping.xml:932
+#: mapping.xml:1013
#, no-c-format
msgid "It is critically important for the two-way process to be idempotent (ie object = stringToObject( objectToString( object ) ) )."
msgstr ""
#. Tag: title
-#: mapping.xml:938
+#: mapping.xml:1019
#, no-c-format
msgid "FieldBridge"
msgstr ""
#. Tag: para
-#: mapping.xml:940
+#: mapping.xml:1021
#, no-c-format
-msgid "Some use cases require more than a simple object to string translation when mapping a property to a Lucene index. To give you the greatest possible flexibility you can also implement a bridge as a <classname>FieldBridge</classname>. This interface gives you a property value and let you map it the way you want in your Lucene <classname>Document</classname>.The interface is very similar in its concept to the Hibernate<classname> UserType</classname>s."
+msgid "Some use cases require more than a simple object to string translation when mapping a property to a Lucene index. To give you the greatest possible flexibility you can also implement a bridge as a <classname>FieldBridge</classname>. This interface gives you a property value and let you map it the way you want in your Lucene <classname>Document</classname>. The interface is very similar in its concept to the Hibernate <classname>UserType</classname>s."
msgstr ""
#. Tag: para
-#: mapping.xml:948
+#: mapping.xml:1029
#, no-c-format
msgid "You can for example store a given property in two different document fields:"
msgstr ""
#. Tag: title
-#: mapping.xml:952
+#: mapping.xml:1033
#, no-c-format
msgid "Implementing the FieldBridge interface in order to a given property into multiple document fields"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:955
+#: mapping.xml:1036
#, no-c-format
msgid ""
"/**\n"
" * Store the date in 3 different fields - year, month, day - to ease Range Query per\n"
" * year, month or day (eg get all the elements of December for the last 5 years).\n"
- " * \n"
" * @author Emmanuel Bernard\n"
" */\n"
"public class DateSplitBridge implements FieldBridge {\n"
@@ -1491,25 +1589,22 @@
" int day = cal.get(Calendar.DAY_OF_MONTH);\n"
" \n"
" // set year\n"
- " Field field = new Field(name + \".year\", String.valueOf(year),\n"
- " luceneOptions.getStore(), luceneOptions.getIndex(),\n"
- " luceneOptions.getTermVector());\n"
- " field.setBoost(luceneOptions.getBoost());\n"
- " document.add(field);\n"
+ " luceneOptions.addFieldToDocument(\n"
+ " name + \".year\",\n"
+ " String.valueOf( year ),\n"
+ " document );\n"
" \n"
" // set month and pad it if needed\n"
- " field = new Field(name + \".month\", month < 10 ? \"0\" : \"\"\n"
- " + String.valueOf(month), luceneOptions.getStore(),\n"
- " luceneOptions.getIndex(), luceneOptions.getTermVector());\n"
- " field.setBoost(luceneOptions.getBoost());\n"
- " document.add(field);\n"
+ " luceneOptions.addFieldToDocument(\n"
+ " name + \".month\",\n"
+ " month < 10 ? \"0\" : \"\" + String.valueOf( month ),\n"
+ " document );\n"
" \n"
" // set day and pad it if needed\n"
- " field = new Field(name + \".day\", day < 10 ? \"0\" : \"\"\n"
- " + String.valueOf(day), luceneOptions.getStore(),\n"
- " luceneOptions.getIndex(), luceneOptions.getTermVector());\n"
- " field.setBoost(luceneOptions.getBoost());\n"
- " document.add(field);\n"
+ " luceneOptions.addFieldToDocument(\n"
+ " name + \".day\",\n"
+ " day < 10 ? \"0\" : \"\" + String.valueOf( day ),\n"
+ " document );\n"
" }\n"
"}\n"
"\n"
@@ -1518,26 +1613,38 @@
"private Date date;"
msgstr ""
+#. Tag: para
+#: mapping.xml:1039
+#, no-c-format
+msgid "In the previous example the fields where not added directly to Document but we where delegating this task to the <classname>LuceneOptions</classname> helper; this will apply the options you have selected on <literal>@Field</literal>, like <literal>Store</literal> or <literal>TermVector</literal> options, or apply the choosen <classname>@Boost</classname> value. It is especially useful to encapsulate the complexity of <literal>COMPRESS</literal> implementations so it's recommended to delegate to <classname>LuceneOptions</classname> to add fields to the <classname>Document</classname>, but nothing stops you from editing the <classname>Document</classname> directly and ignore the <classname>LuceneOptions</classname> in case you need to."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1048
+#, no-c-format
+msgid "Classes like <classname>LuceneOptions</classname> are created to shield your application from changes in Lucene API and simplify your code. Use them if you can, but if you need more flexibility you're not required to."
+msgstr ""
+
#. Tag: title
-#: mapping.xml:960
+#: mapping.xml:1055
#, no-c-format
msgid "ClassBridge"
msgstr ""
#. Tag: para
-#: mapping.xml:962
+#: mapping.xml:1057
#, no-c-format
msgid "It is sometimes useful to combine more than one property of a given entity and index this combination in a specific way into the Lucene index. The <classname>@ClassBridge</classname> and <classname>@ClassBridge</classname> annotations can be defined at the class level (as opposed to the property level). In this case the custom field bridge implementation receives the entity instance as the value parameter instead of a particular property. Though not shown in this example, <classname>@ClassBridge</classname> supports the <methodname>termVector</methodname> attribute discussed in section <xref linkend=\"basic-mapping\"/>."
msgstr ""
#. Tag: title
-#: mapping.xml:974
+#: mapping.xml:1069
#, no-c-format
msgid "Implementing a class bridge"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:976
+#: mapping.xml:1071
#, no-c-format
msgid ""
"@Entity\n"
@@ -1556,7 +1663,6 @@
" ...\n"
"}\n"
"\n"
- "\n"
"public class CatFieldsClassBridge implements FieldBridge, ParameterizedBridge {\n"
" private String sepChar;\n"
"\n"
@@ -1587,43 +1693,43 @@
msgstr ""
#. Tag: para
-#: mapping.xml:979
+#: mapping.xml:1074
#, no-c-format
msgid "In this example, the particular <classname>CatFieldsClassBridge</classname> is applied to the <literal>department</literal> instance, the field bridge then concatenate both branch and network and index the concatenation."
msgstr ""
#. Tag: title
-#: mapping.xml:989 mapping.xml:1014
+#: mapping.xml:1084 mapping.xml:1109
#, no-c-format
msgid "Providing your own id"
msgstr ""
#. Tag: para
-#: mapping.xml:992
+#: mapping.xml:1087
#, no-c-format
msgid "This part of the documentation is a work in progress."
msgstr ""
#. Tag: para
-#: mapping.xml:995
+#: mapping.xml:1090
#, no-c-format
msgid "You can provide your own id for Hibernate Search if you are extending the internals. You will have to generate a unique value so it can be given to Lucene to be indexed. This will have to be given to Hibernate Search when you create an org.hibernate.search.Work object - the document id is required in the constructor."
msgstr ""
#. Tag: title
-#: mapping.xml:1002
+#: mapping.xml:1097
#, no-c-format
msgid "The ProvidedId annotation"
msgstr ""
#. Tag: para
-#: mapping.xml:1004
+#: mapping.xml:1099
#, no-c-format
msgid "Unlike conventional Hibernate Search API and @DocumentId, this annotation is used on the class and not a field. You also can provide your own bridge implementation when you put in this annotation by calling the bridge() which is on @ProvidedId. Also, if you annotate a class with @ProvidedId, your subclasses will also get the annotation - but it is not done by using the java.lang.annotations.@Inherited. Be sure however, to <emphasis>not</emphasis> use this annotation with @DocumentId as your system will break."
msgstr ""
#. Tag: programlisting
-#: mapping.xml:1016
+#: mapping.xml:1111
#, no-c-format
msgid ""
"@ProvidedId (bridge = org.my.own.package.MyCustomBridge)\n"
@@ -1635,3 +1741,992 @@
"}"
msgstr ""
+#. Tag: title
+#: mapping.xml:1117
+#, no-c-format
+msgid "Programmatic API"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1120
+#, no-c-format
+msgid "This feature is considered experimental. While stable code-wise, the API is subject to change in the future."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1121
+#, no-c-format
+msgid "Although the recommended approach for mapping indexed entities is to use annotations, it is sometimes more convenient to use a different approach:"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1128
+#, no-c-format
+msgid "the same entity is mapped differently depending on deployment needs (customization for clients)"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1133
+#, no-c-format
+msgid "some automatization process requires the dynamic mapping of many entities sharing a common traits"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1138
+#, no-c-format
+msgid "While it has been a popular demand in the past, the Hibernate team never found the idea of an XML alternative to annotations appealing due to it's heavy duplication, lack of code refactoring safety, because it did not cover all the use case spectrum and because we are in the 21st century :)"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1144
+#, no-c-format
+msgid "Th idea of a programmatic API was much more appealing and has now become a reality. You can programmatically and safely define your mapping using a programmatic API: you define entities and fields as indexable by using mapping classes which effectively mirror the annotation concepts in Hibernate Search. Note that fan(s) of XML approach can design their own schema and use the programmatic API to create the mapping while parsing the XML stream."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1152
+#, no-c-format
+msgid "In order to use the programmatic model you must first construct a <classname>SearchMapping</classname> object. This object is passed to Hibernate Search via a property set to the <classname>Configuration </classname>object. The property key is <literal>hibernate.search.model_mapping</literal> or it's type-safe representation <classname>Environment.MODEL_MAPPING</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1159
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "[...]\n"
+ "configuration.setProperty( Environment.MODEL_MAPPING, mapping );\n"
+ "\n"
+ "//or in JPA\n"
+ "SearchMapping mapping = new SearchMapping();\n"
+ "[...]\n"
+ "Map<String,String> properties = new HashMap<String,String)(1);\n"
+ "properties.put( Environment.MODEL_MAPPING, mapping );\n"
+ "EntityManagerFactory emf = Persistence.createEntityManagerFactory( \"userPU\", properties );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1161
+#, no-c-format
+msgid "The <classname>SearchMapping</classname> is the root object which contains all the necessary indexable entities and fields. From there, the <classname>SearchMapping</classname> object exposes a fluent (and thus intuitive) API to express your mappings: it contextually exposes the relevant mapping options in a type-safe way, just let your IDE autocompletion feature guide you through."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1168
+#, no-c-format
+msgid "Today, the programmatic API cannot be used on a class annotated with Hibernate Search annotations, chose one approach or the other. Also note that the same default values apply in annotations and the programmatic API. For example, the <methodname>@Field.name</methodname> is defaulted to the property name and does not have to be set."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1174
+#, no-c-format
+msgid "Each core concept of the programmatic API has a corresponding example to depict how the same definition would look using annotation. Therefore seeing an annotation example of the programmatic approach should give you a clear picture of what Hibernate Search will build with the marked entities and associated properties."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1181
+#, no-c-format
+msgid "Mapping an entity as indexable"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1183
+#, no-c-format
+msgid "The first concept of the programmatic API is to define an entity as indexable. Using the annotation approach a user would mark the entity as <classname>@Indexed</classname>, the following example demonstrates how to programmatically achieve this."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1189
+#, no-c-format
+msgid "Marking an entity indexable"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1191
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping.entity(Address.class)\n"
+ " .indexed()\n"
+ " .indexName(\"Address_Index\"); //optional\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1193
+#, no-c-format
+msgid "As you can see you must first create a <classname>SearchMapping</classname> object which is the root object that is then passed to the <classname>Configuration</classname> object as property. You must declare an entity and if you wish to make that entity as indexable then you must call the <methodname>indexed()</methodname> method. The <methodname>indexed() </methodname>method has an optional <methodname>indexName(String indexName)</methodname> which can be used to change the default index name that is created by Hibernate Search. Using the annotation model the above can be achieved as:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1205
+#, no-c-format
+msgid "Annotation example of indexing entity"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1207
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed(index=\"Address_Index\")\n"
+ "public class Address {\n"
+ "....\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1213
+#, no-c-format
+msgid "Adding DocumentId to indexed entity"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1215
+#, no-c-format
+msgid "To set a property as a document id:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1218
+#, no-c-format
+msgid "Enabling document id with programmatic model"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1220
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping.entity(Address.class).indexed()\n"
+ " .property(\"addressId\", ElementType.FIELD) //field access\n"
+ " .documentId()\n"
+ " .name(\"id\");\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping);"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1222
+#, no-c-format
+msgid "The above is equivalent to annotating a property in the entity as <classname>@DocumentId</classname> as seen in the following example:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1227
+#, no-c-format
+msgid "DocumentId annotation definition"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1229
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "public class Address {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId(name=\"id\")\n"
+ " private Long addressId;\n"
+ "\n"
+ " ....\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1231
+#, no-c-format
+msgid "The next section demonstrates how to programmatically define analyzers."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1236
+#, no-c-format
+msgid "Defining analyzers"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1238
+#, no-c-format
+msgid "Analyzers can be programmatically defined using the <methodname>analyzerDef(String analyzerDef, Class<? extends TokenizerFactory> tokenizerFactory) </methodname>method. This method also enables you to define filters for the analyzer definition. Each filter that you define can optionally take in parameters as seen in the following example :"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1246
+#, no-c-format
+msgid "Defining analyzers using programmatic model"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1248
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping\n"
+ " <emphasis role=\"bold\">.analyzerDef( \"ngram\", StandardTokenizerFactory.class )\n"
+ " .filter( LowerCaseFilterFactory.class )\n"
+ " .filter( NGramFilterFactory.class )\n"
+ " .param( \"minGramSize\", \"3\" )\n"
+ " .param( \"maxGramSize\", \"3\" )\n"
+ " .analyzerDef( \"en\", StandardTokenizerFactory.class )\n"
+ " .filter( LowerCaseFilterFactory.class )\n"
+ " .filter( EnglishPorterFilterFactory.class )\n"
+ " .analyzerDef( \"de\", StandardTokenizerFactory.class )\n"
+ " .filter( LowerCaseFilterFactory.class )\n"
+ " .filter( GermanStemFilterFactory.class )</emphasis>\n"
+ " .entity(Address.class).indexed()\n"
+ " .property(\"addressId\", ElementType.METHOD) //getter access\n"
+ " .documentId()\n"
+ " .name(\"id\");\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1250
+#, no-c-format
+msgid "The analyzer mapping defined above is equivalent to the annotation model using <classname>@AnalyzerDef</classname> in conjunction with <classname>@AnalyzerDefs</classname>:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1254
+#, no-c-format
+msgid "Analyzer definition using annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1256
+#, no-c-format
+msgid ""
+ "@Indexed\n"
+ "@Entity\n"
+ "@AnalyzerDefs({\n"
+ " @AnalyzerDef(name = \"ngram\",\n"
+ " tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+ " filters = {\n"
+ " @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+ " @TokenFilterDef(factory = NGramFilterFactory.class, \n"
+ " params = {\n"
+ " @Parameter(name = \"minGramSize\",value = \"3\"),\n"
+ " @Parameter(name = \"maxGramSize\",value = \"3\") \n"
+ " })\n"
+ " }),\n"
+ " @AnalyzerDef(name = \"en\",\n"
+ " tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+ " filters = {\n"
+ " @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+ " @TokenFilterDef(factory = EnglishPorterFilterFactory.class)\n"
+ " }),\n"
+ "\n"
+ " @AnalyzerDef(name = \"de\",\n"
+ " tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+ " filters = {\n"
+ " @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+ " @TokenFilterDef(factory = GermanStemFilterFactory.class)\n"
+ " })\n"
+ "\n"
+ "})\n"
+ "public class Address {\n"
+ "...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1261
+#, no-c-format
+msgid "Defining full text filter definitions"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1263
+#, no-c-format
+msgid "The programmatic API provides easy mechanism for defining full text filter definitions which is available via <classname>@FullTextFilterDef</classname> and <classname>@FullTextFilterDefs</classname>. Note that contrary to the annotation equivalent, full text filter definitions are a global construct and are not tied to an entity. The next example depicts the creation of full text filter definition using the <methodname>fullTextFilterDef </methodname>method."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1273
+#, no-c-format
+msgid "Defining full text definition programmatically"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1275
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping\n"
+ " .analyzerDef( \"en\", StandardTokenizerFactory.class )\n"
+ " .filter( LowerCaseFilterFactory.class )\n"
+ " .filter( EnglishPorterFilterFactory.class )\n"
+ " <emphasis role=\"bold\">.fullTextFilterDef(\"security\", SecurityFilterFactory.class)\n"
+ " .cache(FilterCacheModeType.INSTANCE_ONLY)</emphasis>\n"
+ " .entity(Address.class)\n"
+ " .indexed()\n"
+ " .property(\"addressId\", ElementType.METHOD)\n"
+ " .documentId()\n"
+ " .name(\"id\")\n"
+ " .property(\"street1\", ElementType.METHOD)\n"
+ " .field()\n"
+ " .analyzer(\"en\")\n"
+ " .store(Store.YES)\n"
+ " .field()\n"
+ " .name(\"address_data\")\n"
+ " .analyzer(\"en\")\n"
+ " .store(Store.NO);\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1277
+#, no-c-format
+msgid "The previous example can effectively been seen as annotating your entity with <classname>@FullTextFilterDef</classname> like below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1281
+#, no-c-format
+msgid "Using annotation to define full text filter definition"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1284
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "@AnalyzerDefs({\n"
+ " @AnalyzerDef(name = \"en\",\n"
+ " tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+ " filters = {\n"
+ " @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+ " @TokenFilterDef(factory = EnglishPorterFilterFactory.class)\n"
+ " })\n"
+ "})\n"
+ "@FullTextFilterDefs({\n"
+ " @FullTextFilterDef(name = \"security\", impl = SecurityFilterFactory.class, cache = FilterCacheModeType.INSTANCE_ONLY)\n"
+ "})\n"
+ "public class Address {\n"
+ " \n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId(name=\"id\")\n"
+ " pubblic Long getAddressId() {...};\n"
+ "\n"
+ " @Fields({\n"
+ " @Field(index=Index.TOKENIZED, store=Store.YES, \n"
+ " analyzer=@Analyzer(definition=\"en\")),\n"
+ " @Field(name=\"address_data\", analyzer=@Analyzer(definition=\"en\"))\n"
+ " })\n"
+ " public String getAddress1() {...};\n"
+ "\n"
+ " ......\n"
+ " \n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1289
+#, no-c-format
+msgid "Defining fields for indexing"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1291
+#, no-c-format
+msgid "When defining fields for indexing using the programmatic API, call <methodname>field()</methodname> on the <methodname>property(String propertyName, ElementType elementType)</methodname> method. From <methodname>field()</methodname> you can specify the <methodname>name, index</methodname>, <methodname>store</methodname>, <methodname>bridge</methodname> and <methodname>analyzer</methodname> definitions."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1300
+#, no-c-format
+msgid "Indexing fields using programmatic API"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1302
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping\n"
+ " .analyzerDef( \"en\", StandardTokenizerFactory.class )\n"
+ " .filter( LowerCaseFilterFactory.class )\n"
+ " .filter( EnglishPorterFilterFactory.class )\n"
+ " .entity(Address.class).indexed()\n"
+ " .property(\"addressId\", ElementType.METHOD)\n"
+ " .documentId()\n"
+ " .name(\"id\")\n"
+ " .property(\"street1\", ElementType.METHOD)\n"
+ " <emphasis role=\"bold\">.field()\n"
+ " .analyzer(\"en\")\n"
+ " .store(Store.YES)\n"
+ " .index(Index.TOKENIZED) //no useful here as it's the default\n"
+ " .field()\n"
+ " .name(\"address_data\")\n"
+ " .analyzer(\"en\");</emphasis>\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1304
+#, no-c-format
+msgid "The above example of marking fields as indexable is equivalent to defining fields using <classname>@Field</classname> as seen below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1308
+#, no-c-format
+msgid "Indexing fields using annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1310
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "@AnalyzerDefs({\n"
+ " @AnalyzerDef(name = \"en\",\n"
+ " tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+ " filters = {\n"
+ " @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+ " @TokenFilterDef(factory = EnglishPorterFilterFactory.class)\n"
+ " })\n"
+ "})\n"
+ "public class Address {\n"
+ " \n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId(name=\"id\")\n"
+ " private Long getAddressId() {...};\n"
+ "\n"
+ " @Fields({\n"
+ " @Field(index=Index.TOKENIZED, store=Store.YES, \n"
+ " analyzer=@Analyzer(definition=\"en\")),\n"
+ " @Field(name=\"address_data\", analyzer=@Analyzer(definition=\"en\"))\n"
+ " })\n"
+ " public String getAddress1() {...}\n"
+ "\n"
+ " ......\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1317
+#, no-c-format
+msgid "Programmatically defining embedded entities"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1319
+#, no-c-format
+msgid "In this section you will see how to programmatically define entities to be embedded into the indexed entity similar to using the <classname>@IndexEmbedded</classname> model. In order to define this you must mark the property as <methodname>indexEmbedded. </methodname>The is the option to add a prefix to the embedded entity definition and this can be done by calling <methodname>prefix</methodname> as seen in the example below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1328
+#, no-c-format
+msgid "Programmatically defining embedded entites"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1330
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mappping\n"
+ " .entity(ProductCatalog.class)\n"
+ " .indexed()\n"
+ " .property(\"catalogId\", ElementType.METHOD)\n"
+ " .documentId()\n"
+ " .name(\"id\")\n"
+ " .property(\"title\", ElementType.METHOD)\n"
+ " .field()\n"
+ " .index(Index.TOKENIZED)\n"
+ " .store(Store.NO)\n"
+ " .property(\"description\", ElementType.METHOD)\n"
+ " .field()\n"
+ " .index(Index.TOKENIZED)\n"
+ " .store(Store.NO)\n"
+ " .property(\"items\", ElementType.METHOD)\n"
+ " <emphasis role=\"bold\">.indexEmbedded()\n"
+ " .prefix(\"catalog.items\"); //optional</emphasis>\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1332
+#, no-c-format
+msgid "The next example shows the same definition using annotation (<classname>@IndexEmbedded</classname>):"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1335
+#, no-c-format
+msgid "Using @IndexEmbedded"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1337
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "public class ProductCatalog {\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId(name=\"id\")\n"
+ " public Long getCatalogId() {...}\n"
+ " \n"
+ " @Field(store=Store.NO, index=Index.TOKENIZED)\n"
+ " public String getTitle() {...}\n"
+ "\n"
+ " @Field(store=Store.NO, index=Index.TOKENIZED)\n"
+ " public String getDescription();\n"
+ " \n"
+ " @OneToMany(fetch = FetchType.LAZY)\n"
+ " @IndexColumn(name = \"list_position\")\n"
+ " @Cascade(org.hibernate.annotations.CascadeType.ALL)\n"
+ " @IndexEmbedded(prefix=\"catalog.items\")\n"
+ " public List<Item> getItems() {...}\n"
+ "\n"
+ " ...\n"
+ "\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1342
+#, no-c-format
+msgid "Contained In definition"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1344
+#, no-c-format
+msgid "<classname>@ContainedIn</classname> can be define as seen in the example below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1346
+#, no-c-format
+msgid "Programmatically defining ContainedIn"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1348
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mappping\n"
+ " .entity(ProductCatalog.class)\n"
+ " .indexed()\n"
+ " .property(\"catalogId\", ElementType.METHOD)\n"
+ " .documentId()\n"
+ " .property(\"title\", ElementType.METHOD)\n"
+ " .field()\n"
+ " .property(\"description\", ElementType.METHOD)\n"
+ " .field()\n"
+ " .property(\"items\", ElementType.METHOD)\n"
+ " .indexEmbedded()\n"
+ "\n"
+ " .entity(Item.class)\n"
+ " .property(\"description\", ElementType.METHOD)\n"
+ " .field()\n"
+ " .property(\"productCatalog\", ElementType.METHOD)\n"
+ " <emphasis role=\"bold\">.containedIn()</emphasis>;\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1350
+#, no-c-format
+msgid "This is equivalent to defining <classname>@ContainedIn</classname> in your entity:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1354
+#, no-c-format
+msgid "Annotation approach for ContainedIn"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1356
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "public class ProductCatalog {\n"
+ " \n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId\n"
+ " public Long getCatalogId() {...}\n"
+ " \n"
+ " @Field\n"
+ " public String getTitle() {...}\n"
+ "\n"
+ " @Field\n"
+ " public String getDescription() {...}\n"
+ " \n"
+ " @OneToMany(fetch = FetchType.LAZY)\n"
+ " @IndexColumn(name = \"list_position\")\n"
+ " @Cascade(org.hibernate.annotations.CascadeType.ALL)\n"
+ " @IndexEmbedded\n"
+ " private List<Item> getItems() {...}\n"
+ "\n"
+ " ...\n"
+ "\n"
+ "}\n"
+ "\n"
+ "\n"
+ "@Entity\n"
+ "public class Item {\n"
+ " \n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " private Long itemId;\n"
+ "\n"
+ " @Field\n"
+ " public String getDescription() {...}\n"
+ " \n"
+ " @ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.REMOVE } )\n"
+ " @ContainedIn\n"
+ " public ProductCatalog getProductCatalog() {...}\n"
+ "\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1362
+#, no-c-format
+msgid "Date/Calendar Bridge"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1364
+#, no-c-format
+msgid "In order to define a calendar or date bridge mapping, call the <methodname>dateBridge(Resolution resolution) </methodname>or <methodname>calendarBridge(Resolution resolution)</methodname> methods after you have defined a <methodname>field()</methodname> in the <classname>SearchMapping </classname>hierarchy."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1371
+#, no-c-format
+msgid "Programmatic model for defining calendar/date bridge"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1373
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping\n"
+ " .entity(Address.class)\n"
+ " .indexed()\n"
+ " .property(\"addressId\", ElementType.FIELD)\n"
+ " .documentId()\n"
+ " .property(\"street1\", ElementType.FIELD()\n"
+ " .field()\n"
+ " .property(\"createdOn\", ElementType.FIELD)\n"
+ " .field()\n"
+ " <emphasis role=\"bold\">.dateBridge(Resolution.DAY)</emphasis>\n"
+ " .property(\"lastUpdated\", ElementType.FIELD)\n"
+ " <emphasis role=\"bold\">.calendarBridge(Resolution.DAY)</emphasis>;\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1375
+#, no-c-format
+msgid "See below for defining the above using <classname>@CalendarBridge</classname> and <classname>@DateBridge</classname>:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1379
+#, no-c-format
+msgid "@CalendarBridge and @DateBridge definition"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1381
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "public class Address {\n"
+ " \n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId\n"
+ " private Long addressId;\n"
+ "\n"
+ " @Field\n"
+ " private String address1;\n"
+ "\n"
+ " @Field\n"
+ " @DateBridge(resolution=Resolution.DAY)\n"
+ " private Date createdOn;\n"
+ "\n"
+ " @CalendarBridge(resolution=Resolution.DAY)\n"
+ " private Calendar lastUpdated;\n"
+ "\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1386
+#, no-c-format
+msgid "Defining bridges"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1388
+#, no-c-format
+msgid "It is possible to associate bridges to programmatically defined fields. When you define a <methodname>field()</methodname> programmatically you can use the <methodname>bridge(Class<?> impl)</methodname> to associate a <classname>FieldBridge </classname>implementation class. The bridge method also provides optional methods to include any parameters required for the bridge class. The below shows an example of programmatically defining a bridge:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1398
+#, no-c-format
+msgid "Defining field bridges programmatically"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1400
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping\n"
+ " .entity(Address.class)\n"
+ " .indexed()\n"
+ " .property(\"addressId\", ElementType.FIELD)\n"
+ " .documentId()\n"
+ " .property(\"street1\", ElementType.FIELD)\n"
+ " .field()\n"
+ " .field()\n"
+ " .name(\"street1_abridged\")\n"
+ " <emphasis role=\"bold\">.bridge( ConcatStringBridge.class )\n"
+ " .param( \"size\", \"4\" )</emphasis>;\n"
+ " \n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1402
+#, no-c-format
+msgid "The above can equally be defined using annotations, as seen in the next example."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1406
+#, no-c-format
+msgid "Defining field bridges using annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1408
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "\n"
+ "public class Address {\n"
+ " \n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId(name=\"id\")\n"
+ " private Long addressId;\n"
+ "\n"
+ " @Fields({\n"
+ " @Field,\n"
+ " @Field(name=\"street1_abridged\", \n"
+ " bridge = @FieldBridge( impl = ConcatStringBridge.class, \n"
+ " params = @Parameter( name=\"size\", value=\"4\" ))\n"
+ " })\n"
+ " private String address1;\n"
+ "\n"
+ " ...\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1414
+#, no-c-format
+msgid "Mapping class bridge"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1416
+#, no-c-format
+msgid "You can define class bridges on entities programmatically. This is shown in the next example:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1420
+#, no-c-format
+msgid "Defining class briges using API"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1422
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping\n"
+ " .entity(Departments.class)\n"
+ "<emphasis> .classBridge(CatDeptsFieldsClassBridge.class)\n"
+ " .name(\"branchnetwork\")\n"
+ " .index(Index.TOKENIZED)\n"
+ " .store(Store.YES)\n"
+ " .param(\"sepChar\", \" \")\n"
+ " .classBridge(EquipmentType.class)\n"
+ " .name(\"equiptype\")\n"
+ " .index(Index.TOKENIZED)\n"
+ " .store(Store.YES)\n"
+ " .param(\"C\", \"Cisco\")\n"
+ " .param(\"D\", \"D-Link\")\n"
+ " .param(\"K\", \"Kingston\")\n"
+ " .param(\"3\", \"3Com\")</emphasis>\n"
+ " .indexed();\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1424
+#, no-c-format
+msgid "The above is similar to using <classname>@ClassBridge </classname>as seen in the next example:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1426
+#, no-c-format
+msgid "Using @ClassBridge"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1428
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "@ClassBridges ( {\n"
+ " @ClassBridge(name=\"branchnetwork\",\n"
+ " index= Index.TOKENIZED,\n"
+ " store= Store.YES,\n"
+ " impl = CatDeptsFieldsClassBridge.class,\n"
+ " params = @Parameter( name=\"sepChar\", value=\" \" ) ),\n"
+ " @ClassBridge(name=\"equiptype\",\n"
+ " index= Index.TOKENIZED,\n"
+ " store= Store.YES,\n"
+ " impl = EquipmentType.class,\n"
+ " params = {@Parameter( name=\"C\", value=\"Cisco\" ),\n"
+ " @Parameter( name=\"D\", value=\"D-Link\" ),\n"
+ " @Parameter( name=\"K\", value=\"Kingston\" ),\n"
+ " @Parameter( name=\"3\", value=\"3Com\" )\n"
+ " })\n"
+ "})\n"
+ "public class Departments {\n"
+ "\n"
+ "....\n"
+ "\n"
+ "}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1434
+#, no-c-format
+msgid "Mapping dynamic boost"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1436
+#, no-c-format
+msgid "You can apply a dynamic boost factor on either a field or a whole entity:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1440
+#, no-c-format
+msgid "DynamicBoost mapping using programmatic model"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1442
+#, no-c-format
+msgid ""
+ "SearchMapping mapping = new SearchMapping();\n"
+ "\n"
+ "mapping\n"
+ " .entity(DynamicBoostedDescLibrary.class)\n"
+ " .indexed()\n"
+ " <emphasis>.dynamicBoost(CustomBoostStrategy.class)</emphasis>\n"
+ " .property(\"libraryId\", ElementType.FIELD)\n"
+ " .documentId().name(\"id\")\n"
+ " .property(\"name\", ElementType.FIELD)\n"
+ " <emphasis>.dynamicBoost(CustomFieldBoostStrategy.class)</emphasis>;\n"
+ " .field()\n"
+ " .store(Store.YES)\n"
+ "\n"
+ "cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1444
+#, no-c-format
+msgid "The next example shows the equivalent mapping using the <classname>@DynamicBoost</classname> annotation:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1446
+#, no-c-format
+msgid "Using the @DynamicBoost"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1448
+#, no-c-format
+msgid ""
+ "@Entity\n"
+ "@Indexed\n"
+ "@DynamicBoost(impl = CustomBoostStrategy.class)\n"
+ "public class DynamicBoostedDescriptionLibrary {\n"
+ "\n"
+ " @Id\n"
+ " @GeneratedValue\n"
+ " @DocumentId\n"
+ " private int id;\n"
+ "\n"
+ " private float dynScore;\n"
+ " \n"
+ " @Field(store = Store.YES)\n"
+ " @DynamicBoost(impl = CustomFieldBoostStrategy.class)\n"
+ " private String name;\n"
+ "\n"
+ " public DynamicBoostedDescriptionLibrary() {\n"
+ " dynScore = 1.0f;\n"
+ " }\n"
+ " \n"
+ " .......\n"
+ "\n"
+ "}"
+msgstr ""
+
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/optimize.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/optimize.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/optimize.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
@@ -44,44 +44,50 @@
msgid "after a lot of index modifications"
msgstr ""
+#. Tag: para
+#: optimize.xml:53
+#, no-c-format
+msgid "When using a <classname>MassIndexer</classname> (see <xref linkend=\"search-batchindex-massindexer\"/>) it will optimize involved indexes by default at the start and at the end of processing; you can change this behavior by using respectively <classname>MassIndexer</classname>.<methodname>optimizeAfterPurge</methodname> and <classname>MassIndexer</classname>.<methodname>optimizeOnFinish</methodname>."
+msgstr ""
+
#. Tag: title
-#: optimize.xml:54
+#: optimize.xml:61
#, no-c-format
msgid "Automatic optimization"
msgstr ""
#. Tag: para
-#: optimize.xml:56
+#: optimize.xml:63
#, no-c-format
msgid "Hibernate Search can automatically optimize an index after:"
msgstr ""
#. Tag: para
-#: optimize.xml:60
+#: optimize.xml:67
#, no-c-format
msgid "a certain amount of operations (insertion, deletion)"
msgstr ""
#. Tag: para
-#: optimize.xml:64
+#: optimize.xml:71
#, no-c-format
msgid "or a certain amount of transactions"
msgstr ""
#. Tag: para
-#: optimize.xml:68
+#: optimize.xml:75
#, no-c-format
msgid "The configuration for automatic index optimization can be defined on a global level or per index:"
msgstr ""
#. Tag: title
-#: optimize.xml:72
+#: optimize.xml:79
#, no-c-format
msgid "Defining automatic optimization parameters"
msgstr ""
#. Tag: programlisting
-#: optimize.xml:74
+#: optimize.xml:81
#, no-c-format
msgid ""
"hibernate.search.default.optimizer.operation_limit.max = 1000\n"
@@ -90,49 +96,49 @@
msgstr ""
#. Tag: para
-#: optimize.xml:77
+#: optimize.xml:84
#, no-c-format
msgid "An optimization will be triggered to the <literal>Animal</literal> index as soon as either:"
msgstr ""
#. Tag: para
-#: optimize.xml:82
+#: optimize.xml:89
#, no-c-format
msgid "the number of additions and deletions reaches 1000"
msgstr ""
#. Tag: para
-#: optimize.xml:86
+#: optimize.xml:93
#, no-c-format
msgid "the number of transactions reaches 50 (<constant>hibernate.search.Animal.optimizer.transaction_limit.max</constant> having priority over <constant>hibernate.search.default.optimizer.transaction_limit.max</constant>)"
msgstr ""
#. Tag: para
-#: optimize.xml:93
+#: optimize.xml:100
#, no-c-format
msgid "If none of these parameters are defined, no optimization is processed automatically."
msgstr ""
#. Tag: title
-#: optimize.xml:98
+#: optimize.xml:105
#, no-c-format
msgid "Manual optimization"
msgstr ""
#. Tag: para
-#: optimize.xml:100
+#: optimize.xml:107
#, no-c-format
msgid "You can programmatically optimize (defragment) a Lucene index from Hibernate Search through the <classname>SearchFactory</classname>:"
msgstr ""
#. Tag: title
-#: optimize.xml:104
+#: optimize.xml:111
#, no-c-format
msgid "Programmatic index optimization"
msgstr ""
#. Tag: programlisting
-#: optimize.xml:106
+#: optimize.xml:113
#, no-c-format
msgid ""
"FullTextSession fullTextSession = Search.getFullTextSession(regularSession);\n"
@@ -144,31 +150,31 @@
msgstr ""
#. Tag: para
-#: optimize.xml:109
+#: optimize.xml:116
#, no-c-format
msgid "The first example optimizes the Lucene index holding <classname>Order</classname>s; the second, optimizes all indexes."
msgstr ""
#. Tag: para
-#: optimize.xml:113
+#: optimize.xml:120
#, no-c-format
msgid "<literal>searchFactory.optimize()</literal> has no effect on a JMS backend. You must apply the optimize operation on the Master node."
msgstr ""
#. Tag: title
-#: optimize.xml:120
+#: optimize.xml:127
#, no-c-format
msgid "Adjusting optimization"
msgstr ""
#. Tag: para
-#: optimize.xml:122
+#: optimize.xml:129
#, no-c-format
msgid "Apache Lucene has a few parameters to influence how optimization is performed. Hibernate Search exposes those parameters."
msgstr ""
#. Tag: para
-#: optimize.xml:125
+#: optimize.xml:132
#, no-c-format
msgid "Further index optimization parameters include: <itemizedlist> <listitem> <literal>hibernate.search.[default|<indexname>].indexwriter.[batch|transaction].max_buffered_docs</literal> </listitem> <listitem> <literal>hibernate.search.[default|<indexname>].indexwriter.[batch|transaction].max_field_length</literal> </listitem> <listitem> <literal>hibernate.search.[default|<indexname>].indexwriter.[batch|transaction].max_merge_docs</literal> </listitem> <listitem> <literal>hibernate.search.[default|<indexname>].indexwriter.[batch|transaction].merge_factor</literal> </listitem> <listitem> <literal>hibernate.search.[default|<indexname>].indexwriter.[batch|transaction].ram_buffer_size</literal> </listitem> <listitem> <literal>hibernate.search.[default|<indexname>].indexwriter.[batch|transaction].term_index_interval</literal> </listitem> </itemizedlist> See <xref linkend=\"lucene-indexing-performance\"/> for more details."
msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/pot/modules/query.pot
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/pot/modules/query.pot 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/pot/modules/query.pot 2010-07-01 20:29:15 UTC (rev 19886)
@@ -6,7 +6,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <kde-i18n-doc(a)kde.org>\n"
@@ -121,7 +121,7 @@
"EntityManager em = entityManagerFactory.createEntityManager();\n"
"\n"
"FullTextEntityManager fullTextEntityManager = \n"
- " org.hibernate.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
+ " org.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
"\n"
"...\n"
"org.apache.lucene.queryParser.QueryParser parser = \n"
@@ -1005,43 +1005,159 @@
msgstr ""
#. Tag: title
-#: query.xml:720
+#: query.xml:719
#, no-c-format
+msgid "Using filters in a sharded environment"
+msgstr ""
+
+#. Tag: para
+#: query.xml:721
+#, no-c-format
+msgid "It is possible, in a sharded environment to execute queries on a subset of the available shards. This can be done in two steps:"
+msgstr ""
+
+#. Tag: para
+#: query.xml:726
+#, no-c-format
+msgid "create a sharding strategy that does select a subset of <classname>DirectoryProvider</classname>s depending on sone filter configuration"
+msgstr ""
+
+#. Tag: para
+#: query.xml:732
+#, no-c-format
+msgid "activate the proper filter at query time"
+msgstr ""
+
+#. Tag: para
+#: query.xml:736
+#, no-c-format
+msgid "Let's first look at an example of sharding strategy that query on a specific customer shard if the customer filter is activated."
+msgstr ""
+
+#. Tag: programlisting
+#: query.xml:739
+#, no-c-format
+msgid ""
+ "public class CustomerShardingStrategy implements IndexShardingStrategy {\n"
+ "\n"
+ " // stored DirectoryProviders in a array indexed by customerID\n"
+ " private DirectoryProvider<?>[] providers;\n"
+ " \n"
+ " public void initialize(Properties properties, DirectoryProvider<?>[] providers) {\n"
+ " this.providers = providers;\n"
+ " }\n"
+ "\n"
+ " public DirectoryProvider<?>[] getDirectoryProvidersForAllShards() {\n"
+ " return providers;\n"
+ " }\n"
+ "\n"
+ " public DirectoryProvider<?> getDirectoryProviderForAddition(Class<?> entity, Serializable id, String idInString, Document document) {\n"
+ " Integer customerID = Integer.parseInt(document.getField(\"customerID\").stringValue());\n"
+ " return providers[customerID];\n"
+ " }\n"
+ "\n"
+ " public DirectoryProvider<?>[] getDirectoryProvidersForDeletion(Class<?> entity, Serializable id, String idInString) {\n"
+ " return getDirectoryProvidersForAllShards();\n"
+ " }\n"
+ "\n"
+ "<emphasis role=\"bold\"> /**\n"
+ " * Optimization; don't search ALL shards and union the results; in this case, we \n"
+ " * can be certain that all the data for a particular customer Filter is in a single\n"
+ " * shard; simply return that shard by customerID.\n"
+ " */\n"
+ " public DirectoryProvider<?>[] getDirectoryProvidersForQuery(FullTextFilterImplementor[] filters) {\n"
+ " FFullTextFilter filter = getCustomerFilter(filters, \"customer\");\n"
+ " if (filter == null) {\n"
+ " return getDirectoryProvidersForAllShards();\n"
+ " }\n"
+ " else {\n"
+ " return new DirectoryProvider[] { providers[Integer.parseInt(filter.getParameter(\"customerID\").toString())] };\n"
+ " }\n"
+ " }\n"
+ "\n"
+ " private FullTextFilter getFilter(FullTextFilterImplementor[] filters, String name) {\n"
+ " for (FullTextFilterImplementor filter: filters) {\n"
+ " if (filter.getName().equals(name)) return filter;\n"
+ " }\n"
+ " return null;\n"
+ " }</emphasis>\n"
+ "\n"
+ "}"
+msgstr ""
+
+#. Tag: para
+#: query.xml:741
+#, no-c-format
+msgid "In this example, if the filter named <literal>customer</literal> is present, we make sure to only use the shard dedicated to this customer. Otherwise, we return all shards. A given Sharding strategy can react to one or more filters and depends on their parameters."
+msgstr ""
+
+#. Tag: para
+#: query.xml:746
+#, no-c-format
+msgid "The second step is simply to activate the filter at query time. While the filter can be a regular filter (as defined in <xref linkend=\"query-filter\"/>) which also filters Lucene results after the query, you can make use of a special filter that will only be passed to the sharding strategy and otherwise ignored for the rest of the query. Simply use the <classname>ShardSensitiveOnlyFilter</classname> class when declaring your filter."
+msgstr ""
+
+#. Tag: programlisting
+#: query.xml:754
+#, no-c-format
+msgid ""
+ "@Entity @Indexed\n"
+ "<emphasis role=\"bold\">@FullTextFilterDef(name=\"customer\", impl=ShardSensitiveOnlyFilter.class)</emphasis>\n"
+ "public class Customer {\n"
+ " ...\n"
+ "}\n"
+ "\n"
+ "\n"
+ "FullTextQuery query = ftEm.createFullTextQuery(luceneQuery, Customer.class);\n"
+ "<emphasis role=\"bold\">query.enableFulltextFilter(\"customer\").setParameter(\"CustomerID\", 5);</emphasis>\n"
+ "@SuppressWarnings(\"unchecked\")\n"
+ "List<Customer> results = query.getResultList();"
+msgstr ""
+
+#. Tag: para
+#: query.xml:756
+#, no-c-format
+msgid "Note that by using the <classname>ShardSensitiveOnlyFilter</classname>, you do not have to implement any Lucene filter. Using filters and sharding strategy reacting to these filters is recommended to speed up queries in a sharded environment."
+msgstr ""
+
+#. Tag: title
+#: query.xml:765
+#, no-c-format
msgid "Optimizing the query process"
msgstr ""
#. Tag: para
-#: query.xml:722
+#: query.xml:767
#, no-c-format
msgid "Query performance depends on several criteria:"
msgstr ""
#. Tag: para
-#: query.xml:726
+#: query.xml:771
#, no-c-format
msgid "the Lucene query itself: read the literature on this subject"
msgstr ""
#. Tag: para
-#: query.xml:731
+#: query.xml:776
#, no-c-format
msgid "the number of object loaded: use pagination (always ;-) ) or index projection (if needed)"
msgstr ""
#. Tag: para
-#: query.xml:736
+#: query.xml:781
#, no-c-format
msgid "the way Hibernate Search interacts with the Lucene readers: defines the appropriate <xref linkend=\"search-architecture-readerstrategy\"/>."
msgstr ""
#. Tag: title
-#: query.xml:744
+#: query.xml:789
#, no-c-format
msgid "Native Lucene Queries"
msgstr ""
#. Tag: para
-#: query.xml:746
+#: query.xml:791
#, no-c-format
msgid "If you wish to use some specific features of Lucene, you can always run Lucene specific queries. Check <xref linkend=\"search-lucene-native\"/> for more information."
msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/master.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/master.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/master.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -0,0 +1,63 @@
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
+
+#. Tag: title
+#: master.xml:34
+#, no-c-format
+msgid "Hibernate Search"
+msgstr ""
+
+#. Tag: subtitle
+#: master.xml:36
+#, no-c-format
+msgid "Apache <trademark>Lucene</trademark> Integration"
+msgstr ""
+
+#. Tag: subtitle
+#: master.xml:38
+#, no-c-format
+msgid "Reference Guide"
+msgstr ""
+
+#. Tag: title
+#: master.xml:58
+#, no-c-format
+msgid "Preface"
+msgstr ""
+
+#. Tag: para
+#: master.xml:60
+#, no-c-format
+msgid ""
+"Full text search engines like Apache Lucene are very powerful technologies "
+"to add efficient free text search capabilities to applications. However, "
+"Lucene suffers several mismatches when dealing with object domain model. "
+"Amongst other things indexes have to be kept up to date and mismatches "
+"between index structure and domain model as well as query mismatches have to "
+"be avoided."
+msgstr ""
+
+#. Tag: para
+#: master.xml:67
+#, no-c-format
+msgid ""
+"Hibernate Search addresses these shortcomings - it indexes your domain model "
+"with the help of a few annotations, takes care of database/index "
+"synchronization and brings back regular managed objects from free text "
+"queries. To achieve this Hibernate Search is combining the power of <ulink "
+"url=\"http://www.hibernate.org\">Hibernate</ulink> and <ulink url=\"http://"
+"lucene.apache.org\">Apache Lucene</ulink>."
+msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/architecture.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/architecture.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/architecture.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1,17 +1,18 @@
-# Chinese translations for PACKAGE package.
-# Automatically generated, 2009.
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
-"PO-Revision-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
#. Tag: title
#: architecture.xml:30
@@ -224,8 +225,25 @@
"provider and by having the slaves working on a local copy of the index."
msgstr ""
+#. Tag: title
+#: architecture.xml:178
+#, no-c-format
+msgid "JGroups"
+msgstr ""
+
+#. Tag: para
+#: architecture.xml:180
+#, no-c-format
+msgid ""
+"The JGroups based back end works similarly as the JMS one. Designed on the "
+"same master/slave pattern, instead of JMS the JGroups toolkit is used as a "
+"replication mechanism. This back end can be used as an alternative to JMS "
+"one when response time is still critical, but i.e. JNDI service is not "
+"available."
+msgstr ""
+
#. Tag: note
-#: architecture.xml:177
+#: architecture.xml:186
#, no-c-format
msgid ""
"Hibernate Search is an extensible architecture. Feel free to drop ideas for "
@@ -234,13 +252,13 @@
msgstr ""
#. Tag: title
-#: architecture.xml:183
+#: architecture.xml:192
#, no-c-format
msgid "Work execution"
msgstr ""
#. Tag: para
-#: architecture.xml:185
+#: architecture.xml:194
#, no-c-format
msgid ""
"The indexing work (done by the back end) can be executed synchronously with "
@@ -249,13 +267,13 @@
msgstr ""
#. Tag: title
-#: architecture.xml:190
+#: architecture.xml:199
#, no-c-format
msgid "Synchronous"
msgstr ""
#. Tag: para
-#: architecture.xml:192
+#: architecture.xml:201
#, no-c-format
msgid ""
"This is the safe mode where the back end work is executed in concert with "
@@ -266,13 +284,13 @@
msgstr ""
#. Tag: title
-#: architecture.xml:201
+#: architecture.xml:210
#, no-c-format
msgid "Asynchronous"
msgstr ""
#. Tag: para
-#: architecture.xml:203
+#: architecture.xml:212
#, no-c-format
msgid ""
"This mode delegates the work done by the back end to a different thread. "
@@ -283,7 +301,7 @@
msgstr ""
#. Tag: para
-#: architecture.xml:210
+#: architecture.xml:219
#, no-c-format
msgid ""
"It is recommended to use synchronous execution first and evaluate "
@@ -293,13 +311,13 @@
msgstr ""
#. Tag: title
-#: architecture.xml:219
+#: architecture.xml:228
#, no-c-format
msgid "Reader strategy"
msgstr ""
#. Tag: para
-#: architecture.xml:221
+#: architecture.xml:230
#, no-c-format
msgid ""
"When executing a query, Hibernate Search interacts with the Apache Lucene "
@@ -309,13 +327,13 @@
msgstr ""
#. Tag: title
-#: architecture.xml:228
+#: architecture.xml:237
#, no-c-format
msgid "Shared"
msgstr ""
#. Tag: para
-#: architecture.xml:230
+#: architecture.xml:239
#, no-c-format
msgid ""
"With this strategy, Hibernate Search will share the same "
@@ -330,19 +348,19 @@
msgstr ""
#. Tag: para
-#: architecture.xml:241
+#: architecture.xml:250
#, no-c-format
msgid "The name of this strategy is <literal>shared</literal>."
msgstr ""
#. Tag: title
-#: architecture.xml:245
+#: architecture.xml:254
#, no-c-format
msgid "Not-shared"
msgstr ""
#. Tag: para
-#: architecture.xml:247
+#: architecture.xml:256
#, no-c-format
msgid ""
"Every time a query is executed, a Lucene <classname>IndexReader</classname> "
@@ -352,19 +370,19 @@
msgstr ""
#. Tag: para
-#: architecture.xml:253
+#: architecture.xml:262
#, no-c-format
msgid "The name of this strategy is <literal>not-shared</literal>."
msgstr ""
#. Tag: title
-#: architecture.xml:257
+#: architecture.xml:266
#, no-c-format
msgid "Custom"
msgstr ""
#. Tag: para
-#: architecture.xml:259
+#: architecture.xml:268
#, no-c-format
msgid ""
"You can write your own reader strategy that suits your application needs by "
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/batchindex.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/batchindex.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/batchindex.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -0,0 +1,472 @@
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
+
+#. Tag: title
+#: batchindex.xml:30
+#, no-c-format
+msgid "Manual index changes"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:32
+#, no-c-format
+msgid ""
+"As Hibernate core applies changes to the Database, Hibernate Search detects "
+"these changes and will update the index automatically (unless the "
+"EventListeners are disabled). Sometimes changes are made to the database "
+"without using Hibernate, as when backup is restored or your data is "
+"otherwise affected; for these cases Hibernate Search exposes the Manual "
+"Index APIs to explicitly update or remove a single entity from the index, or "
+"rebuild the index for the whole database, or remove all references to a "
+"specific type."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:40
+#, no-c-format
+msgid ""
+"All these methods affect the Lucene Index only, no changes are applied to "
+"the Database."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:44
+#, no-c-format
+msgid "Adding instances to the Index"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:46
+#, no-c-format
+msgid ""
+"Using <classname>FullTextSession</classname>.<methodname>index(T entity)</"
+"methodname> you can directly add or update a specific object instance to the "
+"index. If this entity was already indexed, then the index will be updated. "
+"Changes to the index are only applied at transaction commit."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:52
+#, no-c-format
+msgid ""
+"Indexing an entity via <methodname>FullTextSession.index(T entity)</"
+"methodname>"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:55
+#, no-c-format
+msgid ""
+"FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
+"Transaction tx = fullTextSession.beginTransaction();\n"
+"Object customer = fullTextSession.load( Customer.class, 8 );\n"
+"<emphasis role=\"bold\">fullTextSession.index(customer);</emphasis>\n"
+"tx.commit(); //index only updated at commit time"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:58
+#, no-c-format
+msgid ""
+"In case you want to add all instances for a type, or for all indexed types, "
+"the recommended approach is to use a <classname>MassIndexer</classname>: see "
+"<xref linkend=\"search-batchindex-massindexer\"/> for more details."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:65
+#, no-c-format
+msgid "Deleting instances from the Index: Purging"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:67
+#, no-c-format
+msgid ""
+"It is equally possible to remove an entity or all entities of a given type "
+"from a Lucene index without the need to physically remove them from the "
+"database. This operation is named purging and is also done through the "
+"<classname>FullTextSession</classname>."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:73
+#, no-c-format
+msgid "Purging a specific instance of an entity from the index"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:75
+#, no-c-format
+msgid ""
+"FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
+"Transaction tx = fullTextSession.beginTransaction();\n"
+"for (Customer customer : customers) {\n"
+" <emphasis role=\"bold\">fullTextSession.purge( Customer.class, customer."
+"getId() );</emphasis>\n"
+"}\n"
+"tx.commit(); //index is updated at commit time"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:78
+#, no-c-format
+msgid ""
+"Purging will remove the entity with the given id from the Lucene index but "
+"will not touch the database."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:81
+#, no-c-format
+msgid ""
+"If you need to remove all entities of a given type, you can use the "
+"<methodname>purgeAll</methodname> method. This operation removes all "
+"entities of the type passed as a parameter as well as all its subtypes."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:87
+#, no-c-format
+msgid "Purging all instances of an entity from the index"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:89
+#, no-c-format
+msgid ""
+"FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
+"Transaction tx = fullTextSession.beginTransaction();\n"
+"<emphasis role=\"bold\">fullTextSession.purgeAll( Customer.class );</"
+"emphasis>\n"
+"//optionally optimize the index\n"
+"//fullTextSession.getSearchFactory().optimize( Customer.class );\n"
+"tx.commit(); //index changes are applied at commit time"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:92
+#, no-c-format
+msgid "It is recommended to optimize the index after such an operation."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:96
+#, no-c-format
+msgid ""
+"Methods <methodname>index</methodname>, <methodname>purge</methodname> and "
+"<methodname>purgeAll</methodname> are available on "
+"<classname>FullTextEntityManager</classname> as well."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:102
+#, no-c-format
+msgid ""
+"All manual indexing methods (<methodname>index</methodname>, "
+"<methodname>purge</methodname> and <methodname>purgeAll</methodname>) only "
+"affect the index, not the database, nevertheless they are transactional and "
+"as such they won't be applied until the transaction is successfully "
+"committed, or you make use of <methodname>flushToIndexes</methodname>."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:112
+#, no-c-format
+msgid "Rebuilding the whole Index"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:114
+#, no-c-format
+msgid ""
+"If you change the entity mapping to the index, chances are that the whole "
+"Index needs to be updated; For example if you decide to index a an existing "
+"field using a different analyzer you'll need to rebuild the index for "
+"affected types. Also if the Database is replaced (like restored from a "
+"backup, imported from a legacy system) you'll want to be able to rebuild the "
+"index from existing data. Hibernate Search provides two main strategies to "
+"choose from:"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:124
+#, no-c-format
+msgid ""
+"Using <classname>FullTextSession</classname>.<methodname>flushToIndexes()</"
+"methodname> periodically, while using <classname>FullTextSession</classname>."
+"<methodname>index()</methodname> on all entities."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:129
+#, no-c-format
+msgid "Use a <classname>MassIndexer</classname>."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:134
+#, no-c-format
+msgid "Using flushToIndexes()"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:136
+#, no-c-format
+msgid ""
+"This strategy consists in removing the existing index and then adding all "
+"entities back to the index using <classname>FullTextSession</classname>."
+"<methodname>purgeAll()</methodname> and <classname>FullTextSession</"
+"classname>.<methodname>index()</methodname>, however there are some memory "
+"and efficiency contraints. For maximum efficiency Hibernate Search batches "
+"index operations and executes them at commit time. If you expect to index a "
+"lot of data you need to be careful about memory consumption since all "
+"documents are kept in a queue until the transaction commit. You can "
+"potentially face an <classname>OutOfMemoryException</classname> if you don't "
+"empty the queue periodically: to do this you can use "
+"<methodname>fullTextSession.flushToIndexes()</methodname>. Every time "
+"<methodname>fullTextSession.flushToIndexes()</methodname> is called (or if "
+"the transaction is committed), the batch queue is processed applying all "
+"index changes. Be aware that, once flushed, the changes cannot be rolled "
+"back."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:154
+#, no-c-format
+msgid "Index rebuilding using index() and flushToIndexes()"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:156
+#, no-c-format
+msgid ""
+"fullTextSession.setFlushMode(FlushMode.MANUAL);\n"
+"fullTextSession.setCacheMode(CacheMode.IGNORE);\n"
+"transaction = fullTextSession.beginTransaction();\n"
+"//Scrollable results will avoid loading too many objects in memory\n"
+"ScrollableResults results = fullTextSession.createCriteria( Email.class )\n"
+" .setFetchSize(BATCH_SIZE)\n"
+" .scroll( ScrollMode.FORWARD_ONLY );\n"
+"int index = 0;\n"
+"while( results.next() ) {\n"
+" index++;\n"
+" fullTextSession.index( results.get(0) ); //index each element\n"
+" if (index % BATCH_SIZE == 0) {\n"
+" fullTextSession.flushToIndexes(); //apply changes to indexes\n"
+" fullTextSession.clear(); //free memory since the queue is processed\n"
+" }\n"
+"}\n"
+"transaction.commit();"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:160
+#, no-c-format
+msgid ""
+"<literal>hibernate.search.worker.batch_size</literal> has been deprecated in "
+"favor of this explicit API which provides better control"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:164
+#, no-c-format
+msgid ""
+"Try to use a batch size that guarantees that your application will not run "
+"out of memory: with a bigger batch size objects are fetched faster from "
+"database but more memory is needed."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:171
+#, no-c-format
+msgid "Using a MassIndexer"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:172
+#, no-c-format
+msgid ""
+"Hibernate Search's <classname>MassIndexer</classname> uses several parallel "
+"threads to rebuild the index; you can optionally select which entities need "
+"to be reloaded or have it reindex all entities. This approach is optimized "
+"for best performance but requires to set the application in maintenance "
+"mode: making queries to the index is not recommended when a MassIndexer is "
+"busy."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:179
+#, no-c-format
+msgid "Index rebuilding using a MassIndexer"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:180
+#, no-c-format
+msgid "fullTextSession.createIndexer().startAndWait();"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:181
+#, no-c-format
+msgid ""
+"This will rebuild the index, deleting it and then reloading all entities "
+"from the database. Although it's simple to use, some tweaking is recommended "
+"to speed up the process: there are several parameters configurable."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:186
+#, no-c-format
+msgid ""
+"During the progress of a MassIndexer the content of the index is undefined, "
+"make sure that nobody will try to make some query during index rebuilding! "
+"If somebody should query the index it will not corrupt but most results will "
+"likely be missing."
+msgstr ""
+
+#. Tag: title
+#: batchindex.xml:192
+#, no-c-format
+msgid "Using a tuned MassIndexer"
+msgstr ""
+
+#. Tag: programlisting
+#: batchindex.xml:193
+#, no-c-format
+msgid ""
+"fullTextSession\n"
+" .createIndexer( User.class )\n"
+" .batchSizeToLoadObjects( 25 )\n"
+" .cacheMode( CacheMode.NORMAL )\n"
+" .threadsToLoadObjects( 5 )\n"
+" .threadsForSubsequentFetching( 20 )\n"
+" .startAndWait();"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:194
+#, no-c-format
+msgid ""
+"This will rebuild the index of all User instances (and subtypes), and will "
+"create 5 parallel threads to load the User instances using batches of 25 "
+"objects per query; these loaded User instances are then pipelined to 20 "
+"parallel threads to load the attached lazy collections of User containing "
+"some information needed for the index."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:199
+#, no-c-format
+msgid ""
+"It is recommended to leave cacheMode to <literal>CacheMode.IGNORE</literal> "
+"(the default), as in most reindexing situations the cache will be a useless "
+"additional overhead; it might be useful to enable some other "
+"<literal>CacheMode</literal> depending on your data: it might increase "
+"performance if the main entity is relating to enum-like data included in the "
+"index."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:205
+#, no-c-format
+msgid ""
+"The \"sweet spot\" of number of threads to achieve best performance is "
+"highly dependent on your overall architecture, database design and even data "
+"values. To find out the best number of threads for your application it is "
+"recommended to use a profiler: all internal thread groups have meaningful "
+"names to be easily identified with most tools."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:214
+#, no-c-format
+msgid ""
+"The MassIndexer was designed for speed and is unaware of transactions, so "
+"there is no need to begin one or committing. Also because it is not "
+"transactional it is not recommended to let users use the system during it's "
+"processing, as it is unlikely people will be able to find results and the "
+"system load might be too high anyway."
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:223
+#, no-c-format
+msgid ""
+"Other parameters which also affect indexing time and memory consumption are:"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:228
+#, no-c-format
+msgid "hibernate.search.[default|<indexname>].exclusive_index_use"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:232
+#, no-c-format
+msgid ""
+"hibernate.search.[default|<indexname>].indexwriter.batch."
+"max_buffered_docs"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:236
+#, no-c-format
+msgid ""
+"hibernate.search.[default|<indexname>].indexwriter.batch."
+"max_field_length"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:240
+#, no-c-format
+msgid ""
+"hibernate.search.[default|<indexname>].indexwriter.batch.max_merge_docs"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:244
+#, no-c-format
+msgid ""
+"hibernate.search.[default|<indexname>].indexwriter.batch.merge_factor"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:248
+#, no-c-format
+msgid ""
+"hibernate.search.[default|<indexname>].indexwriter.batch."
+"ram_buffer_size"
+msgstr ""
+
+#. Tag: literal
+#: batchindex.xml:252
+#, no-c-format
+msgid ""
+"hibernate.search.[default|<indexname>].indexwriter.batch."
+"term_index_interval"
+msgstr ""
+
+#. Tag: para
+#: batchindex.xml:256
+#, no-c-format
+msgid ""
+"All <literal>.indexwriter</literal> parameters are Lucene specific and "
+"Hibernate Search is just passing these parameters through - see <xref "
+"linkend=\"lucene-indexing-performance\"/> for more details."
+msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/configuration.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/configuration.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/configuration.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1,17 +1,18 @@
-# Chinese translations for PACKAGE package.
-# Automatically generated, 2009.
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
-"PO-Revision-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
#. Tag: title
#: configuration.xml:30
@@ -48,14 +49,14 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:52 configuration.xml:811
+#: configuration.xml:52 configuration.xml:932
#, no-c-format
msgid "Class"
msgstr ""
#. Tag: entry
-#: configuration.xml:54 configuration.xml:349 configuration.xml:635
-#: configuration.xml:813
+#: configuration.xml:54 configuration.xml:372 configuration.xml:735
+#: configuration.xml:934
#, no-c-format
msgid "Description"
msgstr ""
@@ -81,7 +82,7 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:68 configuration.xml:868
+#: configuration.xml:68 configuration.xml:989
#, no-c-format
msgid "none"
msgstr ""
@@ -332,47 +333,67 @@
#: configuration.xml:203
#, no-c-format
msgid ""
-"In some extreme cases involving huge indexes (in size), it is necessary to "
-"split (shard) the indexing data of a given entity type into several Lucene "
-"indexes. This solution is not recommended until you reach significant index "
-"sizes and index update times are slowing the application down. The main "
-"drawback of index sharding is that searches will end up being slower since "
-"more files have to be opened for a single search. In other words don't do it "
-"until you have problems :)"
+"In some cases, it is necessary to split (shard) the indexing data of a given "
+"entity type into several Lucene indexes. This solution is not recommended "
+"unless there is a pressing need because by default, searches will be slower "
+"as all shards have to be opened for a single search. In other words don't do "
+"it until you have problems :)"
msgstr ""
#. Tag: para
-#: configuration.xml:211
+#: configuration.xml:209
#, no-c-format
+msgid "For example, sharding may be desirable if:"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:213
+#, no-c-format
msgid ""
-"Despite this strong warning, Hibernate Search allows you to index a given "
-"entity type into several sub indexes. Data is sharded into the different sub "
-"indexes thanks to an <classname>IndexShardingStrategy</classname>. By "
-"default, no sharding strategy is enabled, unless the number of shards is "
-"configured. To configure the number of shards use the following property"
+"A single index is so huge that index update times are slowing the "
+"application down."
msgstr ""
+#. Tag: para
+#: configuration.xml:218
+#, no-c-format
+msgid ""
+"A typical search will only hit a sub-set of the index, such as when data is "
+"naturally segmented by customer, region or application."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:224
+#, no-c-format
+msgid ""
+"Hibernate Search allows you to index a given entity type into several sub "
+"indexes. Data is sharded into the different sub indexes thanks to an "
+"<classname>IndexShardingStrategy</classname>. By default, no sharding "
+"strategy is enabled, unless the number of shards is configured. To configure "
+"the number of shards use the following property"
+msgstr ""
+
#. Tag: title
-#: configuration.xml:219
+#: configuration.xml:231
#, no-c-format
msgid ""
"Enabling index sharding by specifying nbr_of_shards for a specific index"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:222
+#: configuration.xml:234
#, no-c-format
msgid "hibernate.search.<indexName>.sharding_strategy.nbr_of_shards 5"
msgstr ""
#. Tag: para
-#: configuration.xml:225
+#: configuration.xml:237
#, no-c-format
msgid "This will use 5 different shards."
msgstr ""
#. Tag: para
-#: configuration.xml:227
+#: configuration.xml:239
#, no-c-format
msgid ""
"The default sharding strategy, when shards are set up, splits the data "
@@ -383,13 +404,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:235
+#: configuration.xml:247
#, no-c-format
msgid "Specifying a custom sharding strategy"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:237
+#: configuration.xml:249
#, no-c-format
msgid ""
"hibernate.search.<indexName>.sharding_strategy my.shardingstrategy."
@@ -397,19 +418,38 @@
msgstr ""
#. Tag: para
-#: configuration.xml:240
+#: configuration.xml:252
#, no-c-format
msgid ""
+"Using a custom <classname>IndexShardingStrategy</classname> implementation, "
+"it's possible to define what shard a given entity is indexed to."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:256
+#, no-c-format
+msgid ""
+"It also allows for optimizing searches by selecting which shard to run the "
+"query onto. By activating a filter (see <xref linkend=\"query-filter-shard\"/"
+">), a sharding strategy can select a subset of the shards used to answer a "
+"query (<classname>IndexShardingStrategy.getDirectoryProvidersForQuery</"
+"classname>) and thus speed up the query execution."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:263
+#, no-c-format
+msgid ""
"Each shard has an independent directory provider configuration as described "
-"in <xref linkend=\"search-configuration-directory\"/>. The DirectoryProvider "
-"default name for the previous example are <literal><indexName>.0</"
-"literal> to <literal><indexName>.4</literal>. In other words, each "
-"shard has the name of it's owning index followed by <constant>.</constant> "
-"(dot) and its index number."
+"in <xref linkend=\"search-configuration-directory\"/>. The "
+"<classname>DirectoryProvider</classname> default name for the previous "
+"example are <literal><indexName>.0</literal> to <literal><"
+"indexName>.4</literal>. In other words, each shard has the name of it's "
+"owning index followed by <constant>.</constant> (dot) and its index number."
msgstr ""
#. Tag: title
-#: configuration.xml:249
+#: configuration.xml:272
#, no-c-format
msgid ""
"Configuring the sharding configuration for an example entity "
@@ -417,7 +457,7 @@
msgstr ""
#. Tag: programlisting
-#: configuration.xml:252
+#: configuration.xml:275
#, no-c-format
msgid ""
"hibernate.search.default.indexBase /usr/lucene/indexes\n"
@@ -431,7 +471,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:255
+#: configuration.xml:278
#, no-c-format
msgid ""
"This configuration uses the default id string hashing strategy and shards "
@@ -441,7 +481,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:262
+#: configuration.xml:285
#, no-c-format
msgid ""
"for subindex 0: /usr/lucene/indexes/Animal00 (shared indexBase but "
@@ -449,7 +489,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:267
+#: configuration.xml:290
#, no-c-format
msgid ""
"for subindex 1: /usr/lucene/indexes/Animal.1 (shared indexBase, default "
@@ -457,7 +497,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:272
+#: configuration.xml:295
#, no-c-format
msgid ""
"for subindex 2: /usr/lucene/indexes/Animal.2 (shared indexBase, default "
@@ -465,7 +505,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:277
+#: configuration.xml:300
#, no-c-format
msgid ""
"for subindex 3: /usr/lucene/shared/Animal03 (overridden indexBase, "
@@ -473,7 +513,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:282
+#: configuration.xml:305
#, no-c-format
msgid ""
"for subindex 4: /usr/lucene/indexes/Animal.4 (shared indexBase, default "
@@ -481,13 +521,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:289
+#: configuration.xml:312
#, no-c-format
msgid "Sharing indexes (two entities into the same directory)"
msgstr ""
#. Tag: para
-#: configuration.xml:292
+#: configuration.xml:315
#, no-c-format
msgid ""
"This is only presented here so that you know the option is available. There "
@@ -495,7 +535,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:296
+#: configuration.xml:319
#, no-c-format
msgid ""
"It is technically possible to store the information of more than one entity "
@@ -503,7 +543,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:302
+#: configuration.xml:325
#, no-c-format
msgid ""
"Configuring the underlying directory providers to point to the same physical "
@@ -516,7 +556,7 @@
msgstr ""
#. Tag: programlisting
-#: configuration.xml:312
+#: configuration.xml:335
#, no-c-format
msgid ""
"<code>hibernate.search.org.hibernate.search.test.shards.Furniture.indexName "
@@ -526,7 +566,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:316
+#: configuration.xml:339
#, no-c-format
msgid ""
"Setting the <code>@Indexed</code> annotation’s <methodname>index</"
@@ -539,13 +579,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:330
+#: configuration.xml:353
#, no-c-format
msgid "Worker configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:332
+#: configuration.xml:355
#, no-c-format
msgid ""
"It is possible to refine how Hibernate Search interacts with Lucene through "
@@ -556,46 +596,47 @@
msgstr ""
#. Tag: para
-#: configuration.xml:338
+#: configuration.xml:361
#, no-c-format
msgid "You can define the worker configuration using the following properties"
msgstr ""
#. Tag: title
-#: configuration.xml:342
+#: configuration.xml:365
#, no-c-format
msgid "worker configuration"
msgstr ""
#. Tag: entry
-#: configuration.xml:347 configuration.xml:633
+#: configuration.xml:370 configuration.xml:733
#, no-c-format
msgid "Property"
msgstr ""
#. Tag: literal
-#: configuration.xml:353
+#: configuration.xml:376
#, no-c-format
msgid "hibernate.search.worker.backend"
msgstr ""
#. Tag: entry
-#: configuration.xml:355
+#: configuration.xml:378
#, no-c-format
msgid ""
"Out of the box support for the Apache Lucene back end and the JMS back end. "
-"Default to <literal>lucene</literal>. Supports also <literal>jms</literal> "
-"and <literal>blackhole</literal>."
+"Default to <literal>lucene</literal>. Supports also <literal>jms</literal>, "
+"<literal>blackhole</literal>, <literal>jgroupsMaster</literal> and "
+"<literal>jgroupsSlave</literal>."
msgstr ""
#. Tag: literal
-#: configuration.xml:361
+#: configuration.xml:385
#, no-c-format
msgid "hibernate.search.worker.execution"
msgstr ""
#. Tag: entry
-#: configuration.xml:363
+#: configuration.xml:387
#, no-c-format
msgid ""
"Supports synchronous and asynchronous execution. Default to "
@@ -604,13 +645,13 @@
msgstr ""
#. Tag: literal
-#: configuration.xml:369
+#: configuration.xml:393
#, no-c-format
msgid "hibernate.search.worker.thread_pool.size"
msgstr ""
#. Tag: entry
-#: configuration.xml:371
+#: configuration.xml:395
#, no-c-format
msgid ""
"Defines the number of threads in the pool. useful only for asynchronous "
@@ -618,13 +659,13 @@
msgstr ""
#. Tag: literal
-#: configuration.xml:376
+#: configuration.xml:400
#, no-c-format
msgid "hibernate.search.worker.buffer_queue.max"
msgstr ""
#. Tag: entry
-#: configuration.xml:378
+#: configuration.xml:402
#, no-c-format
msgid ""
"Defines the maximal number of work queue if the thread poll is starved. "
@@ -633,13 +674,13 @@
msgstr ""
#. Tag: literal
-#: configuration.xml:385
+#: configuration.xml:409
#, no-c-format
msgid "hibernate.search.worker.jndi.*"
msgstr ""
#. Tag: entry
-#: configuration.xml:387
+#: configuration.xml:411
#, no-c-format
msgid ""
"Defines the JNDI properties to initiate the InitialContext (if needed). JNDI "
@@ -647,13 +688,13 @@
msgstr ""
#. Tag: literal
-#: configuration.xml:392
+#: configuration.xml:416
#, no-c-format
msgid "hibernate.search.worker.jms.connection_factory"
msgstr ""
#. Tag: entry
-#: configuration.xml:395
+#: configuration.xml:419
#, no-c-format
msgid ""
"Mandatory for the JMS back end. Defines the JNDI name to lookup the JMS "
@@ -662,27 +703,81 @@
msgstr ""
#. Tag: literal
-#: configuration.xml:402
+#: configuration.xml:426
#, no-c-format
msgid "hibernate.search.worker.jms.queue"
msgstr ""
#. Tag: entry
-#: configuration.xml:404
+#: configuration.xml:428
#, no-c-format
msgid ""
"Mandatory for the JMS back end. Defines the JNDI name to lookup the JMS "
"queue from. The queue will be used to post work messages."
msgstr ""
+#. Tag: literal
+#: configuration.xml:434
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.clusterName"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:436
+#, no-c-format
+msgid "Optional for JGroups back end. Defines the name of JGroups channel."
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:440
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.configurationFile"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:442
+#, no-c-format
+msgid ""
+"Optional JGroups network stack configuration. Defines the name of a JGroups "
+"configuration file, which must exist on classpath."
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:447
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.configurationXml"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:449
+#, no-c-format
+msgid ""
+"Optional JGroups network stack configuration. Defines a String representing "
+"JGroups configuration as XML."
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:454
+#, no-c-format
+msgid "hibernate.search.worker.jgroups.configurationString"
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:456
+#, no-c-format
+msgid ""
+"Optional JGroups network stack configuration. Provides JGroups configuration "
+"in plain text."
+msgstr ""
+
#. Tag: title
-#: configuration.xml:414
+#: configuration.xml:466
#, no-c-format
msgid "JMS Master/Slave configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:416
+#: configuration.xml:468
#, no-c-format
msgid ""
"This section describes in greater detail how to configure the Master / "
@@ -690,19 +785,19 @@
msgstr ""
#. Tag: para
-#: configuration.xml:429
+#: configuration.xml:481
#, no-c-format
msgid "JMS back end configuration."
msgstr ""
#. Tag: title
-#: configuration.xml:433
+#: configuration.xml:485 configuration.xml:548
#, no-c-format
msgid "Slave nodes"
msgstr ""
#. Tag: para
-#: configuration.xml:435
+#: configuration.xml:487
#, no-c-format
msgid ""
"Every index update operation is sent to a JMS queue. Index querying "
@@ -710,13 +805,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:439
+#: configuration.xml:491
#, no-c-format
msgid "JMS Slave configuration"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:441
+#: configuration.xml:493
#, no-c-format
msgid ""
"### slave configuration\n"
@@ -749,25 +844,25 @@
msgstr ""
#. Tag: para
-#: configuration.xml:444
+#: configuration.xml:496
#, no-c-format
msgid "A file system local copy is recommended for faster search results."
msgstr ""
#. Tag: para
-#: configuration.xml:447 configuration.xml:463
+#: configuration.xml:499 configuration.xml:515
#, no-c-format
msgid "The refresh period should be higher that the expected time copy."
msgstr ""
#. Tag: title
-#: configuration.xml:452
+#: configuration.xml:504 configuration.xml:558
#, no-c-format
msgid "Master node"
msgstr ""
#. Tag: para
-#: configuration.xml:454
+#: configuration.xml:506
#, no-c-format
msgid ""
"Every index update operation is taken from a JMS queue and executed. The "
@@ -775,13 +870,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:458
+#: configuration.xml:510
#, no-c-format
msgid "JMS Master configuration"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:460
+#: configuration.xml:512
#, no-c-format
msgid ""
"### master configuration\n"
@@ -806,7 +901,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:466
+#: configuration.xml:518
#, no-c-format
msgid ""
"In addition to the Hibernate Search framework configuration, a Message "
@@ -815,13 +910,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:471
+#: configuration.xml:523
#, no-c-format
msgid "Message Driven Bean processing the indexing queue"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:473
+#: configuration.xml:525
#, no-c-format
msgid ""
"@MessageDriven(activationConfig = {\n"
@@ -849,7 +944,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:476
+#: configuration.xml:528
#, no-c-format
msgid ""
"This example inherits from the abstract JMS controller class available in "
@@ -862,13 +957,166 @@
msgstr ""
#. Tag: title
-#: configuration.xml:489
+#: configuration.xml:541
#, no-c-format
+msgid "JGroups Master/Slave configuration"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:542
+#, no-c-format
+msgid ""
+"Describes how to configure JGroups Master/Slave back end. Configuration "
+"examples illustrated in JMS Master/Slave configuration section (<xref "
+"linkend=\"jms-backend\"/>) also apply here, only a different backend needs "
+"to be set."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:549
+#, no-c-format
+msgid ""
+"Every index update operation is sent through a JGroups channel to the master "
+"node. Index querying operations are executed on a local index copy."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:552
+#, no-c-format
+msgid "JGroups Slave configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:553
+#, no-c-format
+msgid ""
+"### slave configuration\n"
+"## Backend configuration\n"
+"hibernate.search.worker.backend = jgroupsSlave"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:559
+#, no-c-format
+msgid ""
+"Every index update operation is taken from a JGroups channel and executed. "
+"The master index is copied on a regular basis."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:562
+#, no-c-format
+msgid "JGroups Master configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:563
+#, no-c-format
+msgid ""
+"### master configuration\n"
+"## Backend configuration\n"
+"hibernate.search.worker.backend = jgroupsMaster"
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:567
+#, no-c-format
+msgid "JGroups channel configuration"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:568
+#, no-c-format
+msgid ""
+"Optionally configuration for JGroups transport protocols (UDP, TCP) and "
+"channel name can be defined. It can be applied to both master and slave "
+"nodes. There are several ways to configure JGroups transport details. If it "
+"is not defined explicity, configuration found in the <literal> flush-udp."
+"xml</literal> file is used."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:573
+#, no-c-format
+msgid "JGroups transport protocols configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:574
+#, no-c-format
+msgid ""
+"## configuration\n"
+"#udp.xml file needs to be located in the classpath\n"
+"hibernate.search.worker.backend.jgroups.configurationFile = udp.xml\n"
+"\n"
+"#protocol stack configuration provided in XML format\n"
+"hibernate.search.worker.backend.jgroups.configurationXml =\n"
+"\n"
+"<config xmlns=\"urn:org:jgroups\"\n"
+"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+"xsi:schemaLocation=\"urn:org:jgroups file:schema/JGroups-2.8.xsd\">\n"
+"<UDP\n"
+"mcast_addr=\"${jgroups.udp.mcast_addr:228.10.10.10}\"\n"
+"mcast_port=\"${jgroups.udp.mcast_port:45588}\"\n"
+"tos=\"8\"\n"
+"thread_naming_pattern=\"pl\"\n"
+"thread_pool.enabled=\"true\"\n"
+"thread_pool.min_threads=\"2\"\n"
+"thread_pool.max_threads=\"8\"\n"
+"thread_pool.keep_alive_time=\"5000\"\n"
+"thread_pool.queue_enabled=\"false\"\n"
+"thread_pool.queue_max_size=\"100\"\n"
+"thread_pool.rejection_policy=\"Run\"/>\n"
+"<PING timeout=\"1000\" num_initial_members=\"3\"/>\n"
+"<MERGE2 max_interval=\"30000\" min_interval=\"10000\"/>\n"
+"<FD_SOCK/>\n"
+"<FD timeout=\"3000\" max_tries=\"3\"/>\n"
+"<VERIFY_SUSPECT timeout=\"1500\"/>\n"
+"<pbcast.STREAMING_STATE_TRANSFER/>\n"
+"<pbcast.FLUSH timeout=\"0\"/>\n"
+"</config>\n"
+"\n"
+"#protocol stack configuration provided in \"old style\" jgroups format\n"
+"hibernate.search.worker.backend.jgroups.configurationString =\n"
+"\n"
+"UDP(mcast_addr=228.1.2.3;mcast_port=45566;ip_ttl=32):PING(timeout=3000;\n"
+"num_initial_members=6):FD(timeout=5000):VERIFY_SUSPECT(timeout=1500):\n"
+"pbcast.NAKACK(gc_lag=10;retransmit_timeout=3000):UNICAST(timeout=5000):\n"
+"FRAG:pbcast.GMS(join_timeout=3000;shun=false;print_local_addr=true)"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:576
+#, no-c-format
+msgid ""
+"Master and slave nodes communicate over JGroups channel that is identified "
+"by this same name. Name of the channel can be defined explicity, if not "
+"default <literal>HSearchCluster</literal> is used."
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:579
+#, no-c-format
+msgid "JGroups channel name configuration"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:580
+#, no-c-format
+msgid ""
+"## Backend configuration\n"
+"hibernate.search.worker.backend.jgroups.clusterName = Hibernate-Search-"
+"Cluster"
+msgstr ""
+
+#. Tag: title
+#: configuration.xml:586
+#, no-c-format
msgid "Reader strategy configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:491
+#: configuration.xml:588
#, no-c-format
msgid ""
"The different reader strategies are described in <xref linkend=\"search-"
@@ -876,7 +1124,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:497
+#: configuration.xml:594
#, no-c-format
msgid ""
"<literal>shared</literal>: share index readers across several queries. This "
@@ -884,7 +1132,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:502
+#: configuration.xml:599
#, no-c-format
msgid ""
"<literal>not-shared</literal>: create an index reader for each individual "
@@ -892,7 +1140,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:507
+#: configuration.xml:604
#, no-c-format
msgid ""
"The default reader strategy is <literal>shared</literal>. This can be "
@@ -900,32 +1148,32 @@
msgstr ""
#. Tag: programlisting
-#: configuration.xml:510
+#: configuration.xml:607
#, no-c-format
msgid "hibernate.search.reader.strategy = not-shared"
msgstr ""
#. Tag: para
-#: configuration.xml:512
+#: configuration.xml:609
#, no-c-format
msgid ""
"Adding this property switches to the <literal>not-shared</literal> strategy."
msgstr ""
#. Tag: para
-#: configuration.xml:515
+#: configuration.xml:612
#, no-c-format
msgid "Or if you have a custom reader strategy:"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:517
+#: configuration.xml:614
#, no-c-format
msgid "hibernate.search.reader.strategy = my.corp.myapp.CustomReaderProvider"
msgstr ""
#. Tag: para
-#: configuration.xml:519
+#: configuration.xml:616
#, no-c-format
msgid ""
"where <classname>my.corp.myapp.CustomReaderProvider</classname> is the "
@@ -933,30 +1181,30 @@
msgstr ""
#. Tag: title
-#: configuration.xml:524
+#: configuration.xml:621
#, no-c-format
msgid "Enabling Hibernate Search and automatic indexing"
msgstr ""
#. Tag: title
-#: configuration.xml:527
+#: configuration.xml:624
#, no-c-format
msgid "Enabling Hibernate Search"
msgstr ""
#. Tag: para
-#: configuration.xml:529
+#: configuration.xml:626
#, no-c-format
msgid ""
"Hibernate Search is enabled out of the box when using Hibernate Annotations "
"or Hibernate EntityManager. If, for some reason you need to disable it, set "
"<literal>hibernate.search.autoregister_listeners</literal> to false. Note "
-"that there is no performance penalty when the listeners are enabled even "
-"though no entities are indexed."
+"that there is no performance penalty when the listeners are enabled but no "
+"entities are annotated as indexed."
msgstr ""
#. Tag: para
-#: configuration.xml:536
+#: configuration.xml:633
#, no-c-format
msgid ""
"To enable Hibernate Search in Hibernate Core (ie. if you don't use Hibernate "
@@ -966,7 +1214,7 @@
msgstr ""
#. Tag: title
-#: configuration.xml:543
+#: configuration.xml:641
#, no-c-format
msgid ""
"Explicitly enabling Hibernate Search by configuring the "
@@ -974,7 +1222,7 @@
msgstr ""
#. Tag: programlisting
-#: configuration.xml:546
+#: configuration.xml:644
#, no-c-format
msgid ""
"<hibernate-configuration>\n"
@@ -1015,13 +1263,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:551
+#: configuration.xml:649
#, no-c-format
msgid "Automatic indexing"
msgstr ""
#. Tag: para
-#: configuration.xml:553
+#: configuration.xml:651
#, no-c-format
msgid ""
"By default, every time an object is inserted, updated or deleted through "
@@ -1032,19 +1280,19 @@
msgstr ""
#. Tag: para
-#: configuration.xml:559
+#: configuration.xml:657
#, no-c-format
msgid "To disable event based indexing, set"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:561
+#: configuration.xml:659
#, no-c-format
msgid "hibernate.search.indexing_strategy manual"
msgstr ""
#. Tag: para
-#: configuration.xml:564
+#: configuration.xml:662
#, no-c-format
msgid ""
"In most case, the JMS backend provides the best of both world, a lightweight "
@@ -1053,13 +1301,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:573
+#: configuration.xml:671
#, no-c-format
msgid "Tuning Lucene indexing performance"
msgstr ""
#. Tag: para
-#: configuration.xml:575
+#: configuration.xml:673
#, no-c-format
msgid ""
"Hibernate Search allows you to tune the Lucene indexing performance by "
@@ -1071,7 +1319,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:583
+#: configuration.xml:681
#, no-c-format
msgid ""
"There are two sets of parameters allowing for different performance settings "
@@ -1080,12 +1328,13 @@
"literal> keyword: <programlisting>hibernate.search.[default|<"
"indexname>].indexwriter.transaction.<parameter_name></"
"programlisting> When indexing occurs via <literal>FullTextSession.index()</"
-"literal> (see <xref linkend=\"search-batchindex\"/>), the used properties "
-"are those grouped under the <literal>batch</literal> keyword:"
+"literal> or via a <classname>MassIndexer</classname> (see <xref linkend="
+"\"search-batchindex\"/>), the used properties are those grouped under the "
+"<literal>batch</literal> keyword:"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:589
+#: configuration.xml:688
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.batch.<"
@@ -1093,16 +1342,13 @@
msgstr ""
#. Tag: para
-#: configuration.xml:591
+#: configuration.xml:690
#, no-c-format
msgid ""
-"Unless the corresponding <literal>.batch</literal> property is explicitly "
-"set, the value will default to the <literal>.transaction</literal> property. "
"If no value is set for a <literal>.batch</literal> value in a specific shard "
"configuration, Hibernate Search will look at the index section, then at the "
-"default section and after that it will look for a <literal>.transaction</"
-"literal> in the same order: <programlisting>hibernate.search.Animals.2."
-"indexwriter.transaction.max_merge_docs 10\n"
+"default section: <programlisting>hibernate.search.Animals.2.indexwriter."
+"transaction.max_merge_docs 10\n"
"hibernate.search.Animals.2.indexwriter.transaction.merge_factor 20\n"
"hibernate.search.default.indexwriter.batch.max_merge_docs 100</"
"programlisting> This configuration will result in these settings applied to "
@@ -1110,37 +1356,37 @@
msgstr ""
#. Tag: para
-#: configuration.xml:603
+#: configuration.xml:699
#, no-c-format
msgid "<literal>transaction.max_merge_docs</literal> = 10"
msgstr ""
#. Tag: para
-#: configuration.xml:607
+#: configuration.xml:703
#, no-c-format
msgid "<literal>batch.max_merge_docs</literal> = 100"
msgstr ""
#. Tag: para
-#: configuration.xml:611
+#: configuration.xml:707
#, no-c-format
msgid "<literal>transaction.merge_factor</literal> = 20"
msgstr ""
#. Tag: para
-#: configuration.xml:615
+#: configuration.xml:711
#, no-c-format
-msgid "<literal>batch.merge_factor</literal> = 20"
+msgid "<literal>batch.merge_factor</literal> = Lucene default"
msgstr ""
#. Tag: para
-#: configuration.xml:619
+#: configuration.xml:715
#, no-c-format
msgid "All other values will use the defaults defined in Lucene."
msgstr ""
#. Tag: para
-#: configuration.xml:621
+#: configuration.xml:717
#, no-c-format
msgid ""
"The default for all values is to leave them at Lucene's own default, so the "
@@ -1150,28 +1396,58 @@
"refer to the Lucene documentation."
msgstr ""
+#. Tag: para
+#: configuration.xml:723
+#, no-c-format
+msgid ""
+"Previous versions had the <literal>batch</literal> parameters inherit from "
+"<literal>transaction</literal> properties. This needs now to be explicitly "
+"set."
+msgstr ""
+
#. Tag: title
-#: configuration.xml:628
+#: configuration.xml:728
#, no-c-format
msgid "List of indexing performance and behavior properties"
msgstr ""
#. Tag: entry
-#: configuration.xml:637
+#: configuration.xml:737
#, no-c-format
msgid "Default Value"
msgstr ""
#. Tag: literal
-#: configuration.xml:643
+#: configuration.xml:744
#, no-c-format
+msgid "hibernate.search.[default|<indexname>].exclusive_index_use"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:746
+#, no-c-format
msgid ""
+"Set to <literal>true</literal> when no other process will need to write to "
+"the same index: this will enable Hibernate Search to work in exlusive mode "
+"on the index and improve performance in writing changes to the index."
+msgstr ""
+
+#. Tag: entry
+#: configuration.xml:751
+#, no-c-format
+msgid "<literal>false</literal> (releases locks as soon as possible)"
+msgstr ""
+
+#. Tag: literal
+#: configuration.xml:755
+#, no-c-format
+msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
"max_buffered_delete_terms"
msgstr ""
#. Tag: para
-#: configuration.xml:645
+#: configuration.xml:757
#, no-c-format
msgid ""
"Determines the minimal number of delete terms required before the buffered "
@@ -1180,13 +1456,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:650 configuration.xml:660
+#: configuration.xml:762 configuration.xml:772
#, no-c-format
msgid "Disabled (flushes by RAM usage)"
msgstr ""
#. Tag: literal
-#: configuration.xml:654
+#: configuration.xml:766
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
@@ -1194,7 +1470,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:656
+#: configuration.xml:768
#, no-c-format
msgid ""
"Controls the amount of documents buffered in memory during indexing. The "
@@ -1202,7 +1478,7 @@
msgstr ""
#. Tag: literal
-#: configuration.xml:664
+#: configuration.xml:776
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
@@ -1210,7 +1486,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:666
+#: configuration.xml:778
#, no-c-format
msgid ""
"The maximum number of terms that will be indexed for a single field. This "
@@ -1220,7 +1496,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:671
+#: configuration.xml:783
#, no-c-format
msgid ""
"This silently truncates large documents, excluding from the index all terms "
@@ -1231,7 +1507,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:676
+#: configuration.xml:789
#, no-c-format
msgid ""
"If setting this value in <literal>batch</literal> differently than in "
@@ -1240,13 +1516,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:682
+#: configuration.xml:794
#, no-c-format
msgid "10000"
msgstr ""
#. Tag: literal
-#: configuration.xml:686
+#: configuration.xml:798
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
@@ -1254,7 +1530,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:688
+#: configuration.xml:800
#, no-c-format
msgid ""
"Defines the largest number of documents allowed in a segment. Larger values "
@@ -1263,13 +1539,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:693
+#: configuration.xml:805
#, no-c-format
msgid "Unlimited (Integer.MAX_VALUE)"
msgstr ""
#. Tag: literal
-#: configuration.xml:697
+#: configuration.xml:809
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
@@ -1277,13 +1553,13 @@
msgstr ""
#. Tag: para
-#: configuration.xml:699
+#: configuration.xml:811
#, no-c-format
msgid "Controls segment merge frequency and size."
msgstr ""
#. Tag: para
-#: configuration.xml:700
+#: configuration.xml:812
#, no-c-format
msgid ""
"Determines how often segment indexes are merged when insertion occurs. With "
@@ -1296,13 +1572,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:710
+#: configuration.xml:822
#, no-c-format
msgid "<entry>10</entry>"
msgstr ""
#. Tag: literal
-#: configuration.xml:714
+#: configuration.xml:826
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
@@ -1310,7 +1586,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:716
+#: configuration.xml:828
#, no-c-format
msgid ""
"Controls the amount of RAM in MB dedicated to document buffers. When used "
@@ -1318,7 +1594,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:718
+#: configuration.xml:830
#, no-c-format
msgid ""
"Generally for faster indexing performance it's best to flush by RAM usage "
@@ -1326,13 +1602,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:723
+#: configuration.xml:835
#, no-c-format
msgid "16 MB"
msgstr ""
#. Tag: literal
-#: configuration.xml:727
+#: configuration.xml:839
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
@@ -1340,13 +1616,13 @@
msgstr ""
#. Tag: para
-#: configuration.xml:729
+#: configuration.xml:841
#, no-c-format
msgid "Expert: Set the interval between indexed terms."
msgstr ""
#. Tag: para
-#: configuration.xml:730
+#: configuration.xml:842
#, no-c-format
msgid ""
"Large values cause less memory to be used by IndexReader, but slow random-"
@@ -1356,13 +1632,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:736
+#: configuration.xml:848
#, no-c-format
msgid "<entry>128</entry>"
msgstr ""
#. Tag: literal
-#: configuration.xml:740
+#: configuration.xml:852
#, no-c-format
msgid ""
"hibernate.search.[default|<indexname>].indexwriter.[transaction|batch]."
@@ -1370,7 +1646,7 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:742
+#: configuration.xml:854
#, no-c-format
msgid ""
"The advantage of using the compound file format is that less file "
@@ -1381,7 +1657,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:748
+#: configuration.xml:860
#, no-c-format
msgid ""
"Boolean parameter, use \"<literal>true</literal>\" or \"<literal>false</"
@@ -1389,15 +1665,24 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:753
+#: configuration.xml:865
#, no-c-format
msgid "true"
msgstr ""
#. Tag: para
-#: configuration.xml:759
+#: configuration.xml:871
#, no-c-format
msgid ""
+"When your architecture permits it, always set <literal>hibernate.search."
+"default.exclusive_index_use=true</literal> as it greatly improves efficiency "
+"in index writing."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:876
+#, no-c-format
+msgid ""
"To tune the indexing speed it might be useful to time the object loading "
"from database in isolation from the writes to the index. To achieve this set "
"the <literal>blackhole</literal> as worker backend and start you indexing "
@@ -1410,13 +1695,13 @@
msgstr ""
#. Tag: programlisting
-#: configuration.xml:769
+#: configuration.xml:887
#, no-c-format
msgid "hibernate.search.worker.backend blackhole"
msgstr ""
#. Tag: para
-#: configuration.xml:771
+#: configuration.xml:889
#, no-c-format
msgid ""
"The recommended approach is to focus first on optimizing the object loading, "
@@ -1425,7 +1710,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:773
+#: configuration.xml:893
#, no-c-format
msgid ""
"The <literal>blackhole</literal> backend is not meant to be used in "
@@ -1433,13 +1718,13 @@
msgstr ""
#. Tag: title
-#: configuration.xml:781
+#: configuration.xml:900
#, no-c-format
msgid "LockFactory configuration"
msgstr ""
#. Tag: para
-#: configuration.xml:785
+#: configuration.xml:904
#, no-c-format
msgid ""
"Lucene Directories have default locking strategies which work well for most "
@@ -1448,7 +1733,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:789
+#: configuration.xml:910
#, no-c-format
msgid ""
"Some of these locking strategies require a filesystem level lock and may be "
@@ -1457,7 +1742,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:795
+#: configuration.xml:916
#, no-c-format
msgid ""
"To select a locking factory, set the <literal>hibernate.search.<index>."
@@ -1470,31 +1755,31 @@
msgstr ""
#. Tag: title
-#: configuration.xml:804
+#: configuration.xml:925
#, no-c-format
msgid "List of available LockFactory implementations"
msgstr ""
#. Tag: entry
-#: configuration.xml:809
+#: configuration.xml:930
#, no-c-format
msgid "name"
msgstr ""
#. Tag: entry
-#: configuration.xml:819
+#: configuration.xml:940
#, no-c-format
msgid "simple"
msgstr ""
#. Tag: entry
-#: configuration.xml:821
+#: configuration.xml:942
#, no-c-format
msgid "org.apache.lucene.store.SimpleFSLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:824
+#: configuration.xml:945
#, no-c-format
msgid ""
"Safe implementation based on Java's File API, it marks the usage of the "
@@ -1502,7 +1787,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:827
+#: configuration.xml:948
#, no-c-format
msgid ""
"If for some reason you had to kill your application, you will need to remove "
@@ -1510,7 +1795,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:830
+#: configuration.xml:951
#, no-c-format
msgid ""
"This is the default implementation for <literal>FSDirectoryProvider</"
@@ -1519,19 +1804,19 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:837
+#: configuration.xml:958
#, no-c-format
msgid "native"
msgstr ""
#. Tag: entry
-#: configuration.xml:839
+#: configuration.xml:960
#, no-c-format
msgid "org.apache.lucene.store.NativeFSLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:842
+#: configuration.xml:963
#, no-c-format
msgid ""
"As does <literal>simple</literal> this also marks the usage of the index by "
@@ -1540,25 +1825,25 @@
msgstr ""
#. Tag: para
-#: configuration.xml:847
+#: configuration.xml:968
#, no-c-format
msgid "This implementation has known problems on NFS."
msgstr ""
#. Tag: entry
-#: configuration.xml:852
+#: configuration.xml:973
#, no-c-format
msgid "single"
msgstr ""
#. Tag: entry
-#: configuration.xml:854
+#: configuration.xml:975
#, no-c-format
msgid "org.apache.lucene.store.SingleInstanceLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:857
+#: configuration.xml:978
#, no-c-format
msgid ""
"This LockFactory doesn't use a file marker but is a Java object lock held in "
@@ -1567,7 +1852,7 @@
msgstr ""
#. Tag: para
-#: configuration.xml:862
+#: configuration.xml:983
#, no-c-format
msgid ""
"This is the default implementation for <literal>RAMDirectoryProvider</"
@@ -1575,13 +1860,13 @@
msgstr ""
#. Tag: entry
-#: configuration.xml:870
+#: configuration.xml:991
#, no-c-format
msgid "org.apache.lucene.store.NoLockFactory"
msgstr ""
#. Tag: para
-#: configuration.xml:873
+#: configuration.xml:994
#, no-c-format
msgid ""
"All changes to this index are not coordinated by any lock; test your "
@@ -1589,13 +1874,13 @@
msgstr ""
#. Tag: section
-#: configuration.xml:880
+#: configuration.xml:1001
#, no-c-format
msgid "Configuration example:"
msgstr ""
#. Tag: programlisting
-#: configuration.xml:884
+#: configuration.xml:1005
#, no-c-format
msgid ""
"hibernate.search.default.locking_strategy simple\n"
@@ -1603,3 +1888,94 @@
"hibernate.search.Books.locking_strategy org.custom.components."
"MyLockingFactory"
msgstr ""
+
+#. Tag: title
+#: configuration.xml:1015
+#, no-c-format
+msgid "Exception Handling Configuration"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1017
+#, no-c-format
+msgid ""
+"Hibernate Search allows you to configure how exceptions are handled during "
+"the indexing process. If no configuration is provided then exceptions are "
+"logged to the log output by default. It is possible to explicitly declare "
+"the exception logging mechanism as seen below:"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1022
+#, no-c-format
+msgid "hibernate.search.error_handler log"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1022
+#, no-c-format
+msgid ""
+"The default exception handling occurs for both synchronous and asynchronous "
+"indexing. Hibernate Search provides an easy mechanism to override the "
+"default error handling implementation."
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1027
+#, no-c-format
+msgid ""
+"In order to provide your own implementation you must implement the "
+"<code>ErrorHandler</code> interface, which provides <code>handle "
+"( ErrorContext context )</code> method. The <code>ErrorContext</code> "
+"provides a reference to the primary <code>LuceneWork</code> that failed, the "
+"underlying exception and any subsequent <code>LuceneWork</code> that could "
+"not be processed due to the primary exception."
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1034
+#, no-c-format
+msgid ""
+"public interface ErrorContext {\n"
+" List<LuceneWork> getFailingOperations();\n"
+" LuceneWork getOperationAtFault();\n"
+" Throwable getThrowable();\n"
+" boolean hasErrors();\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1036
+#, no-c-format
+msgid ""
+"The following provides an example implementation of <code>ErrorHandler</"
+"code>:"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1039
+#, no-c-format
+msgid ""
+"public class CustomErrorHandler implements ErrorHandler {\n"
+" public void handle ( ErrorContext context ) {\n"
+" ...\n"
+" //publish error context to some internal error handling system\n"
+" ...\n"
+" }\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: configuration.xml:1039
+#, no-c-format
+msgid ""
+"To register this error handler with Hibernate Search you must declare the "
+"<code>CustomErrorHandler</code> fully qualified classname in the "
+"configuration properties:"
+msgstr ""
+
+#. Tag: programlisting
+#: configuration.xml:1043
+#, no-c-format
+msgid "hibernate.search.error_handler CustomerErrorHandler"
+msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/getting-started.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/getting-started.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/getting-started.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1,29 +1,30 @@
-# Chinese translations for PACKAGE package.
-# Automatically generated, 2009.
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
-"PO-Revision-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
#. Tag: title
-#: getting-started.xml:30
+#: getting-started.xml:31
#, no-c-format
msgid "Getting started"
msgstr ""
#. Tag: para
-#: getting-started.xml:32
+#: getting-started.xml:33
#, no-c-format
msgid ""
-"Welcome to Hibernate Search! The following chapter will guide you through "
+"Welcome to Hibernate Search. The following chapter will guide you through "
"the initial steps required to integrate Hibernate Search into an existing "
"Hibernate enabled application. In case you are a Hibernate new timer we "
"recommend you start <ulink url=\"http://hibernate.org/152.html\">here</"
@@ -31,25 +32,25 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:39
+#: getting-started.xml:40
#, no-c-format
msgid "System Requirements"
msgstr ""
#. Tag: title
-#: getting-started.xml:42
+#: getting-started.xml:43
#, no-c-format
msgid "System requirements"
msgstr ""
#. Tag: entry
-#: getting-started.xml:47
+#: getting-started.xml:48
#, no-c-format
msgid "Java Runtime"
msgstr ""
#. Tag: entry
-#: getting-started.xml:49
+#: getting-started.xml:50
#, no-c-format
msgid ""
"A JDK or JRE version <emphasis>5</emphasis> or greater. You can download a "
@@ -58,32 +59,31 @@
msgstr ""
#. Tag: entry
-#: getting-started.xml:55
+#: getting-started.xml:56
#, no-c-format
msgid "Hibernate Search"
msgstr ""
#. Tag: entry
-#: getting-started.xml:57
+#: getting-started.xml:58
#, no-c-format
msgid ""
"<literal>hibernate-search.jar</literal> and all runtime dependencies from "
-"the <literal>lib</literal> directory of the Hibernate Search distribution. "
-"Please refer to <filename>README.txt </filename>in the lib directory to "
-"understand which dependencies are required."
+"the <literal>dist/lib</literal> directory of the Hibernate Search "
+"distribution."
msgstr ""
#. Tag: entry
-#: getting-started.xml:65
+#: getting-started.xml:64
#, no-c-format
msgid "Hibernate Core"
msgstr ""
#. Tag: entry
-#: getting-started.xml:67
+#: getting-started.xml:66
#, no-c-format
msgid ""
-"This instructions have been tested against Hibernate 3.3.x. You will need "
+"This instructions have been tested against Hibernate 3.5. You will need "
"<literal>hibernate-core.jar</literal> and its transitive dependencies from "
"the <literal>lib</literal> directory of the distribution. Refer to "
"<literal>README.txt</literal> in the <literal>lib</literal> directory of the "
@@ -91,13 +91,13 @@
msgstr ""
#. Tag: entry
-#: getting-started.xml:76
+#: getting-started.xml:75
#, no-c-format
msgid "Hibernate Annotations"
msgstr ""
#. Tag: entry
-#: getting-started.xml:78
+#: getting-started.xml:77
#, no-c-format
msgid ""
"Even though Hibernate Search can be used without Hibernate Annotations the "
@@ -106,131 +106,152 @@
"configuration could also be expressed in xml or code. However, Hibernate "
"Search itself has its own set of annotations (<emphasis>@Indexed, "
"@DocumentId, @Field,...</emphasis>) for which there exists so far no "
-"alternative configuration. The tutorial is tested against version 3.4.x of "
-"Hibernate Annotations."
+"alternative configuration. The tutorial is tested against version 3.5 of "
+"Hibernate Annotations (part of the Hibernate Core distribution)."
msgstr ""
#. Tag: para
#: getting-started.xml:92
#, no-c-format
-msgid ""
-"You can download all dependencies from the Hibernate <ulink url=\"http://www."
-"hibernate.org/6.html\">download site</ulink>. You can also verify the "
-"dependency versions against the <ulink url=\"http://www.hibernate.org/6."
-"html#A3\">Hibernate Compatibility Matrix</ulink>."
+msgid "You can download all dependencies from the Hibernate download site."
msgstr ""
#. Tag: title
-#: getting-started.xml:100
+#: getting-started.xml:97
#, no-c-format
msgid "Using Maven"
msgstr ""
#. Tag: para
-#: getting-started.xml:102
+#: getting-started.xml:99
#, no-c-format
msgid ""
"Instead of managing all dependencies manually, maven users have the "
-"possibility to use the <ulink url=\"http://repository.jboss.com/maven2"
-"\">JBoss maven repository</ulink>. Just add the JBoss repository url to the "
-"<emphasis>repositories</emphasis> section of your <filename>pom.xml</"
-"filename> or <filename>settings.xml</filename>:"
+"possibility to use the <ulink url=\"https://repository.jboss.org/nexus/"
+"content/groups/public/\">JBoss maven repository</ulink>. Add the following "
+"to your Maven <filename>settings.xml file</filename> (see also <ulink url="
+"\"http://community.jboss.org/wiki/MavenGettingStarted-Users\">Maven Getting "
+"Started</ulink>):"
msgstr ""
#. Tag: title
-#: getting-started.xml:110
+#: getting-started.xml:108
#, no-c-format
msgid "Adding the JBoss maven repository to <filename>settings.xml</filename>"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:113
+#: getting-started.xml:111
#, no-c-format
msgid ""
-"<repository>\n"
-" <id>repository.jboss.org</id>\n"
-" <name>JBoss Maven Repository</name>\n"
-" <url>http://repository.jboss.org/maven2</url>\n"
-" <layout>default</layout>\n"
-"</repository>"
+"<settings>\n"
+" ...\n"
+" <profiles>\n"
+" ...\n"
+" <profile>\n"
+" <id>jboss-public-repository</id>\n"
+" <repositories>\n"
+" <repository>\n"
+" <id>jboss-public-repository-group</id>\n"
+" <name>JBoss Public Maven Repository Group</name>\n"
+" <url>https://repository.jboss.org/nexus/content/groups/"
+"public/</url>\n"
+" <layout>default</layout>\n"
+" <releases>\n"
+" <enabled>true</enabled>\n"
+" <updatePolicy>never</updatePolicy>\n"
+" </releases>\n"
+" <snapshots>\n"
+" <enabled>true</enabled>\n"
+" <updatePolicy>never</updatePolicy>\n"
+" </snapshots>\n"
+" </repository>\n"
+" </repositories>\n"
+" <pluginRepositories>\n"
+" <pluginRepository>\n"
+" <id>jboss-public-repository-group</id>\n"
+" <name>JBoss Public Maven Repository Group</name>\n"
+" <url>https://repository.jboss.org/nexus/content/groups/"
+"public/</url>\n"
+" <layout>default</layout>\n"
+" <releases>\n"
+" <enabled>true</enabled>\n"
+" <updatePolicy>never</updatePolicy>\n"
+" </releases>\n"
+" <snapshots>\n"
+" <enabled>true</enabled>\n"
+" <updatePolicy>never</updatePolicy>\n"
+" </snapshots>\n"
+" </pluginRepository>\n"
+" </pluginRepositories>\n"
+" </profile>\n"
+"\n"
+" </profiles>\n"
+"\n"
+" <activeProfiles>\n"
+" <activeProfile>jboss-public-repository</activeProfile>\n"
+" </activeProfiles>\n"
+" ...\n"
+"</settings>"
msgstr ""
#. Tag: para
-#: getting-started.xml:116
+#: getting-started.xml:114
#, no-c-format
msgid "Then add the following dependencies to your pom.xml:"
msgstr ""
#. Tag: title
-#: getting-started.xml:119
+#: getting-started.xml:117
#, no-c-format
msgid "Maven dependencies for Hibernate Search"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:121
+#: getting-started.xml:119
#, no-c-format
msgid ""
"<dependency>\n"
" <groupId>org.hibernate</groupId>\n"
" <artifactId>hibernate-search</artifactId>\n"
-" <version>3.1.0.GA</version>\n"
+" <version>&version;</version>\n"
"</dependency>\n"
"<dependency>\n"
" <groupId>org.hibernate</groupId>\n"
-" <artifactId>hibernate-annotations</artifactId>\n"
-" <version>3.4.0.GA</version>\n"
-"</dependency>\n"
-"<dependency>\n"
-" <groupId>org.hibernate</groupId>\n"
" <artifactId>hibernate-entitymanager</artifactId>\n"
-" <version>3.4.0.GA</version>\n"
-"</dependency>\n"
-"<dependency>\n"
-" <groupId>org.apache.solr</groupId>\n"
-" <artifactId>solr-common</artifactId>\n"
-" <version>1.3.0</version>\n"
-"</dependency>\n"
-"<dependency>\n"
-" <groupId>org.apache.solr</groupId>\n"
-" <artifactId>solr-core</artifactId>\n"
-" <version>1.3.0</version>\n"
-"</dependency>\n"
-"<dependency>\n"
-" <groupId>org.apache.lucene</groupId>\n"
-" <artifactId>lucene-snowball</artifactId>\n"
-" <version>2.4.0</version>\n"
+" <version>3.5.0-Final</version>\n"
"</dependency>"
msgstr ""
#. Tag: para
-#: getting-started.xml:124
+#: getting-started.xml:122
#, no-c-format
msgid ""
-"Not all dependencies are required. Only the <emphasis>hibernate-search</"
-"emphasis> dependency is mandatory. This dependency, together with its "
-"required transitive dependencies, contain all required classes needed to use "
-"Hibernate Search. <emphasis>hibernate-annotations</emphasis> is only needed "
-"if you want to use annotations to configure your domain model as we do in "
-"this tutorial. However, even if you choose not to use Hibernate Annotations "
-"you still have to use the Hibernate Search specific annotations, which are "
-"bundled with the hibernate-search jar file, to configure your Lucene index. "
-"Currently there is no XML configuration available for Hibernate Search. "
-"<emphasis>hibernate-entitymanager</emphasis> is required if you want to use "
-"Hibernate Search in conjunction with JPA. The Solr dependencies are needed "
-"if you want to utilize Solr's analyzer framework. More about this later. And "
-"finally, the <literal>lucene-snowball</literal> dependency is needed if you "
-"want to use Lucene's snowball stemmer."
+"Only the <emphasis>hibernate-search</emphasis> dependency is mandatory, "
+"because it contains together with its required transitive dependencies all "
+"required classes needed to use Hibernate Search.<emphasis> hibernate-"
+"entitymanager</emphasis> is only required if you want to use Hibernate "
+"Search in conjunction with JPA."
msgstr ""
+#. Tag: para
+#: getting-started.xml:129
+#, no-c-format
+msgid ""
+"There is no XML configuration available for Hibernate Search but we provide "
+"a powerful programmatic mapping API that elegantly replace this kind of "
+"deployment form (see <xref linkend=\"hsearch-mapping-programmaticapi\"/> for "
+"more information)."
+msgstr ""
+
#. Tag: title
-#: getting-started.xml:142
+#: getting-started.xml:138
#, no-c-format
msgid "Configuration"
msgstr ""
#. Tag: para
-#: getting-started.xml:144
+#: getting-started.xml:140
#, no-c-format
msgid ""
"Once you have downloaded and added all required dependencies to your "
@@ -244,7 +265,7 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:155
+#: getting-started.xml:151
#, no-c-format
msgid ""
"Basic configuration options to be added to <literal><filename>hibernate."
@@ -253,20 +274,20 @@
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:160
+#: getting-started.xml:156
#, no-c-format
msgid ""
"...\n"
"<property name=\"hibernate.search.default.directory_provider\" \n"
-" value=\"org.hibernate.search.store.FSDirectoryProvider\"/> \n"
+" value=\"org.hibernate.search.store.FSDirectoryProvider\"/> \n"
"\n"
-"<property name=\"hibernate.search.default.indexBase\" value=\"/var/lucene/"
-"indexes\"/> \n"
+"<property name=\"hibernate.search.default.indexBase\" \n"
+" value=\"/var/lucene/indexes\"/> \n"
"..."
msgstr ""
#. Tag: para
-#: getting-started.xml:163
+#: getting-started.xml:159
#, no-c-format
msgid ""
"First you have to tell Hibernate Search which <classname>DirectoryProvider</"
@@ -287,7 +308,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:180
+#: getting-started.xml:176
#, no-c-format
msgid ""
"Lets assume that your application contains the Hibernate managed classes "
@@ -297,7 +318,7 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:187
+#: getting-started.xml:183
#, no-c-format
msgid ""
"Example entities Book and Author before adding Hibernate Search specific "
@@ -305,7 +326,7 @@
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:190
+#: getting-started.xml:186
#, no-c-format
msgid ""
"package example;\n"
@@ -326,8 +347,7 @@
"\n"
" private Date publicationDate;\n"
" \n"
-" public Book() {\n"
-" } \n"
+" public Book() {} \n"
" \n"
" // standard getters/setters follow here\n"
" ...\n"
@@ -335,7 +355,7 @@
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:192
+#: getting-started.xml:188
#, no-c-format
msgid ""
"package example;\n"
@@ -349,8 +369,7 @@
"\n"
" private String name;\n"
"\n"
-" public Author() {\n"
-" } \n"
+" public Author() {} \n"
" \n"
" // standard getters/setters follow here\n"
" ...\n"
@@ -358,7 +377,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:195
+#: getting-started.xml:191
#, no-c-format
msgid ""
"To achieve this you have to add a few annotations to the <classname>Book</"
@@ -373,7 +392,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:206
+#: getting-started.xml:202
#, no-c-format
msgid ""
"Next you have to mark the fields you want to make searchable. Let's start "
@@ -393,7 +412,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:222
+#: getting-started.xml:218
#, no-c-format
msgid ""
"Without projections, Hibernate Search will per default execute a Lucene "
@@ -406,7 +425,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:230
+#: getting-started.xml:226
#, no-c-format
msgid ""
"After this short look under the hood let's go back to annotating the "
@@ -422,7 +441,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:241
+#: getting-started.xml:237
#, no-c-format
msgid ""
"This leaves us with <literal>@IndexedEmbedded. </literal>This annotation is "
@@ -439,7 +458,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:253
+#: getting-started.xml:249
#, no-c-format
msgid ""
"These settings should be sufficient for now. For more details on entity "
@@ -447,13 +466,13 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:257
+#: getting-started.xml:253
#, no-c-format
msgid "Example entities after adding Hibernate Search annotations"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:260
+#: getting-started.xml:256
#, no-c-format
msgid ""
"package example;\n"
@@ -464,7 +483,6 @@
"\n"
" @Id\n"
" @GeneratedValue\n"
-" <emphasis role=\"bold\">@DocumentId</emphasis>\n"
" private Integer id;\n"
" \n"
" <emphasis role=\"bold\">@Field(index=Index.TOKENIZED, store=Store.NO)</"
@@ -493,7 +511,7 @@
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:262
+#: getting-started.xml:258
#, no-c-format
msgid ""
"package example;\n"
@@ -518,72 +536,55 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:267
+#: getting-started.xml:263
#, no-c-format
msgid "Indexing"
msgstr ""
#. Tag: para
-#: getting-started.xml:269
+#: getting-started.xml:265
#, no-c-format
msgid ""
"Hibernate Search will transparently index every entity persisted, updated or "
-"removed through Hibernate Core. However, you have to trigger an initial "
-"indexing to populate the Lucene index with the data already present in your "
-"database. Once you have added the above properties and annotations it is "
-"time to trigger an initial batch index of your books. You can achieve this "
-"by using one of the following code snippets (see also <xref linkend=\"search-"
-"batchindex\"/>):"
+"removed through Hibernate Core. However, you have to create an initial "
+"Lucene index for the data already present in your database. Once you have "
+"added the above properties and annotations it is time to trigger an initial "
+"batch index of your books. You can achieve this by using one of the "
+"following code snippets (see also <xref linkend=\"search-batchindex\"/>):"
msgstr ""
#. Tag: title
-#: getting-started.xml:278
+#: getting-started.xml:274
#, no-c-format
msgid "Using Hibernate Session to index data"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:280
+#: getting-started.xml:276
#, no-c-format
msgid ""
"FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
-"Transaction tx = fullTextSession.beginTransaction();\n"
-"\n"
-"List books = session.createQuery(\"from Book as book\").list();\n"
-"for (Book book : books) {\n"
-" <emphasis role=\"bold\">fullTextSession.index(book);</emphasis>\n"
-"}\n"
-"\n"
-"tx.commit(); //index is written at commit time"
+"fullTextSession.createIndexer().startAndWait();"
msgstr ""
#. Tag: title
-#: getting-started.xml:284
+#: getting-started.xml:280
#, no-c-format
msgid "Using JPA to index data"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:286
+#: getting-started.xml:282
#, no-c-format
msgid ""
"EntityManager em = entityManagerFactory.createEntityManager();\n"
"FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager"
"(em);\n"
-"em.getTransaction().begin();\n"
-"\n"
-"List books = em.createQuery(\"select book from Book as book\").getResultList"
-"();\n"
-"for (Book book : books) {\n"
-" <emphasis role=\"bold\">fullTextEntityManager.index(book);</emphasis>\n"
-"} \n"
-"\n"
-"em.getTransaction().commit();\n"
-"em.close();"
+"fullTextEntityManager.createIndexer().startAndWait();"
msgstr ""
#. Tag: para
-#: getting-started.xml:289
+#: getting-started.xml:285
#, no-c-format
msgid ""
"After executing the above code, you should be able to see a Lucene index "
@@ -593,13 +594,13 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:297
+#: getting-started.xml:293
#, no-c-format
msgid "Searching"
msgstr ""
#. Tag: para
-#: getting-started.xml:299
+#: getting-started.xml:295
#, no-c-format
msgid ""
"Now it is time to execute a first search. The general approach is to create "
@@ -610,13 +611,13 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:307
+#: getting-started.xml:303
#, no-c-format
msgid "Using Hibernate Session to create and execute a search"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:309
+#: getting-started.xml:305
#, no-c-format
msgid ""
"FullTextSession fullTextSession = Search.getFullTextSession(session);\n"
@@ -641,18 +642,18 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:313
+#: getting-started.xml:309
#, no-c-format
msgid "Using JPA to create and execute a search"
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:315
+#: getting-started.xml:311
#, no-c-format
msgid ""
"EntityManager em = entityManagerFactory.createEntityManager();\n"
"FullTextEntityManager fullTextEntityManager = \n"
-" org.hibernate.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
+" org.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
"em.getTransaction().begin();\n"
"\n"
"// create native Lucene query\n"
@@ -674,13 +675,13 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:320
+#: getting-started.xml:316
#, no-c-format
msgid "Analyzer"
msgstr ""
#. Tag: para
-#: getting-started.xml:322
+#: getting-started.xml:318
#, no-c-format
msgid ""
"Let's make things a little more interesting now. Assume that one of your "
@@ -694,7 +695,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:333
+#: getting-started.xml:329
#, no-c-format
msgid ""
"Setting the <literal>hibernate.search.analyzer</literal> property in the "
@@ -702,7 +703,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:339
+#: getting-started.xml:335
#, no-c-format
msgid ""
"Setting the <literal><literal>@Analyzer</literal></literal> annotation at "
@@ -710,7 +711,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:344
+#: getting-started.xml:340
#, no-c-format
msgid ""
"Setting the <literal>@<literal>Analyzer</literal></literal> annotation at "
@@ -718,7 +719,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:349
+#: getting-started.xml:345
#, no-c-format
msgid ""
"When using the <literal>@Analyzer</literal> annotation one can either "
@@ -728,15 +729,11 @@
"factories approach is utilized. To find out more about the factory classes "
"available you can either browse the Solr JavaDoc or read the corresponding "
"section on the <ulink url=\"http://wiki.apache.org/solr/"
-"AnalyzersTokenizersTokenFilters\">Solr Wiki.</ulink> Note that depending on "
-"the chosen factory class additional libraries on top of the Solr "
-"dependencies might be required. For example, the "
-"<classname>PhoneticFilterFactory</classname> depends on <ulink url=\"http://"
-"commons.apache.org/codec\">commons-codec</ulink>."
+"AnalyzersTokenizersTokenFilters\">Solr Wiki.</ulink>"
msgstr ""
#. Tag: para
-#: getting-started.xml:362
+#: getting-started.xml:355
#, no-c-format
msgid ""
"In the example below a <classname>StandardTokenizerFactory</classname> is "
@@ -749,7 +746,7 @@
msgstr ""
#. Tag: para
-#: getting-started.xml:372
+#: getting-started.xml:365
#, no-c-format
msgid ""
"Generally, when using the Solr framework you have to start with a tokenizer "
@@ -757,7 +754,7 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:376
+#: getting-started.xml:369
#, no-c-format
msgid ""
"Using <classname>@AnalyzerDef</classname> and the Solr framework to define "
@@ -765,7 +762,7 @@
msgstr ""
#. Tag: programlisting
-#: getting-started.xml:379
+#: getting-started.xml:372
#, no-c-format
msgid ""
"package example;\n"
@@ -815,53 +812,17 @@
msgstr ""
#. Tag: title
-#: getting-started.xml:384
+#: getting-started.xml:377
#, no-c-format
msgid "What's next"
msgstr ""
#. Tag: para
-#: getting-started.xml:386
+#: getting-started.xml:379
#, no-c-format
msgid ""
-"The above paragraphs hopefully helped you getting an overview of Hibernate "
-"Search. Using the maven archetype plugin and the following command you can "
-"create an initial runnable maven project structure populated with the "
-"example code of this tutorial."
-msgstr ""
-
-#. Tag: title
-#: getting-started.xml:392
-#, no-c-format
-msgid "Using the Maven archetype to create tutorial sources"
-msgstr ""
-
-#. Tag: programlisting
-#: getting-started.xml:394
-#, no-c-format
-msgid ""
-"mvn archetype:create \\ \n"
-" -DarchetypeGroupId=org.hibernate \\\n"
-" -DarchetypeArtifactId=hibernate-search-quickstart \\ \n"
-" -DarchetypeVersion=3.1.0.GA \\\n"
-" -DgroupId=my.company -DartifactId=quickstart"
-msgstr ""
-
-#. Tag: para
-#: getting-started.xml:397
-#, no-c-format
-msgid ""
-"Using the maven project you can execute the examples, inspect the file "
-"system based index and search and retrieve a list of managed objects. Just "
-"run <emphasis>mvn package</emphasis> to compile the sources and run the unit "
-"tests."
-msgstr ""
-
-#. Tag: para
-#: getting-started.xml:402
-#, no-c-format
-msgid ""
-"The next step after this tutorial is to get more familiar with the overall "
+"The above paragraphs helped you getting an overview of Hibernate Search. The "
+"next step after this tutorial is to get more familiar with the overall "
"architecture of Hibernate Search (<xref linkend=\"search-architecture\"/>) "
"and explore the basic features in more detail. Two topics which were only "
"briefly touched in this tutorial were analyzer configuration (<xref linkend="
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/lucene-native.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/lucene-native.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/lucene-native.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1,17 +1,18 @@
-# Chinese translations for PACKAGE package.
-# Automatically generated, 2009.
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
-"PO-Revision-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
#. Tag: title
#: lucene-native.xml:30
@@ -318,3 +319,13 @@
"case your custom implementation of the method <methodname>tf(float freq)</"
"methodname> should return 1.0."
msgstr ""
+
+#. Tag: para
+#: lucene-native.xml:196
+#, no-c-format
+msgid ""
+"When two entities share the same index they must declare the same "
+"<classname>Similarity</classname> implementation. Classes in the same class "
+"hierarchy always share the index, so it's not allowed to override the "
+"<classname>Similarity</classname> implementation in a subtype."
+msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/mapping.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/mapping.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/mapping.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1,17 +1,18 @@
-# Chinese translations for PACKAGE package.
-# Automatically generated, 2009.
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 16:41+0000\n"
-"PO-Revision-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
#. Tag: title
#: mapping.xml:30
@@ -26,10 +27,10 @@
"All the metadata information needed to index entities is described through "
"annotations. There is no need for xml mapping files. In fact there is "
"currently no xml configuration option available (see <ulink url=\"http://"
-"opensource.atlassian.com/projects/hibernate/browse/HSEARCH-210\">HSEARCH-"
-"210</ulink>). You can still use hibernate mapping files for the basic "
-"Hibernate configuration, but the Search specific configuration has to be "
-"expressed via annotations."
+"opensource.atlassian.com/projects/hibernate/browse/"
+"HSEARCH-210\">HSEARCH-210</ulink>). You can still use Hibernate mapping "
+"files for the basic Hibernate configuration, but the Hibernate Search "
+"specific configuration has to be expressed via annotations."
msgstr ""
#. Tag: title
@@ -94,9 +95,9 @@
msgid ""
"For each property (or attribute) of your entity, you have the ability to "
"describe how it will be indexed. The default (no annotation present) means "
-"that the property is completely ignored by the indexing process. "
-"<literal>@Field</literal> does declare a property as indexed. When indexing "
-"an element to a Lucene document you can specify how it is indexed:"
+"that the property is ignored by the indexing process. <literal>@Field</"
+"literal> does declare a property as indexed. When indexing an element to a "
+"Lucene document you can specify how it is indexed:"
msgstr ""
#. Tag: para
@@ -249,13 +250,18 @@
msgid ""
"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 tokenizing a date field probably not. Note that "
-"fields used for sorting must not be tokenized."
+"tokenize a text field, but probably not a date field."
msgstr ""
#. Tag: para
-#: mapping.xml:184
+#: mapping.xml:182
#, no-c-format
+msgid "Fields used for sorting must not be tokenized."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:185
+#, no-c-format
msgid ""
"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 "
@@ -266,7 +272,7 @@
msgstr ""
#. Tag: title
-#: mapping.xml:193
+#: mapping.xml:194
#, no-c-format
msgid ""
"Adding <classname>@DocumentId</classname> ad <classname>@Field</classname> "
@@ -274,7 +280,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:196
+#: mapping.xml:197
#, no-c-format
msgid ""
"@Entity\n"
@@ -297,23 +303,22 @@
msgstr ""
#. Tag: para
-#: mapping.xml:199
+#: mapping.xml:200
#, no-c-format
msgid ""
-"The above annotations define an index with three fields: <literal>id</"
-"literal> , <literal>Abstract</literal> and <literal>text</literal> . Note "
-"that by default the field name is decapitalized, following the JavaBean "
-"specification"
+"define an index with three fields: <literal>id</literal> , "
+"<literal>Abstract</literal> and <literal>text</literal> . Note that by "
+"default the field name is decapitalized, following the JavaBean specification"
msgstr ""
#. Tag: title
-#: mapping.xml:206
+#: mapping.xml:207
#, no-c-format
msgid "Mapping properties multiple times"
msgstr ""
#. Tag: para
-#: mapping.xml:208
+#: mapping.xml:209
#, no-c-format
msgid ""
"Sometimes one has to map a property multiple times per index, with slightly "
@@ -325,13 +330,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:216
+#: mapping.xml:217
#, no-c-format
msgid "Using @Fields to map a property multiple times"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:218
+#: mapping.xml:219
#, no-c-format
msgid ""
"@Entity\n"
@@ -351,43 +356,43 @@
msgstr ""
#. Tag: para
-#: mapping.xml:221
+#: mapping.xml:222
#, no-c-format
msgid ""
-"The field <literal>summary</literal> is indexed twice, once as "
-"<literal>summary</literal> in a tokenized way, and once as "
-"<literal>summary_forSort</literal> in an untokenized way. @Field supports 2 "
-"attributes useful when @Fields is used:"
+"In <xref linkend=\"example-fields-annotation\"/> the field <literal>summary</"
+"literal> is indexed twice, once as <literal>summary</literal> in a tokenized "
+"way, and once as <literal>summary_forSort</literal> in an untokenized way. "
+"@Field supports 2 attributes useful when @Fields is used:"
msgstr ""
#. Tag: para
-#: mapping.xml:228
+#: mapping.xml:230
#, no-c-format
msgid ""
"analyzer: defines a @Analyzer annotation per field rather than per property"
msgstr ""
#. Tag: para
-#: mapping.xml:233
+#: mapping.xml:235
#, no-c-format
msgid ""
"bridge: defines a @FieldBridge annotation per field rather than per property"
msgstr ""
#. Tag: para
-#: mapping.xml:238
+#: mapping.xml:240
#, no-c-format
msgid "See below for more information about analyzers and field bridges."
msgstr ""
#. Tag: title
-#: mapping.xml:243
+#: mapping.xml:245
#, no-c-format
msgid "Embedded and associated objects"
msgstr ""
#. Tag: para
-#: mapping.xml:245
+#: mapping.xml:247
#, no-c-format
msgid ""
"Associated objects as well as embedded objects can be indexed as part of the "
@@ -399,13 +404,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:253
+#: mapping.xml:255
#, no-c-format
msgid "Using @IndexedEmbedded to index associations"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:255
+#: mapping.xml:257
#, no-c-format
msgid ""
"@Entity\n"
@@ -445,7 +450,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:258
+#: mapping.xml:260
#, no-c-format
msgid ""
"In this example, the place fields will be indexed in the <literal>Place</"
@@ -456,7 +461,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:265
+#: mapping.xml:267
#, no-c-format
msgid ""
"Be careful. Because the data is denormalized in the Lucene index when using "
@@ -470,7 +475,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:275
+#: mapping.xml:277
#, no-c-format
msgid ""
"<literal>@ContainedIn</literal> is only useful on associations pointing to "
@@ -478,13 +483,13 @@
msgstr ""
#. Tag: para
-#: mapping.xml:279
+#: mapping.xml:281
#, no-c-format
msgid "Let's make our example a bit more complex:"
msgstr ""
#. Tag: title
-#: mapping.xml:282
+#: mapping.xml:284
#, no-c-format
msgid ""
"Nested usage of <classname>@IndexedEmbedded</classname> and "
@@ -492,7 +497,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:285
+#: mapping.xml:287
#, no-c-format
msgid ""
"@Entity\n"
@@ -543,7 +548,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:288
+#: mapping.xml:290
#, no-c-format
msgid ""
"Any <literal>@*ToMany, @*ToOne</literal> and <literal>@Embedded</literal> "
@@ -553,37 +558,37 @@
msgstr ""
#. Tag: para
-#: mapping.xml:296
+#: mapping.xml:298
#, no-c-format
msgid "<para>id</para>"
msgstr ""
#. Tag: para
-#: mapping.xml:300
+#: mapping.xml:302
#, no-c-format
msgid "name"
msgstr ""
#. Tag: para
-#: mapping.xml:304
+#: mapping.xml:306
#, no-c-format
msgid "address.street"
msgstr ""
#. Tag: para
-#: mapping.xml:308
+#: mapping.xml:310
#, no-c-format
msgid "address.city"
msgstr ""
#. Tag: para
-#: mapping.xml:312
+#: mapping.xml:314
#, no-c-format
msgid "address.ownedBy_name"
msgstr ""
#. Tag: para
-#: mapping.xml:316
+#: mapping.xml:318
#, no-c-format
msgid ""
"The default prefix is <literal>propertyName.</literal>, following the "
@@ -593,13 +598,13 @@
msgstr ""
#. Tag: para
-#: mapping.xml:322
+#: mapping.xml:324
#, no-c-format
msgid "The prefix cannot be set to the empty string."
msgstr ""
#. Tag: para
-#: mapping.xml:325
+#: mapping.xml:327
#, no-c-format
msgid ""
"The<literal> depth</literal> property is necessary when the object graph "
@@ -614,7 +619,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:336
+#: mapping.xml:338
#, no-c-format
msgid ""
"Using <literal>@IndexedEmbedded</literal> for object associations allows you "
@@ -622,7 +627,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:341
+#: mapping.xml:343
#, no-c-format
msgid ""
"Return places where name contains JBoss and where address city is Atlanta. "
@@ -630,13 +635,13 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:344
+#: mapping.xml:346
#, no-c-format
msgid "+name:jboss +address.city:atlanta"
msgstr ""
#. Tag: para
-#: mapping.xml:348
+#: mapping.xml:350
#, no-c-format
msgid ""
"Return places where name contains JBoss and where owner's name contain Joe. "
@@ -644,13 +649,13 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:351
+#: mapping.xml:353
#, no-c-format
msgid "+name:jboss +address.orderBy_name:joe"
msgstr ""
#. Tag: para
-#: mapping.xml:355
+#: mapping.xml:357
#, no-c-format
msgid ""
"In a way it mimics the relational join operation in a more efficient way (at "
@@ -661,7 +666,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:363
+#: mapping.xml:365
#, no-c-format
msgid ""
"An associated object can itself (but does not have to) be <literal>@Indexed</"
@@ -669,7 +674,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:367
+#: mapping.xml:369
#, no-c-format
msgid ""
"When @IndexedEmbedded points to an entity, the association has to be "
@@ -681,7 +686,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:375
+#: mapping.xml:377
#, no-c-format
msgid ""
"Sometimes, the object type annotated by <classname>@IndexedEmbedded</"
@@ -693,7 +698,7 @@
msgstr ""
#. Tag: title
-#: mapping.xml:383
+#: mapping.xml:385
#, no-c-format
msgid ""
"Using the <literal>targetElement</literal> property of "
@@ -701,7 +706,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:386
+#: mapping.xml:388
#, no-c-format
msgid ""
"@Entity\n"
@@ -729,13 +734,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:391
+#: mapping.xml:393
#, no-c-format
msgid "Boost factor"
msgstr ""
#. Tag: para
-#: mapping.xml:393
+#: mapping.xml:395
#, no-c-format
msgid ""
"Lucene has the notion of <emphasis>boost factor</emphasis>. It's a way to "
@@ -745,7 +750,7 @@
msgstr ""
#. Tag: title
-#: mapping.xml:399
+#: mapping.xml:401
#, no-c-format
msgid ""
"Using different ways of increasing the weight of an indexed element using a "
@@ -753,7 +758,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:402
+#: mapping.xml:404
#, no-c-format
msgid ""
"@Entity\n"
@@ -784,7 +789,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:405
+#: mapping.xml:407
#, no-c-format
msgid ""
"In our example, <classname>Essay</classname>'s probability to reach the top "
@@ -801,13 +806,74 @@
msgstr ""
#. Tag: title
-#: mapping.xml:420
+#: mapping.xml:422
#, no-c-format
+msgid "Dynamic boost factor"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:424
+#, no-c-format
+msgid ""
+"The <literal>@Boost </literal>annotation used in <xref linkend=\"section-"
+"boost-annotation\"/> defines a static boost factor which is is independent "
+"of the state of of the indexed entity at runtime. However, there are "
+"usecases in which the boost factor may depends on the actual state of the "
+"entity. In this case you can use the <literal>@DynamicBoost </"
+"literal>annotation together with an accompanying custom "
+"<classname>BoostStrategy</classname>.<example id=\"example-dynamic-boosting"
+"\"> <title>Dynamic boost examle</title> <programlisting>public enum "
+"PersonType {\n"
+" NORMAL,\n"
+" VIP\n"
+"}\n"
+"\n"
+"@Entity\n"
+"@Indexed\n"
+"<emphasis role=\"bold\">@DynamicBoost(impl = VIPBoostStrategy.class)</"
+"emphasis>\n"
+"public class Person {\n"
+" private PersonType type; \n"
+" \n"
+" // ....\n"
+"}\n"
+"\n"
+"public class VIPBoostStrategy implements BoostStrategy {\n"
+" <emphasis role=\"bold\">public float defineBoost(Object value)</"
+"emphasis> {\n"
+" Person person = ( Person ) value;\n"
+" if ( person.getType().equals( PersonType.VIP ) ) {\n"
+" return 2.0f;\n"
+" }\n"
+" else {\n"
+" return 1.0f;\n"
+" }\n"
+" }\n"
+"}</programlisting> </example>In <xref linkend=\"example-dynamic-boosting\"/> "
+"a dynamic boost is defined on class level specifying "
+"<classname>VIPBoostStrategy</classname> as implementation of the "
+"<classname>BoostStrategy</classname> interface to be used at indexing time. "
+"You can place the <literal>@DynamicBoost</literal> either at class or field "
+"level. Depending on the placement of the annotation either the whole entity "
+"is passed to the <methodname>defineBoost</methodname> method or just the "
+"annotated field/property value. It's up to you to cast the passed object to "
+"the correct type. In the example all indexed values of a VIP person would be "
+"double as important as the values of a normal person.<note> <para>The "
+"specified <classname>BoostStrategy</classname> implementation must define a "
+"public no-arg constructor.</para> </note>Of course you can mix and match "
+"<literal>@Boost</literal> and <literal>@DynamicBoost</literal> annotations "
+"in your entity. All defined boost factors are cummulative as described in "
+"<xref linkend=\"section-boost-annotation\"/>."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:455
+#, no-c-format
msgid "Analyzer"
msgstr ""
#. Tag: para
-#: mapping.xml:422
+#: mapping.xml:457
#, no-c-format
msgid ""
"The default analyzer class used to index tokenized fields is configurable "
@@ -817,7 +883,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:427
+#: mapping.xml:462
#, no-c-format
msgid ""
"You can also define the analyzer class per entity, property and even per "
@@ -825,13 +891,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:432
+#: mapping.xml:467
#, no-c-format
msgid "Different ways of specifying an analyzer"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:434
+#: mapping.xml:469
#, no-c-format
msgid ""
"@Entity\n"
@@ -860,7 +926,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:437
+#: mapping.xml:472
#, no-c-format
msgid ""
"In this example, <classname>EntityAnalyzer</classname> is used to index all "
@@ -871,7 +937,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:444
+#: mapping.xml:479
#, no-c-format
msgid ""
"Mixing different analyzers in the same entity is most of the time a bad "
@@ -882,13 +948,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:453
+#: mapping.xml:488
#, no-c-format
msgid "Analyzer definitions"
msgstr ""
#. Tag: para
-#: mapping.xml:455
+#: mapping.xml:490
#, no-c-format
msgid ""
"Analyzers can become quite complex to deal with for which reason Hibernate "
@@ -898,21 +964,30 @@
msgstr ""
#. Tag: para
-#: mapping.xml:463
+#: mapping.xml:498
#, no-c-format
msgid "a name: the unique string used to refer to the definition"
msgstr ""
#. Tag: para
-#: mapping.xml:468
+#: mapping.xml:503
#, no-c-format
msgid ""
+"a list of char filters: each char filter is responsible to pre-process input "
+"characters before the tokenization. Char filters can add, change or remove "
+"characters; one common usage is for characters normalization"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:509
+#, no-c-format
+msgid ""
"a tokenizer: responsible for tokenizing the input stream into individual "
"words"
msgstr ""
#. Tag: para
-#: mapping.xml:473
+#: mapping.xml:514
#, no-c-format
msgid ""
"a list of filters: each filter is responsible to remove, modify or sometimes "
@@ -920,37 +995,46 @@
msgstr ""
#. Tag: para
-#: mapping.xml:479
+#: mapping.xml:520
#, no-c-format
msgid ""
-"This separation of tasks - a tokenizer followed by a list of filters - "
-"allows for easy reuse of each individual component and let you build your "
-"customized analyzer in a very flexible way (just like Lego). Generally "
-"speaking the <classname>Tokenizer</classname> starts the analysis process by "
-"turning the character input into tokens which are then further processed by "
-"the <classname>TokenFilter</classname>s. Hibernate Search supports this "
-"infrastructure by utilizing the Solr analyzer framework. Make sure to "
-"add<filename> solr-core.jar and </filename><filename>solr-common.jar</"
-"filename> to your classpath to use analyzer definitions. In case you also "
-"want to utilizing a snowball stemmer also include the <filename>lucene-"
-"snowball.jar.</filename> Other Solr analyzers might depend on more "
-"libraries. For example, the <classname>PhoneticFilterFactory</classname> "
-"depends on <ulink url=\"http://commons.apache.org/codec\">commons-codec</"
-"ulink>. Your distribution of Hibernate Search provides these dependencies in "
-"its <filename>lib</filename> directory."
+"This separation of tasks - a list of char filters, and a tokenizer followed "
+"by a list of filters - allows for easy reuse of each individual component "
+"and let you build your customized analyzer in a very flexible way (just like "
+"Lego). Generally speaking the <classname>char filters</classname> do some "
+"pre-processing in the character input, then the <classname>Tokenizer</"
+"classname> starts the tokenizing process by turning the character input into "
+"tokens which are then further processed by the <classname>TokenFilter</"
+"classname>s. Hibernate Search supports this infrastructure by utilizing the "
+"Solr analyzer framework. Make sure to add<filename> solr-core.jar and </"
+"filename><filename>solr-solrj.jar</filename> to your classpath to use "
+"analyzer definitions. In case you also want to use the snowball stemmer also "
+"include the <filename>lucene-snowball.jar.</filename> Other Solr analyzers "
+"might depend on more libraries. For example, the "
+"<classname>PhoneticFilterFactory</classname> depends on <ulink url=\"http://"
+"commons.apache.org/codec\">commons-codec</ulink>. Your distribution of "
+"Hibernate Search provides these dependencies in its <filename>lib</filename> "
+"directory."
msgstr ""
#. Tag: title
-#: mapping.xml:498
+#: mapping.xml:540
#, no-c-format
msgid "<classname>@AnalyzerDef</classname> and the Solr framework"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:501
+#: mapping.xml:543
#, no-c-format
msgid ""
"@AnalyzerDef(name=\"customanalyzer\",\n"
+" charFilters = {\n"
+" @CharFilterDef(factory = MappingCharFilterFactory.class, "
+"params = {\n"
+" @Parameter(name = \"mapping\", value = \"org/hibernate/"
+"search/test/analyzer/solr/mapping-chars.properties\")\n"
+" })\n"
+" },\n"
" tokenizer = @TokenizerDef(factory = StandardTokenizerFactory."
"class),\n"
" filters = {\n"
@@ -970,29 +1054,31 @@
msgstr ""
#. Tag: para
-#: mapping.xml:504
+#: mapping.xml:546
#, no-c-format
msgid ""
-"A tokenizer is defined by its factory which is responsible for building the "
-"tokenizer and using the optional list of parameters. This example use the "
-"standard tokenizer. A filter is defined by its factory which is responsible "
-"for creating the filter instance using the optional parameters. In our "
-"example, the StopFilter filter is built reading the dedicated words property "
-"file and is expected to ignore case. The list of parameters is dependent on "
-"the tokenizer or filter factory."
+"A char filter is defined by its factory which is responsible for building "
+"the char filter and using the optional list of parameters. In our example, a "
+"mapping char filter is used, and will replace characters in the input based "
+"on the rules specified in the mapping file. A tokenizer is also defined by "
+"its factory. This example use the standard tokenizer. A filter is defined by "
+"its factory which is responsible for creating the filter instance using the "
+"optional parameters. In our example, the StopFilter filter is built reading "
+"the dedicated words property file and is expected to ignore case. The list "
+"of parameters is dependent on the tokenizer or filter factory."
msgstr ""
#. Tag: para
-#: mapping.xml:514
+#: mapping.xml:559
#, no-c-format
msgid ""
-"Filters are applied in the order they are defined in the "
+"Filters and char filters are applied in the order they are defined in the "
"<classname>@AnalyzerDef</classname> annotation. Make sure to think twice "
"about this order."
msgstr ""
#. Tag: para
-#: mapping.xml:519
+#: mapping.xml:564
#, no-c-format
msgid ""
"Once defined, an analyzer definition can be reused by an "
@@ -1001,13 +1087,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:524
+#: mapping.xml:569
#, no-c-format
msgid "Referencing an analyzer by name"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:526
+#: mapping.xml:571
#, no-c-format
msgid ""
"@Entity\n"
@@ -1032,7 +1118,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:529
+#: mapping.xml:574
#, no-c-format
msgid ""
"Analyzer instances declared by <classname>@AnalyzerDef</classname> are "
@@ -1040,7 +1126,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:533
+#: mapping.xml:578
#, no-c-format
msgid ""
"Analyzer analyzer = fullTextSession.getSearchFactory().getAnalyzer"
@@ -1048,7 +1134,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:535
+#: mapping.xml:580
#, no-c-format
msgid ""
"This is quite useful wen building queries. Fields in queries should be "
@@ -1059,128 +1145,179 @@
msgstr ""
#. Tag: title
-#: mapping.xml:544
+#: mapping.xml:589
#, no-c-format
msgid "Available analyzers"
msgstr ""
#. Tag: para
-#: mapping.xml:546
+#: mapping.xml:591
#, no-c-format
msgid ""
-"Solr and Lucene come with a lot of useful default tokenizers and filters. "
-"You can find a complete list of tokenizer factories and filter factories at "
-"<ulink url=\"http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters"
-"\">http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters</ulink>. Let "
-"check a few of them."
+"Solr and Lucene come with a lot of useful default char filters, tokenizers "
+"and filters. You can find a complete list of char filter factories, "
+"tokenizer factories and filter factories at <ulink url=\"http://wiki.apache."
+"org/solr/AnalyzersTokenizersTokenFilters\">http://wiki.apache.org/solr/"
+"AnalyzersTokenizersTokenFilters</ulink>. Let check a few of them."
msgstr ""
#. Tag: title
-#: mapping.xml:553
+#: mapping.xml:598
#, no-c-format
-msgid "Some of the available tokenizers"
+msgid "Some of the available char filters"
msgstr ""
#. Tag: entry
-#: mapping.xml:558 mapping.xml:593
+#: mapping.xml:602 mapping.xml:639 mapping.xml:674
#, no-c-format
msgid "Factory"
msgstr ""
#. Tag: entry
-#: mapping.xml:560 mapping.xml:595
+#: mapping.xml:604 mapping.xml:641 mapping.xml:676
#, no-c-format
msgid "Description"
msgstr ""
#. Tag: entry
-#: mapping.xml:562 mapping.xml:597
+#: mapping.xml:606 mapping.xml:643 mapping.xml:678
#, no-c-format
msgid "parameters"
msgstr ""
#. Tag: entry
-#: mapping.xml:568
+#: mapping.xml:611
#, no-c-format
-msgid "StandardTokenizerFactory"
+msgid "MappingCharFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:570
+#: mapping.xml:613
#, no-c-format
-msgid "Use the Lucene StandardTokenizer"
+msgid ""
+"Replaces one or more characters with one or more characters, based on "
+"mappings specified in the resource file"
msgstr ""
+#. Tag: para
+#: mapping.xml:616
+#, no-c-format
+msgid ""
+"<literal>mapping</literal>: points to a resource file containing the "
+"mappings using the format:"
+msgstr ""
+
+#. Tag: literallayout
+#: mapping.xml:618
+#, no-c-format
+msgid ""
+"\"á\" => \"a\"\n"
+" \"ñ\" => \"n\"\n"
+" \"ø\" => \"o\""
+msgstr ""
+
#. Tag: entry
-#: mapping.xml:572 mapping.xml:581 mapping.xml:607 mapping.xml:615
-#: mapping.xml:647
+#: mapping.xml:622
#, no-c-format
+msgid "HTMLStripCharFilterFactory"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:624
+#, no-c-format
+msgid "Remove HTML standard tags, keeping the text"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:626 mapping.xml:653 mapping.xml:662 mapping.xml:688
+#: mapping.xml:696 mapping.xml:728
+#, no-c-format
msgid "none"
msgstr ""
+#. Tag: title
+#: mapping.xml:634
+#, no-c-format
+msgid "Some of the available tokenizers"
+msgstr ""
+
#. Tag: entry
-#: mapping.xml:576
+#: mapping.xml:649
#, no-c-format
+msgid "StandardTokenizerFactory"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:651
+#, no-c-format
+msgid "Use the Lucene StandardTokenizer"
+msgstr ""
+
+#. Tag: entry
+#: mapping.xml:657
+#, no-c-format
msgid "HTMLStripStandardTokenizerFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:578
+#: mapping.xml:659
#, no-c-format
-msgid "Remove HTML tags, keep the text and pass it to a StandardTokenizer"
+msgid ""
+"Remove HTML tags, keep the text and pass it to a StandardTokenizer. "
+"@Deprecated, use the HTMLStripCharFilterFactory instead"
msgstr ""
#. Tag: title
-#: mapping.xml:588
+#: mapping.xml:669
#, no-c-format
msgid "Some of the available filters"
msgstr ""
#. Tag: entry
-#: mapping.xml:603
+#: mapping.xml:684
#, no-c-format
msgid "StandardFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:605
+#: mapping.xml:686
#, no-c-format
msgid "Remove dots from acronyms and 's from words"
msgstr ""
#. Tag: entry
-#: mapping.xml:611
+#: mapping.xml:692
#, no-c-format
msgid "LowerCaseFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:613
+#: mapping.xml:694
#, no-c-format
msgid "Lowercase words"
msgstr ""
#. Tag: entry
-#: mapping.xml:619
+#: mapping.xml:700
#, no-c-format
msgid "StopFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:621
+#: mapping.xml:702
#, no-c-format
msgid "remove words (tokens) matching a list of stop words"
msgstr ""
#. Tag: para
-#: mapping.xml:624
+#: mapping.xml:705
#, no-c-format
msgid ""
"<literal>words</literal>: points to a resource file containing the stop words"
msgstr ""
#. Tag: para
-#: mapping.xml:625
+#: mapping.xml:706
#, no-c-format
msgid ""
"ignoreCase: true if <literal>case</literal> should be ignore when comparing "
@@ -1188,13 +1325,13 @@
msgstr ""
#. Tag: entry
-#: mapping.xml:631
+#: mapping.xml:712
#, no-c-format
msgid "SnowballPorterFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:633
+#: mapping.xml:714
#, no-c-format
msgid ""
"Reduces a word to it's root in a given language. (eg. protect, protects, "
@@ -1203,7 +1340,7 @@
msgstr ""
#. Tag: entry
-#: mapping.xml:637
+#: mapping.xml:718
#, no-c-format
msgid ""
"<literal>language</literal>: Danish, Dutch, English, Finnish, French, "
@@ -1212,19 +1349,19 @@
msgstr ""
#. Tag: entry
-#: mapping.xml:643
+#: mapping.xml:724
#, no-c-format
msgid "ISOLatin1AccentFilterFactory"
msgstr ""
#. Tag: entry
-#: mapping.xml:645
+#: mapping.xml:726
#, no-c-format
msgid "remove accents for languages like French"
msgstr ""
#. Tag: para
-#: mapping.xml:653
+#: mapping.xml:734
#, no-c-format
msgid ""
"We recommend to check all the implementations of <classname>org.apache.solr."
@@ -1234,26 +1371,26 @@
msgstr ""
#. Tag: title
-#: mapping.xml:660
+#: mapping.xml:741
#, no-c-format
msgid "Analyzer discriminator (experimental)"
msgstr ""
#. Tag: para
-#: mapping.xml:662
+#: mapping.xml:743
#, no-c-format
msgid ""
"So far all the introduced ways to specify an analyzer were static. However, "
"there are use cases where it is useful to select an analyzer depending on "
"the current state of the entity to be indexed, for example in multilingual "
-"application. For an <classname>BlogEntry</classname> class for example the "
+"applications. For an <classname>BlogEntry</classname> class for example the "
"analyzer could depend on the language property of the entry. Depending on "
"this property the correct language specific stemmer should be chosen to "
"index the actual text."
msgstr ""
#. Tag: para
-#: mapping.xml:671
+#: mapping.xml:752
#, no-c-format
msgid ""
"To enable this dynamic analyzer selection Hibernate Search introduces the "
@@ -1262,7 +1399,7 @@
msgstr ""
#. Tag: title
-#: mapping.xml:677
+#: mapping.xml:758
#, no-c-format
msgid ""
"Usage of @AnalyzerDiscriminator in order to select an analyzer depending on "
@@ -1270,7 +1407,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:680
+#: mapping.xml:761
#, no-c-format
msgid ""
"@Entity\n"
@@ -1312,7 +1449,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:682
+#: mapping.xml:763
#, no-c-format
msgid ""
"public class LanguageDiscriminator implements Discriminator {\n"
@@ -1328,7 +1465,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:685
+#: mapping.xml:766
#, no-c-format
msgid ""
"The prerequisite for using <classname>@AnalyzerDiscriminator</classname> is "
@@ -1350,7 +1487,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:705
+#: mapping.xml:786
#, no-c-format
msgid ""
"An implemention of the <classname>Discriminator</classname> interface has to "
@@ -1362,7 +1499,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:714
+#: mapping.xml:795
#, no-c-format
msgid ""
"The <classname>@AnalyzerDiscriminator</classname> is currently still "
@@ -1371,13 +1508,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:722
+#: mapping.xml:803
#, no-c-format
msgid "Retrieving an analyzer"
msgstr ""
#. Tag: para
-#: mapping.xml:724
+#: mapping.xml:805
#, no-c-format
msgid ""
"During indexing time, Hibernate Search is using analyzers under the hood for "
@@ -1388,7 +1525,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:732
+#: mapping.xml:813
#, no-c-format
msgid ""
"This rule can be broken but you need a good reason for it. If you are "
@@ -1396,7 +1533,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:736
+#: mapping.xml:817
#, no-c-format
msgid ""
"You can retrieve the scoped analyzer for a given entity used at indexing "
@@ -1408,13 +1545,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:745
+#: mapping.xml:826
#, no-c-format
msgid "Using the scoped analyzer when building a full-text query"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:748
+#: mapping.xml:829
#, no-c-format
msgid ""
"org.apache.lucene.queryParser.QueryParser parser = new QueryParser(\n"
@@ -1432,7 +1569,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:751
+#: mapping.xml:832
#, no-c-format
msgid ""
"In the example above, the song title is indexed in two fields: the standard "
@@ -1443,7 +1580,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:758
+#: mapping.xml:839
#, no-c-format
msgid ""
"If your query targets more that one query and you wish to use your standard "
@@ -1453,13 +1590,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:767
+#: mapping.xml:848
#, no-c-format
msgid "Property/Field Bridge"
msgstr ""
#. Tag: para
-#: mapping.xml:769
+#: mapping.xml:850
#, no-c-format
msgid ""
"In Lucene all index fields have to be represented as Strings. For this "
@@ -1471,13 +1608,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:777
+#: mapping.xml:858
#, no-c-format
msgid "Built-in bridges"
msgstr ""
#. Tag: para
-#: mapping.xml:779
+#: mapping.xml:860
#, no-c-format
msgid ""
"Hibernate Search comes bundled with a set of built-in bridges between a Java "
@@ -1485,13 +1622,13 @@
msgstr ""
#. Tag: term
-#: mapping.xml:784
+#: mapping.xml:865
#, no-c-format
msgid "null"
msgstr ""
#. Tag: para
-#: mapping.xml:787
+#: mapping.xml:868
#, no-c-format
msgid ""
"null elements are not indexed. Lucene does not support null elements and "
@@ -1499,19 +1636,19 @@
msgstr ""
#. Tag: term
-#: mapping.xml:793
+#: mapping.xml:874
#, no-c-format
msgid "java.lang.String"
msgstr ""
#. Tag: para
-#: mapping.xml:796
+#: mapping.xml:877
#, no-c-format
msgid "String are indexed as is"
msgstr ""
#. Tag: term
-#: mapping.xml:801
+#: mapping.xml:882
#, no-c-format
msgid ""
"short, Short, integer, Integer, long, Long, float, Float, double, Double, "
@@ -1519,7 +1656,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:805
+#: mapping.xml:886
#, no-c-format
msgid ""
"Numbers are converted in their String representation. Note that numbers "
@@ -1528,7 +1665,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:808
+#: mapping.xml:889
#, no-c-format
msgid ""
"Using a Range query is debatable and has drawbacks, an alternative approach "
@@ -1537,19 +1674,19 @@
msgstr ""
#. Tag: para
-#: mapping.xml:812
+#: mapping.xml:893
#, no-c-format
msgid "Hibernate Search will support a padding mechanism"
msgstr ""
#. Tag: term
-#: mapping.xml:818
+#: mapping.xml:899
#, no-c-format
msgid "java.util.Date"
msgstr ""
#. Tag: para
-#: mapping.xml:821
+#: mapping.xml:902
#, no-c-format
msgid ""
"Dates are stored as yyyyMMddHHmmssSSS in GMT time (200611072203012 for Nov "
@@ -1559,7 +1696,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:827
+#: mapping.xml:908
#, no-c-format
msgid ""
"Usually, storing the date up to the millisecond is not necessary. "
@@ -1570,7 +1707,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:834
+#: mapping.xml:915
#, no-c-format
msgid ""
"@Entity \n"
@@ -1584,7 +1721,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:837
+#: mapping.xml:918
#, no-c-format
msgid ""
"A Date whose resolution is lower than <literal>MILLISECOND</literal> cannot "
@@ -1592,25 +1729,25 @@
msgstr ""
#. Tag: term
-#: mapping.xml:845
+#: mapping.xml:926
#, no-c-format
msgid "java.net.URI, java.net.URL"
msgstr ""
#. Tag: para
-#: mapping.xml:848
+#: mapping.xml:929
#, no-c-format
msgid "URI and URL are converted to their string representation"
msgstr ""
#. Tag: term
-#: mapping.xml:854
+#: mapping.xml:935
#, no-c-format
msgid "java.lang.Class"
msgstr ""
#. Tag: para
-#: mapping.xml:857
+#: mapping.xml:938
#, no-c-format
msgid ""
"Class are converted to their fully qualified class name. The thread context "
@@ -1618,13 +1755,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:866
+#: mapping.xml:947
#, no-c-format
msgid "Custom Bridge"
msgstr ""
#. Tag: para
-#: mapping.xml:868
+#: mapping.xml:949
#, no-c-format
msgid ""
"Sometimes, the built-in bridges of Hibernate Search do not cover some of "
@@ -1634,13 +1771,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:874
+#: mapping.xml:955
#, no-c-format
msgid "StringBridge"
msgstr ""
#. Tag: para
-#: mapping.xml:876
+#: mapping.xml:957
#, no-c-format
msgid ""
"The simplest custom solution is to give Hibernate Search an implementation "
@@ -1651,13 +1788,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:885
+#: mapping.xml:966
#, no-c-format
msgid "Implementing your own <classname>StringBridge</classname>"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:888
+#: mapping.xml:969
#, no-c-format
msgid ""
"/**\n"
@@ -1688,7 +1825,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:891
+#: mapping.xml:972
#, no-c-format
msgid ""
"Then any property or field can use this bridge thanks to the "
@@ -1696,7 +1833,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:894
+#: mapping.xml:975
#, no-c-format
msgid ""
"<emphasis role=\"bold\">@FieldBridge(impl = PaddedIntegerBridge.class)</"
@@ -1705,7 +1842,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:896
+#: mapping.xml:977
#, no-c-format
msgid ""
"Parameters can be passed to the Bridge implementation making it more "
@@ -1715,13 +1852,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:903
+#: mapping.xml:984
#, no-c-format
msgid "Passing parameters to your bridge implementation"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:905
+#: mapping.xml:986
#, no-c-format
msgid ""
"public class PaddedIntegerBridge implements StringBridge, <emphasis\n"
@@ -1760,7 +1897,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:908
+#: mapping.xml:989
#, no-c-format
msgid ""
"The <classname>ParameterizedBridge</classname> interface can be implemented "
@@ -1769,7 +1906,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:913
+#: mapping.xml:994
#, no-c-format
msgid ""
"All implementations have to be thread-safe, but the parameters are set "
@@ -1777,7 +1914,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:917
+#: mapping.xml:998
#, no-c-format
msgid ""
"If you expect to use your bridge implementation on an id property (ie "
@@ -1785,12 +1922,12 @@
"extended version of <literal>StringBridge</literal> named "
"<classname>TwoWayStringBridge</classname>. Hibernate Search needs to read "
"the string representation of the identifier and generate the object out of "
-"it. There is not difference in the way the <literal>@FieldBridge</literal> "
+"it. There is no difference in the way the <literal>@FieldBridge</literal> "
"annotation is used."
msgstr ""
#. Tag: title
-#: mapping.xml:926
+#: mapping.xml:1007
#, no-c-format
msgid ""
"Implementing a TwoWayStringBridge which can for example be used for id "
@@ -1798,7 +1935,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:929
+#: mapping.xml:1010
#, no-c-format
msgid ""
"public class PaddedIntegerBridge implements TwoWayStringBridge, "
@@ -1840,7 +1977,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:932
+#: mapping.xml:1013
#, no-c-format
msgid ""
"It is critically important for the two-way process to be idempotent (ie "
@@ -1848,33 +1985,33 @@
msgstr ""
#. Tag: title
-#: mapping.xml:938
+#: mapping.xml:1019
#, no-c-format
msgid "FieldBridge"
msgstr ""
#. Tag: para
-#: mapping.xml:940
+#: mapping.xml:1021
#, no-c-format
msgid ""
"Some use cases require more than a simple object to string translation when "
"mapping a property to a Lucene index. To give you the greatest possible "
"flexibility you can also implement a bridge as a <classname>FieldBridge</"
"classname>. This interface gives you a property value and let you map it the "
-"way you want in your Lucene <classname>Document</classname>.The interface is "
-"very similar in its concept to the Hibernate<classname> UserType</"
+"way you want in your Lucene <classname>Document</classname>. The interface "
+"is very similar in its concept to the Hibernate <classname>UserType</"
"classname>s."
msgstr ""
#. Tag: para
-#: mapping.xml:948
+#: mapping.xml:1029
#, no-c-format
msgid ""
"You can for example store a given property in two different document fields:"
msgstr ""
#. Tag: title
-#: mapping.xml:952
+#: mapping.xml:1033
#, no-c-format
msgid ""
"Implementing the FieldBridge interface in order to a given property into "
@@ -1882,7 +2019,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:955
+#: mapping.xml:1036
#, no-c-format
msgid ""
"/**\n"
@@ -1890,7 +2027,6 @@
"Query per\n"
" * year, month or day (eg get all the elements of December for the last 5 "
"years).\n"
-" * \n"
" * @author Emmanuel Bernard\n"
" */\n"
"public class DateSplitBridge implements FieldBridge {\n"
@@ -1907,25 +2043,22 @@
" int day = cal.get(Calendar.DAY_OF_MONTH);\n"
" \n"
" // set year\n"
-" Field field = new Field(name + \".year\", String.valueOf(year),\n"
-" luceneOptions.getStore(), luceneOptions.getIndex(),\n"
-" luceneOptions.getTermVector());\n"
-" field.setBoost(luceneOptions.getBoost());\n"
-" document.add(field);\n"
+" luceneOptions.addFieldToDocument(\n"
+" name + \".year\",\n"
+" String.valueOf( year ),\n"
+" document );\n"
" \n"
" // set month and pad it if needed\n"
-" field = new Field(name + \".month\", month < 10 ? \"0\" : \"\"\n"
-" + String.valueOf(month), luceneOptions.getStore(),\n"
-" luceneOptions.getIndex(), luceneOptions.getTermVector());\n"
-" field.setBoost(luceneOptions.getBoost());\n"
-" document.add(field);\n"
+" luceneOptions.addFieldToDocument(\n"
+" name + \".month\",\n"
+" month < 10 ? \"0\" : \"\" + String.valueOf( month ),\n"
+" document );\n"
" \n"
" // set day and pad it if needed\n"
-" field = new Field(name + \".day\", day < 10 ? \"0\" : \"\"\n"
-" + String.valueOf(day), luceneOptions.getStore(),\n"
-" luceneOptions.getIndex(), luceneOptions.getTermVector());\n"
-" field.setBoost(luceneOptions.getBoost());\n"
-" document.add(field);\n"
+" luceneOptions.addFieldToDocument(\n"
+" name + \".day\",\n"
+" day < 10 ? \"0\" : \"\" + String.valueOf( day ),\n"
+" document );\n"
" }\n"
"}\n"
"\n"
@@ -1935,14 +2068,40 @@
"private Date date;"
msgstr ""
+#. Tag: para
+#: mapping.xml:1039
+#, no-c-format
+msgid ""
+"In the previous example the fields where not added directly to Document but "
+"we where delegating this task to the <classname>LuceneOptions</classname> "
+"helper; this will apply the options you have selected on <literal>@Field</"
+"literal>, like <literal>Store</literal> or <literal>TermVector</literal> "
+"options, or apply the choosen <classname>@Boost</classname> value. It is "
+"especially useful to encapsulate the complexity of <literal>COMPRESS</"
+"literal> implementations so it's recommended to delegate to "
+"<classname>LuceneOptions</classname> to add fields to the "
+"<classname>Document</classname>, but nothing stops you from editing the "
+"<classname>Document</classname> directly and ignore the "
+"<classname>LuceneOptions</classname> in case you need to."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1048
+#, no-c-format
+msgid ""
+"Classes like <classname>LuceneOptions</classname> are created to shield your "
+"application from changes in Lucene API and simplify your code. Use them if "
+"you can, but if you need more flexibility you're not required to."
+msgstr ""
+
#. Tag: title
-#: mapping.xml:960
+#: mapping.xml:1055
#, no-c-format
msgid "ClassBridge"
msgstr ""
#. Tag: para
-#: mapping.xml:962
+#: mapping.xml:1057
#, no-c-format
msgid ""
"It is sometimes useful to combine more than one property of a given entity "
@@ -1957,13 +2116,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:974
+#: mapping.xml:1069
#, no-c-format
msgid "Implementing a class bridge"
msgstr ""
#. Tag: programlisting
-#: mapping.xml:976
+#: mapping.xml:1071
#, no-c-format
msgid ""
"@Entity\n"
@@ -1983,7 +2142,6 @@
" ...\n"
"}\n"
"\n"
-"\n"
"public class CatFieldsClassBridge implements FieldBridge, "
"ParameterizedBridge {\n"
" private String sepChar;\n"
@@ -2017,7 +2175,7 @@
msgstr ""
#. Tag: para
-#: mapping.xml:979
+#: mapping.xml:1074
#, no-c-format
msgid ""
"In this example, the particular <classname>CatFieldsClassBridge</classname> "
@@ -2026,19 +2184,19 @@
msgstr ""
#. Tag: title
-#: mapping.xml:989 mapping.xml:1014
+#: mapping.xml:1084 mapping.xml:1109
#, no-c-format
msgid "Providing your own id"
msgstr ""
#. Tag: para
-#: mapping.xml:992
+#: mapping.xml:1087
#, no-c-format
msgid "This part of the documentation is a work in progress."
msgstr ""
#. Tag: para
-#: mapping.xml:995
+#: mapping.xml:1090
#, no-c-format
msgid ""
"You can provide your own id for Hibernate Search if you are extending the "
@@ -2049,13 +2207,13 @@
msgstr ""
#. Tag: title
-#: mapping.xml:1002
+#: mapping.xml:1097
#, no-c-format
msgid "The ProvidedId annotation"
msgstr ""
#. Tag: para
-#: mapping.xml:1004
+#: mapping.xml:1099
#, no-c-format
msgid ""
"Unlike conventional Hibernate Search API and @DocumentId, this annotation is "
@@ -2068,7 +2226,7 @@
msgstr ""
#. Tag: programlisting
-#: mapping.xml:1016
+#: mapping.xml:1111
#, no-c-format
msgid ""
"@ProvidedId (bridge = org.my.own.package.MyCustomBridge)\n"
@@ -2079,3 +2237,1113 @@
" ...\n"
"}"
msgstr ""
+
+#. Tag: title
+#: mapping.xml:1117
+#, no-c-format
+msgid "Programmatic API"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1120
+#, no-c-format
+msgid ""
+"This feature is considered experimental. While stable code-wise, the API is "
+"subject to change in the future."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1121
+#, no-c-format
+msgid ""
+"Although the recommended approach for mapping indexed entities is to use "
+"annotations, it is sometimes more convenient to use a different approach:"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1128
+#, no-c-format
+msgid ""
+"the same entity is mapped differently depending on deployment needs "
+"(customization for clients)"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1133
+#, no-c-format
+msgid ""
+"some automatization process requires the dynamic mapping of many entities "
+"sharing a common traits"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1138
+#, no-c-format
+msgid ""
+"While it has been a popular demand in the past, the Hibernate team never "
+"found the idea of an XML alternative to annotations appealing due to it's "
+"heavy duplication, lack of code refactoring safety, because it did not cover "
+"all the use case spectrum and because we are in the 21st century :)"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1144
+#, no-c-format
+msgid ""
+"Th idea of a programmatic API was much more appealing and has now become a "
+"reality. You can programmatically and safely define your mapping using a "
+"programmatic API: you define entities and fields as indexable by using "
+"mapping classes which effectively mirror the annotation concepts in "
+"Hibernate Search. Note that fan(s) of XML approach can design their own "
+"schema and use the programmatic API to create the mapping while parsing the "
+"XML stream."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1152
+#, no-c-format
+msgid ""
+"In order to use the programmatic model you must first construct a "
+"<classname>SearchMapping</classname> object. This object is passed to "
+"Hibernate Search via a property set to the <classname>Configuration </"
+"classname>object. The property key is <literal>hibernate.search."
+"model_mapping</literal> or it's type-safe representation "
+"<classname>Environment.MODEL_MAPPING</classname>."
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1159
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"[...]\n"
+"configuration.setProperty( Environment.MODEL_MAPPING, mapping );\n"
+"\n"
+"//or in JPA\n"
+"SearchMapping mapping = new SearchMapping();\n"
+"[...]\n"
+"Map<String,String> properties = new HashMap<String,String)(1);\n"
+"properties.put( Environment.MODEL_MAPPING, mapping );\n"
+"EntityManagerFactory emf = Persistence.createEntityManagerFactory( \"userPU"
+"\", properties );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1161
+#, no-c-format
+msgid ""
+"The <classname>SearchMapping</classname> is the root object which contains "
+"all the necessary indexable entities and fields. From there, the "
+"<classname>SearchMapping</classname> object exposes a fluent (and thus "
+"intuitive) API to express your mappings: it contextually exposes the "
+"relevant mapping options in a type-safe way, just let your IDE "
+"autocompletion feature guide you through."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1168
+#, no-c-format
+msgid ""
+"Today, the programmatic API cannot be used on a class annotated with "
+"Hibernate Search annotations, chose one approach or the other. Also note "
+"that the same default values apply in annotations and the programmatic API. "
+"For example, the <methodname>@Field.name</methodname> is defaulted to the "
+"property name and does not have to be set."
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1174
+#, no-c-format
+msgid ""
+"Each core concept of the programmatic API has a corresponding example to "
+"depict how the same definition would look using annotation. Therefore seeing "
+"an annotation example of the programmatic approach should give you a clear "
+"picture of what Hibernate Search will build with the marked entities and "
+"associated properties."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1181
+#, no-c-format
+msgid "Mapping an entity as indexable"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1183
+#, no-c-format
+msgid ""
+"The first concept of the programmatic API is to define an entity as "
+"indexable. Using the annotation approach a user would mark the entity as "
+"<classname>@Indexed</classname>, the following example demonstrates how to "
+"programmatically achieve this."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1189
+#, no-c-format
+msgid "Marking an entity indexable"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1191
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping.entity(Address.class)\n"
+" .indexed()\n"
+" .indexName(\"Address_Index\"); //optional\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1193
+#, no-c-format
+msgid ""
+"As you can see you must first create a <classname>SearchMapping</classname> "
+"object which is the root object that is then passed to the "
+"<classname>Configuration</classname> object as property. You must declare an "
+"entity and if you wish to make that entity as indexable then you must call "
+"the <methodname>indexed()</methodname> method. The <methodname>indexed() </"
+"methodname>method has an optional <methodname>indexName(String indexName)</"
+"methodname> which can be used to change the default index name that is "
+"created by Hibernate Search. Using the annotation model the above can be "
+"achieved as:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1205
+#, no-c-format
+msgid "Annotation example of indexing entity"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1207
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed(index=\"Address_Index\")\n"
+"public class Address {\n"
+"....\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1213
+#, no-c-format
+msgid "Adding DocumentId to indexed entity"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1215
+#, no-c-format
+msgid "To set a property as a document id:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1218
+#, no-c-format
+msgid "Enabling document id with programmatic model"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1220
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping.entity(Address.class).indexed()\n"
+" .property(\"addressId\", ElementType.FIELD) //field access\n"
+" .documentId()\n"
+" .name(\"id\");\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping);"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1222
+#, no-c-format
+msgid ""
+"The above is equivalent to annotating a property in the entity as "
+"<classname>@DocumentId</classname> as seen in the following example:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1227
+#, no-c-format
+msgid "DocumentId annotation definition"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1229
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"public class Address {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId(name=\"id\")\n"
+" private Long addressId;\n"
+"\n"
+" ....\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1231
+#, no-c-format
+msgid "The next section demonstrates how to programmatically define analyzers."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1236
+#, no-c-format
+msgid "Defining analyzers"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1238
+#, no-c-format
+msgid ""
+"Analyzers can be programmatically defined using the <methodname>analyzerDef"
+"(String analyzerDef, Class<? extends TokenizerFactory> "
+"tokenizerFactory) </methodname>method. This method also enables you to "
+"define filters for the analyzer definition. Each filter that you define can "
+"optionally take in parameters as seen in the following example :"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1246
+#, no-c-format
+msgid "Defining analyzers using programmatic model"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1248
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping\n"
+" <emphasis role=\"bold\">.analyzerDef( \"ngram\", "
+"StandardTokenizerFactory.class )\n"
+" .filter( LowerCaseFilterFactory.class )\n"
+" .filter( NGramFilterFactory.class )\n"
+" .param( \"minGramSize\", \"3\" )\n"
+" .param( \"maxGramSize\", \"3\" )\n"
+" .analyzerDef( \"en\", StandardTokenizerFactory.class )\n"
+" .filter( LowerCaseFilterFactory.class )\n"
+" .filter( EnglishPorterFilterFactory.class )\n"
+" .analyzerDef( \"de\", StandardTokenizerFactory.class )\n"
+" .filter( LowerCaseFilterFactory.class )\n"
+" .filter( GermanStemFilterFactory.class )</emphasis>\n"
+" .entity(Address.class).indexed()\n"
+" .property(\"addressId\", ElementType.METHOD) //getter access\n"
+" .documentId()\n"
+" .name(\"id\");\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1250
+#, no-c-format
+msgid ""
+"The analyzer mapping defined above is equivalent to the annotation model "
+"using <classname>@AnalyzerDef</classname> in conjunction with "
+"<classname>@AnalyzerDefs</classname>:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1254
+#, no-c-format
+msgid "Analyzer definition using annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1256
+#, no-c-format
+msgid ""
+"@Indexed\n"
+"@Entity\n"
+"@AnalyzerDefs({\n"
+" @AnalyzerDef(name = \"ngram\",\n"
+" tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+" filters = {\n"
+" @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+" @TokenFilterDef(factory = NGramFilterFactory.class, \n"
+" params = {\n"
+" @Parameter(name = \"minGramSize\",value = \"3\"),\n"
+" @Parameter(name = \"maxGramSize\",value = \"3\") \n"
+" })\n"
+" }),\n"
+" @AnalyzerDef(name = \"en\",\n"
+" tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+" filters = {\n"
+" @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+" @TokenFilterDef(factory = EnglishPorterFilterFactory.class)\n"
+" }),\n"
+"\n"
+" @AnalyzerDef(name = \"de\",\n"
+" tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+" filters = {\n"
+" @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+" @TokenFilterDef(factory = GermanStemFilterFactory.class)\n"
+" })\n"
+"\n"
+"})\n"
+"public class Address {\n"
+"...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1261
+#, no-c-format
+msgid "Defining full text filter definitions"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1263
+#, no-c-format
+msgid ""
+"The programmatic API provides easy mechanism for defining full text filter "
+"definitions which is available via <classname>@FullTextFilterDef</classname> "
+"and <classname>@FullTextFilterDefs</classname>. Note that contrary to the "
+"annotation equivalent, full text filter definitions are a global construct "
+"and are not tied to an entity. The next example depicts the creation of full "
+"text filter definition using the <methodname>fullTextFilterDef </"
+"methodname>method."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1273
+#, no-c-format
+msgid "Defining full text definition programmatically"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1275
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping\n"
+" .analyzerDef( \"en\", StandardTokenizerFactory.class )\n"
+" .filter( LowerCaseFilterFactory.class )\n"
+" .filter( EnglishPorterFilterFactory.class )\n"
+" <emphasis role=\"bold\">.fullTextFilterDef(\"security\", "
+"SecurityFilterFactory.class)\n"
+" .cache(FilterCacheModeType.INSTANCE_ONLY)</emphasis>\n"
+" .entity(Address.class)\n"
+" .indexed()\n"
+" .property(\"addressId\", ElementType.METHOD)\n"
+" .documentId()\n"
+" .name(\"id\")\n"
+" .property(\"street1\", ElementType.METHOD)\n"
+" .field()\n"
+" .analyzer(\"en\")\n"
+" .store(Store.YES)\n"
+" .field()\n"
+" .name(\"address_data\")\n"
+" .analyzer(\"en\")\n"
+" .store(Store.NO);\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1277
+#, no-c-format
+msgid ""
+"The previous example can effectively been seen as annotating your entity "
+"with <classname>@FullTextFilterDef</classname> like below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1281
+#, no-c-format
+msgid "Using annotation to define full text filter definition"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1284
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"@AnalyzerDefs({\n"
+" @AnalyzerDef(name = \"en\",\n"
+" tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+" filters = {\n"
+" @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+" @TokenFilterDef(factory = EnglishPorterFilterFactory.class)\n"
+" })\n"
+"})\n"
+"@FullTextFilterDefs({\n"
+" @FullTextFilterDef(name = \"security\", impl = SecurityFilterFactory.class, "
+"cache = FilterCacheModeType.INSTANCE_ONLY)\n"
+"})\n"
+"public class Address {\n"
+" \n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId(name=\"id\")\n"
+" pubblic Long getAddressId() {...};\n"
+"\n"
+" @Fields({\n"
+" @Field(index=Index.TOKENIZED, store=Store.YES, \n"
+" analyzer=@Analyzer(definition=\"en\")),\n"
+" @Field(name=\"address_data\", analyzer=@Analyzer(definition=\"en\"))\n"
+" })\n"
+" public String getAddress1() {...};\n"
+"\n"
+" ......\n"
+" \n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1289
+#, no-c-format
+msgid "Defining fields for indexing"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1291
+#, no-c-format
+msgid ""
+"When defining fields for indexing using the programmatic API, call "
+"<methodname>field()</methodname> on the <methodname>property(String "
+"propertyName, ElementType elementType)</methodname> method. From "
+"<methodname>field()</methodname> you can specify the <methodname>name, "
+"index</methodname>, <methodname>store</methodname>, <methodname>bridge</"
+"methodname> and <methodname>analyzer</methodname> definitions."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1300
+#, no-c-format
+msgid "Indexing fields using programmatic API"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1302
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping\n"
+" .analyzerDef( \"en\", StandardTokenizerFactory.class )\n"
+" .filter( LowerCaseFilterFactory.class )\n"
+" .filter( EnglishPorterFilterFactory.class )\n"
+" .entity(Address.class).indexed()\n"
+" .property(\"addressId\", ElementType.METHOD)\n"
+" .documentId()\n"
+" .name(\"id\")\n"
+" .property(\"street1\", ElementType.METHOD)\n"
+" <emphasis role=\"bold\">.field()\n"
+" .analyzer(\"en\")\n"
+" .store(Store.YES)\n"
+" .index(Index.TOKENIZED) //no useful here as it's the "
+"default\n"
+" .field()\n"
+" .name(\"address_data\")\n"
+" .analyzer(\"en\");</emphasis>\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1304
+#, no-c-format
+msgid ""
+"The above example of marking fields as indexable is equivalent to defining "
+"fields using <classname>@Field</classname> as seen below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1308
+#, no-c-format
+msgid "Indexing fields using annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1310
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"@AnalyzerDefs({\n"
+" @AnalyzerDef(name = \"en\",\n"
+" tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),\n"
+" filters = {\n"
+" @TokenFilterDef(factory = LowerCaseFilterFactory.class),\n"
+" @TokenFilterDef(factory = EnglishPorterFilterFactory.class)\n"
+" })\n"
+"})\n"
+"public class Address {\n"
+" \n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId(name=\"id\")\n"
+" private Long getAddressId() {...};\n"
+"\n"
+" @Fields({\n"
+" @Field(index=Index.TOKENIZED, store=Store.YES, \n"
+" analyzer=@Analyzer(definition=\"en\")),\n"
+" @Field(name=\"address_data\", analyzer=@Analyzer(definition=\"en\"))\n"
+" })\n"
+" public String getAddress1() {...}\n"
+"\n"
+" ......\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1317
+#, no-c-format
+msgid "Programmatically defining embedded entities"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1319
+#, no-c-format
+msgid ""
+"In this section you will see how to programmatically define entities to be "
+"embedded into the indexed entity similar to using the "
+"<classname>@IndexEmbedded</classname> model. In order to define this you "
+"must mark the property as <methodname>indexEmbedded. </methodname>The is the "
+"option to add a prefix to the embedded entity definition and this can be "
+"done by calling <methodname>prefix</methodname> as seen in the example below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1328
+#, no-c-format
+msgid "Programmatically defining embedded entites"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1330
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mappping\n"
+" .entity(ProductCatalog.class)\n"
+" .indexed()\n"
+" .property(\"catalogId\", ElementType.METHOD)\n"
+" .documentId()\n"
+" .name(\"id\")\n"
+" .property(\"title\", ElementType.METHOD)\n"
+" .field()\n"
+" .index(Index.TOKENIZED)\n"
+" .store(Store.NO)\n"
+" .property(\"description\", ElementType.METHOD)\n"
+" .field()\n"
+" .index(Index.TOKENIZED)\n"
+" .store(Store.NO)\n"
+" .property(\"items\", ElementType.METHOD)\n"
+" <emphasis role=\"bold\">.indexEmbedded()\n"
+" .prefix(\"catalog.items\"); //optional</emphasis>\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1332
+#, no-c-format
+msgid ""
+"The next example shows the same definition using annotation "
+"(<classname>@IndexEmbedded</classname>):"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1335
+#, no-c-format
+msgid "Using @IndexEmbedded"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1337
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"public class ProductCatalog {\n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId(name=\"id\")\n"
+" public Long getCatalogId() {...}\n"
+" \n"
+" @Field(store=Store.NO, index=Index.TOKENIZED)\n"
+" public String getTitle() {...}\n"
+"\n"
+" @Field(store=Store.NO, index=Index.TOKENIZED)\n"
+" public String getDescription();\n"
+" \n"
+" @OneToMany(fetch = FetchType.LAZY)\n"
+" @IndexColumn(name = \"list_position\")\n"
+" @Cascade(org.hibernate.annotations.CascadeType.ALL)\n"
+" @IndexEmbedded(prefix=\"catalog.items\")\n"
+" public List<Item> getItems() {...}\n"
+"\n"
+" ...\n"
+"\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1342
+#, no-c-format
+msgid "Contained In definition"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1344
+#, no-c-format
+msgid ""
+"<classname>@ContainedIn</classname> can be define as seen in the example "
+"below:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1346
+#, no-c-format
+msgid "Programmatically defining ContainedIn"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1348
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mappping\n"
+" .entity(ProductCatalog.class)\n"
+" .indexed()\n"
+" .property(\"catalogId\", ElementType.METHOD)\n"
+" .documentId()\n"
+" .property(\"title\", ElementType.METHOD)\n"
+" .field()\n"
+" .property(\"description\", ElementType.METHOD)\n"
+" .field()\n"
+" .property(\"items\", ElementType.METHOD)\n"
+" .indexEmbedded()\n"
+"\n"
+" .entity(Item.class)\n"
+" .property(\"description\", ElementType.METHOD)\n"
+" .field()\n"
+" .property(\"productCatalog\", ElementType.METHOD)\n"
+" <emphasis role=\"bold\">.containedIn()</emphasis>;\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1350
+#, no-c-format
+msgid ""
+"This is equivalent to defining <classname>@ContainedIn</classname> in your "
+"entity:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1354
+#, no-c-format
+msgid "Annotation approach for ContainedIn"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1356
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"public class ProductCatalog {\n"
+" \n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId\n"
+" public Long getCatalogId() {...}\n"
+" \n"
+" @Field\n"
+" public String getTitle() {...}\n"
+"\n"
+" @Field\n"
+" public String getDescription() {...}\n"
+" \n"
+" @OneToMany(fetch = FetchType.LAZY)\n"
+" @IndexColumn(name = \"list_position\")\n"
+" @Cascade(org.hibernate.annotations.CascadeType.ALL)\n"
+" @IndexEmbedded\n"
+" private List<Item> getItems() {...}\n"
+"\n"
+" ...\n"
+"\n"
+"}\n"
+"\n"
+"\n"
+"@Entity\n"
+"public class Item {\n"
+" \n"
+" @Id\n"
+" @GeneratedValue\n"
+" private Long itemId;\n"
+"\n"
+" @Field\n"
+" public String getDescription() {...}\n"
+" \n"
+" @ManyToOne( cascade = { CascadeType.PERSIST, CascadeType.REMOVE } )\n"
+" @ContainedIn\n"
+" public ProductCatalog getProductCatalog() {...}\n"
+"\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1362
+#, no-c-format
+msgid "Date/Calendar Bridge"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1364
+#, no-c-format
+msgid ""
+"In order to define a calendar or date bridge mapping, call the "
+"<methodname>dateBridge(Resolution resolution) </methodname>or "
+"<methodname>calendarBridge(Resolution resolution)</methodname> methods after "
+"you have defined a <methodname>field()</methodname> in the "
+"<classname>SearchMapping </classname>hierarchy."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1371
+#, no-c-format
+msgid "Programmatic model for defining calendar/date bridge"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1373
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping\n"
+" .entity(Address.class)\n"
+" .indexed()\n"
+" .property(\"addressId\", ElementType.FIELD)\n"
+" .documentId()\n"
+" .property(\"street1\", ElementType.FIELD()\n"
+" .field()\n"
+" .property(\"createdOn\", ElementType.FIELD)\n"
+" .field()\n"
+" <emphasis role=\"bold\">.dateBridge(Resolution.DAY)</emphasis>\n"
+" .property(\"lastUpdated\", ElementType.FIELD)\n"
+" <emphasis role=\"bold\">.calendarBridge(Resolution.DAY)</emphasis>;\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1375
+#, no-c-format
+msgid ""
+"See below for defining the above using <classname>@CalendarBridge</"
+"classname> and <classname>@DateBridge</classname>:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1379
+#, no-c-format
+msgid "@CalendarBridge and @DateBridge definition"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1381
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"public class Address {\n"
+" \n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId\n"
+" private Long addressId;\n"
+"\n"
+" @Field\n"
+" private String address1;\n"
+"\n"
+" @Field\n"
+" @DateBridge(resolution=Resolution.DAY)\n"
+" private Date createdOn;\n"
+"\n"
+" @CalendarBridge(resolution=Resolution.DAY)\n"
+" private Calendar lastUpdated;\n"
+"\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1386
+#, no-c-format
+msgid "Defining bridges"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1388
+#, no-c-format
+msgid ""
+"It is possible to associate bridges to programmatically defined fields. When "
+"you define a <methodname>field()</methodname> programmatically you can use "
+"the <methodname>bridge(Class<?> impl)</methodname> to associate a "
+"<classname>FieldBridge </classname>implementation class. The bridge method "
+"also provides optional methods to include any parameters required for the "
+"bridge class. The below shows an example of programmatically defining a "
+"bridge:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1398
+#, no-c-format
+msgid "Defining field bridges programmatically"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1400
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping\n"
+" .entity(Address.class)\n"
+" .indexed()\n"
+" .property(\"addressId\", ElementType.FIELD)\n"
+" .documentId()\n"
+" .property(\"street1\", ElementType.FIELD)\n"
+" .field()\n"
+" .field()\n"
+" .name(\"street1_abridged\")\n"
+" <emphasis role=\"bold\">.bridge( ConcatStringBridge.class )\n"
+" .param( \"size\", \"4\" )</emphasis>;\n"
+" \n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1402
+#, no-c-format
+msgid ""
+"The above can equally be defined using annotations, as seen in the next "
+"example."
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1406
+#, no-c-format
+msgid "Defining field bridges using annotation"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1408
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"\n"
+"public class Address {\n"
+" \n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId(name=\"id\")\n"
+" private Long addressId;\n"
+"\n"
+" @Fields({\n"
+" @Field,\n"
+" @Field(name=\"street1_abridged\", \n"
+" bridge = @FieldBridge( impl = ConcatStringBridge.class, \n"
+" params = @Parameter( name=\"size\", value=\"4\" ))\n"
+" })\n"
+" private String address1;\n"
+"\n"
+" ...\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1414
+#, no-c-format
+msgid "Mapping class bridge"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1416
+#, no-c-format
+msgid ""
+"You can define class bridges on entities programmatically. This is shown in "
+"the next example:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1420
+#, no-c-format
+msgid "Defining class briges using API"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1422
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping\n"
+" .entity(Departments.class)\n"
+"<emphasis> .classBridge(CatDeptsFieldsClassBridge.class)\n"
+" .name(\"branchnetwork\")\n"
+" .index(Index.TOKENIZED)\n"
+" .store(Store.YES)\n"
+" .param(\"sepChar\", \" \")\n"
+" .classBridge(EquipmentType.class)\n"
+" .name(\"equiptype\")\n"
+" .index(Index.TOKENIZED)\n"
+" .store(Store.YES)\n"
+" .param(\"C\", \"Cisco\")\n"
+" .param(\"D\", \"D-Link\")\n"
+" .param(\"K\", \"Kingston\")\n"
+" .param(\"3\", \"3Com\")</emphasis>\n"
+" .indexed();\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1424
+#, no-c-format
+msgid ""
+"The above is similar to using <classname>@ClassBridge </classname>as seen in "
+"the next example:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1426
+#, no-c-format
+msgid "Using @ClassBridge"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1428
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"@ClassBridges ( {\n"
+" @ClassBridge(name=\"branchnetwork\",\n"
+" index= Index.TOKENIZED,\n"
+" store= Store.YES,\n"
+" impl = CatDeptsFieldsClassBridge.class,\n"
+" params = @Parameter( name=\"sepChar\", value=\" \" ) ),\n"
+" @ClassBridge(name=\"equiptype\",\n"
+" index= Index.TOKENIZED,\n"
+" store= Store.YES,\n"
+" impl = EquipmentType.class,\n"
+" params = {@Parameter( name=\"C\", value=\"Cisco\" ),\n"
+" @Parameter( name=\"D\", value=\"D-Link\" ),\n"
+" @Parameter( name=\"K\", value=\"Kingston\" ),\n"
+" @Parameter( name=\"3\", value=\"3Com\" )\n"
+" })\n"
+"})\n"
+"public class Departments {\n"
+"\n"
+"....\n"
+"\n"
+"}"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1434
+#, no-c-format
+msgid "Mapping dynamic boost"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1436
+#, no-c-format
+msgid ""
+"You can apply a dynamic boost factor on either a field or a whole entity:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1440
+#, no-c-format
+msgid "DynamicBoost mapping using programmatic model"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1442
+#, no-c-format
+msgid ""
+"SearchMapping mapping = new SearchMapping();\n"
+"\n"
+"mapping\n"
+" .entity(DynamicBoostedDescLibrary.class)\n"
+" .indexed()\n"
+" <emphasis>.dynamicBoost(CustomBoostStrategy.class)</emphasis>\n"
+" .property(\"libraryId\", ElementType.FIELD)\n"
+" .documentId().name(\"id\")\n"
+" .property(\"name\", ElementType.FIELD)\n"
+" <emphasis>.dynamicBoost(CustomFieldBoostStrategy.class)</emphasis>;\n"
+" .field()\n"
+" .store(Store.YES)\n"
+"\n"
+"cfg.getProperties().put( \"hibernate.search.model_mapping\", mapping );"
+msgstr ""
+
+#. Tag: para
+#: mapping.xml:1444
+#, no-c-format
+msgid ""
+"The next example shows the equivalent mapping using the "
+"<classname>@DynamicBoost</classname> annotation:"
+msgstr ""
+
+#. Tag: title
+#: mapping.xml:1446
+#, no-c-format
+msgid "Using the @DynamicBoost"
+msgstr ""
+
+#. Tag: programlisting
+#: mapping.xml:1448
+#, no-c-format
+msgid ""
+"@Entity\n"
+"@Indexed\n"
+"@DynamicBoost(impl = CustomBoostStrategy.class)\n"
+"public class DynamicBoostedDescriptionLibrary {\n"
+"\n"
+" @Id\n"
+" @GeneratedValue\n"
+" @DocumentId\n"
+" private int id;\n"
+"\n"
+" private float dynScore;\n"
+" \n"
+" @Field(store = Store.YES)\n"
+" @DynamicBoost(impl = CustomFieldBoostStrategy.class)\n"
+" private String name;\n"
+"\n"
+" public DynamicBoostedDescriptionLibrary() {\n"
+" dynScore = 1.0f;\n"
+" }\n"
+" \n"
+" .......\n"
+"\n"
+"}"
+msgstr ""
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/optimize.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/optimize.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/optimize.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1,17 +1,18 @@
-# Chinese translations for PACKAGE package.
-# Automatically generated, 2009.
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
-"PO-Revision-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
#. Tag: title
#: optimize.xml:30
@@ -52,32 +53,44 @@
msgid "after a lot of index modifications"
msgstr ""
+#. Tag: para
+#: optimize.xml:53
+#, no-c-format
+msgid ""
+"When using a <classname>MassIndexer</classname> (see <xref linkend=\"search-"
+"batchindex-massindexer\"/>) it will optimize involved indexes by default at "
+"the start and at the end of processing; you can change this behavior by "
+"using respectively <classname>MassIndexer</classname>."
+"<methodname>optimizeAfterPurge</methodname> and <classname>MassIndexer</"
+"classname>.<methodname>optimizeOnFinish</methodname>."
+msgstr ""
+
#. Tag: title
-#: optimize.xml:54
+#: optimize.xml:61
#, no-c-format
msgid "Automatic optimization"
msgstr ""
#. Tag: para
-#: optimize.xml:56
+#: optimize.xml:63
#, no-c-format
msgid "Hibernate Search can automatically optimize an index after:"
msgstr ""
#. Tag: para
-#: optimize.xml:60
+#: optimize.xml:67
#, no-c-format
msgid "a certain amount of operations (insertion, deletion)"
msgstr ""
#. Tag: para
-#: optimize.xml:64
+#: optimize.xml:71
#, no-c-format
msgid "or a certain amount of transactions"
msgstr ""
#. Tag: para
-#: optimize.xml:68
+#: optimize.xml:75
#, no-c-format
msgid ""
"The configuration for automatic index optimization can be defined on a "
@@ -85,13 +98,13 @@
msgstr ""
#. Tag: title
-#: optimize.xml:72
+#: optimize.xml:79
#, no-c-format
msgid "Defining automatic optimization parameters"
msgstr ""
#. Tag: programlisting
-#: optimize.xml:74
+#: optimize.xml:81
#, no-c-format
msgid ""
"hibernate.search.default.optimizer.operation_limit.max = 1000\n"
@@ -100,7 +113,7 @@
msgstr ""
#. Tag: para
-#: optimize.xml:77
+#: optimize.xml:84
#, no-c-format
msgid ""
"An optimization will be triggered to the <literal>Animal</literal> index as "
@@ -108,13 +121,13 @@
msgstr ""
#. Tag: para
-#: optimize.xml:82
+#: optimize.xml:89
#, no-c-format
msgid "the number of additions and deletions reaches 1000"
msgstr ""
#. Tag: para
-#: optimize.xml:86
+#: optimize.xml:93
#, no-c-format
msgid ""
"the number of transactions reaches 50 (<constant>hibernate.search.Animal."
@@ -124,7 +137,7 @@
msgstr ""
#. Tag: para
-#: optimize.xml:93
+#: optimize.xml:100
#, no-c-format
msgid ""
"If none of these parameters are defined, no optimization is processed "
@@ -132,13 +145,13 @@
msgstr ""
#. Tag: title
-#: optimize.xml:98
+#: optimize.xml:105
#, no-c-format
msgid "Manual optimization"
msgstr ""
#. Tag: para
-#: optimize.xml:100
+#: optimize.xml:107
#, no-c-format
msgid ""
"You can programmatically optimize (defragment) a Lucene index from Hibernate "
@@ -146,13 +159,13 @@
msgstr ""
#. Tag: title
-#: optimize.xml:104
+#: optimize.xml:111
#, no-c-format
msgid "Programmatic index optimization"
msgstr ""
#. Tag: programlisting
-#: optimize.xml:106
+#: optimize.xml:113
#, no-c-format
msgid ""
"FullTextSession fullTextSession = Search.getFullTextSession"
@@ -165,7 +178,7 @@
msgstr ""
#. Tag: para
-#: optimize.xml:109
+#: optimize.xml:116
#, no-c-format
msgid ""
"The first example optimizes the Lucene index holding <classname>Order</"
@@ -173,7 +186,7 @@
msgstr ""
#. Tag: para
-#: optimize.xml:113
+#: optimize.xml:120
#, no-c-format
msgid ""
"<literal>searchFactory.optimize()</literal> has no effect on a JMS backend. "
@@ -181,13 +194,13 @@
msgstr ""
#. Tag: title
-#: optimize.xml:120
+#: optimize.xml:127
#, no-c-format
msgid "Adjusting optimization"
msgstr ""
#. Tag: para
-#: optimize.xml:122
+#: optimize.xml:129
#, no-c-format
msgid ""
"Apache Lucene has a few parameters to influence how optimization is "
@@ -195,7 +208,7 @@
msgstr ""
#. Tag: para
-#: optimize.xml:125
+#: optimize.xml:132
#, no-c-format
msgid ""
"Further index optimization parameters include: <itemizedlist> <listitem> "
Modified: search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/query.po
===================================================================
--- search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/query.po 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/hibernate-search/src/main/docbook/zh-CN/modules/query.po 2010-07-01 20:29:15 UTC (rev 19886)
@@ -1,17 +1,18 @@
-# Chinese translations for PACKAGE package.
-# Automatically generated, 2009.
+# Language zh-CN translations for PACKAGE package.
+# Automatically generated, 2010.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
-"POT-Creation-Date: 2009-05-26 15:46+0000\n"
-"PO-Revision-Date: 2009-05-26 15:46+0000\n"
+"POT-Creation-Date: 2010-07-01 20:08+0000\n"
+"PO-Revision-Date: 2010-07-01 20:08+0000\n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"Language: zh-CN\n"
#. Tag: title
#: query.xml:30
@@ -145,7 +146,7 @@
"EntityManager em = entityManagerFactory.createEntityManager();\n"
"\n"
"FullTextEntityManager fullTextEntityManager = \n"
-" org.hibernate.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
+" org.hibernate.search.jpa.Search.getFullTextEntityManager(em);\n"
"\n"
"...\n"
"org.apache.lucene.queryParser.QueryParser parser = \n"
@@ -983,8 +984,8 @@
"\n"
" public DocIdSet getDocIdSet(IndexReader reader) throws IOException {\n"
" OpenBitSet bitSet = new OpenBitSet( reader.maxDoc() );\n"
-" TermDocs termDocs = reader.termDocs( new Term( \"score\", \"5"
-"\" ) );\n"
+" TermDocs termDocs = reader.termDocs( new Term( \"score\", "
+"\"5\" ) );\n"
" while ( termDocs.next() ) {\n"
" bitSet.set( termDocs.doc() );\n"
" }\n"
@@ -1300,25 +1301,178 @@
msgstr ""
#. Tag: title
-#: query.xml:720
+#: query.xml:719
#, no-c-format
+msgid "Using filters in a sharded environment"
+msgstr ""
+
+#. Tag: para
+#: query.xml:721
+#, no-c-format
+msgid ""
+"It is possible, in a sharded environment to execute queries on a subset of "
+"the available shards. This can be done in two steps:"
+msgstr ""
+
+#. Tag: para
+#: query.xml:726
+#, no-c-format
+msgid ""
+"create a sharding strategy that does select a subset of "
+"<classname>DirectoryProvider</classname>s depending on sone filter "
+"configuration"
+msgstr ""
+
+#. Tag: para
+#: query.xml:732
+#, no-c-format
+msgid "activate the proper filter at query time"
+msgstr ""
+
+#. Tag: para
+#: query.xml:736
+#, no-c-format
+msgid ""
+"Let's first look at an example of sharding strategy that query on a specific "
+"customer shard if the customer filter is activated."
+msgstr ""
+
+#. Tag: programlisting
+#: query.xml:739
+#, no-c-format
+msgid ""
+"public class CustomerShardingStrategy implements IndexShardingStrategy {\n"
+"\n"
+" // stored DirectoryProviders in a array indexed by customerID\n"
+" private DirectoryProvider<?>[] providers;\n"
+" \n"
+" public void initialize(Properties properties, DirectoryProvider<?"
+">[] providers) {\n"
+" this.providers = providers;\n"
+" }\n"
+"\n"
+" public DirectoryProvider<?>[] getDirectoryProvidersForAllShards"
+"() {\n"
+" return providers;\n"
+" }\n"
+"\n"
+" public DirectoryProvider<?> getDirectoryProviderForAddition"
+"(Class<?> entity, Serializable id, String idInString, Document "
+"document) {\n"
+" Integer customerID = Integer.parseInt(document.getField"
+"(\"customerID\").stringValue());\n"
+" return providers[customerID];\n"
+" }\n"
+"\n"
+" public DirectoryProvider<?>[] getDirectoryProvidersForDeletion"
+"(Class<?> entity, Serializable id, String idInString) {\n"
+" return getDirectoryProvidersForAllShards();\n"
+" }\n"
+"\n"
+"<emphasis role=\"bold\"> /**\n"
+" * Optimization; don't search ALL shards and union the results; in "
+"this case, we \n"
+" * can be certain that all the data for a particular customer Filter "
+"is in a single\n"
+" * shard; simply return that shard by customerID.\n"
+" */\n"
+" public DirectoryProvider<?>[] getDirectoryProvidersForQuery"
+"(FullTextFilterImplementor[] filters) {\n"
+" FFullTextFilter filter = getCustomerFilter(filters, "
+"\"customer\");\n"
+" if (filter == null) {\n"
+" return getDirectoryProvidersForAllShards();\n"
+" }\n"
+" else {\n"
+" return new DirectoryProvider[] { providers[Integer."
+"parseInt(filter.getParameter(\"customerID\").toString())] };\n"
+" }\n"
+" }\n"
+"\n"
+" private FullTextFilter getFilter(FullTextFilterImplementor[] "
+"filters, String name) {\n"
+" for (FullTextFilterImplementor filter: filters) {\n"
+" if (filter.getName().equals(name)) return filter;\n"
+" }\n"
+" return null;\n"
+" }</emphasis>\n"
+"\n"
+"}"
+msgstr ""
+
+#. Tag: para
+#: query.xml:741
+#, no-c-format
+msgid ""
+"In this example, if the filter named <literal>customer</literal> is present, "
+"we make sure to only use the shard dedicated to this customer. Otherwise, we "
+"return all shards. A given Sharding strategy can react to one or more "
+"filters and depends on their parameters."
+msgstr ""
+
+#. Tag: para
+#: query.xml:746
+#, no-c-format
+msgid ""
+"The second step is simply to activate the filter at query time. While the "
+"filter can be a regular filter (as defined in <xref linkend=\"query-filter\"/"
+">) which also filters Lucene results after the query, you can make use of a "
+"special filter that will only be passed to the sharding strategy and "
+"otherwise ignored for the rest of the query. Simply use the "
+"<classname>ShardSensitiveOnlyFilter</classname> class when declaring your "
+"filter."
+msgstr ""
+
+#. Tag: programlisting
+#: query.xml:754
+#, no-c-format
+msgid ""
+"@Entity @Indexed\n"
+"<emphasis role=\"bold\">@FullTextFilterDef(name=\"customer\", "
+"impl=ShardSensitiveOnlyFilter.class)</emphasis>\n"
+"public class Customer {\n"
+" ...\n"
+"}\n"
+"\n"
+"\n"
+"FullTextQuery query = ftEm.createFullTextQuery(luceneQuery, Customer."
+"class);\n"
+"<emphasis role=\"bold\">query.enableFulltextFilter(\"customer\").setParameter"
+"(\"CustomerID\", 5);</emphasis>\n"
+"@SuppressWarnings(\"unchecked\")\n"
+"List<Customer> results = query.getResultList();"
+msgstr ""
+
+#. Tag: para
+#: query.xml:756
+#, no-c-format
+msgid ""
+"Note that by using the <classname>ShardSensitiveOnlyFilter</classname>, you "
+"do not have to implement any Lucene filter. Using filters and sharding "
+"strategy reacting to these filters is recommended to speed up queries in a "
+"sharded environment."
+msgstr ""
+
+#. Tag: title
+#: query.xml:765
+#, no-c-format
msgid "Optimizing the query process"
msgstr ""
#. Tag: para
-#: query.xml:722
+#: query.xml:767
#, no-c-format
msgid "Query performance depends on several criteria:"
msgstr ""
#. Tag: para
-#: query.xml:726
+#: query.xml:771
#, no-c-format
msgid "the Lucene query itself: read the literature on this subject"
msgstr ""
#. Tag: para
-#: query.xml:731
+#: query.xml:776
#, no-c-format
msgid ""
"the number of object loaded: use pagination (always ;-) ) or index "
@@ -1326,7 +1480,7 @@
msgstr ""
#. Tag: para
-#: query.xml:736
+#: query.xml:781
#, no-c-format
msgid ""
"the way Hibernate Search interacts with the Lucene readers: defines the "
@@ -1334,13 +1488,13 @@
msgstr ""
#. Tag: title
-#: query.xml:744
+#: query.xml:789
#, no-c-format
msgid "Native Lucene Queries"
msgstr ""
#. Tag: para
-#: query.xml:746
+#: query.xml:791
#, no-c-format
msgid ""
"If you wish to use some specific features of Lucene, you can always run "
Modified: search/trunk/pom.xml
===================================================================
--- search/trunk/pom.xml 2010-07-01 15:38:12 UTC (rev 19885)
+++ search/trunk/pom.xml 2010-07-01 20:29:15 UTC (rev 19886)
@@ -345,18 +345,53 @@
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
+ <version>2.2.3</version>
<extensions>true</extensions>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jdocbook-style</artifactId>
- <version>2.0.0</version>
+ <version>2.0.1</version>
<type>jdocbook-style</type>
</dependency>
</dependencies>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/pdf.xsl
+ </stylesheetResource>
+ <finalName>hibernate_search_reference.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml-single.xsl
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/hibernate/jdocbook/xslt/xhtml.xsl
+ </stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <localeSeparator>-</localeSeparator>
+ </options>
+ </configuration>
</plugin>
<plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-style-plugin</artifactId>
+ <version>2.0.0</version>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2</version>
14 years, 4 months
Hibernate SVN: r19885 - in core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test: resulttransformer and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: sharathjreddy
Date: 2010-07-01 11:38:12 -0400 (Thu, 01 Jul 2010)
New Revision: 19885
Added:
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.hbm.xml
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.java
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerA.java
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerB.java
core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java
Log:
HHH-3694 ResultTransformer not used when scroll() is used on a named SQLQuery
Added: core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.hbm.xml
===================================================================
--- core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.hbm.xml (rev 0)
+++ core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.hbm.xml 2010-07-01 15:38:12 UTC (rev 19885)
@@ -0,0 +1,42 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.hibernate.test.resulttransformer.Contract">
+ <id name="id" type="long">
+ <column name="id" />
+ <generator class="native" />
+ </id>
+ <property name="name" />
+ <many-to-one name="a"/>
+
+ <many-to-one name="b"/>
+ <sql-query name="testQuery">
+ <return alias="d" class="org.hibernate.test.resulttransformer.Contract"/>
+ <return-join alias="a" property="d.a"/>
+ <return-join alias="b" property="d.b"/>
+ <![CDATA[
+ select
+ {d.*}, {a.*}, {b.*}
+ from
+ Contract d, PartnerA a, PartnerB b
+ where d.a = a.id and d.b = b.id
+ ]]>
+ </sql-query>
+ </class>
+ <class name="org.hibernate.test.resulttransformer.PartnerA">
+
+ <id name="id" type="long">
+ <column name="id" />
+ <generator class="native" />
+ </id>
+ <property name="name" />
+ </class>
+ <class name="org.hibernate.test.resulttransformer.PartnerB">
+ <id name="id" type="long">
+ <column name="id" />
+
+ <generator class="native" />
+ </id>
+ <property name="name" />
+ </class>
+</hibernate-mapping>
\ No newline at end of file
Added: core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.java
===================================================================
--- core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.java (rev 0)
+++ core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/Contract.java 2010-07-01 15:38:12 UTC (rev 19885)
@@ -0,0 +1,91 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-
+ * party contributors as indicated by the @author tags or express
+ * copyright attribution statements applied by the authors.
+ * All third-party contributions are distributed under license by
+ * Red Hat, Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to
+ * use, modify, copy, or redistribute it subject to the terms and
+ * conditions of the GNU Lesser General Public License, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this distribution; if not, write to:
+ *
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+
+package org.hibernate.test.resulttransformer;
+
+/**
+ * @author Sharath Reddy
+ *
+ */
+public class Contract {
+
+ private Long id;
+ private String name;
+ private PartnerA a;
+ private PartnerB b;
+ private Long custom1;
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public PartnerA getA()
+ {
+ return a;
+ }
+
+ public void setA(PartnerA a)
+ {
+ this.a = a;
+ }
+
+ public PartnerB getB()
+ {
+ return b;
+ }
+
+ public void setB(PartnerB b)
+ {
+ this.b = b;
+ }
+
+ public Long getCustom1()
+ {
+ return custom1;
+ }
+
+ public void setCustom1(Long custom1)
+ {
+ this.custom1 = custom1;
+ }
+}
Added: core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerA.java
===================================================================
--- core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerA.java (rev 0)
+++ core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerA.java 2010-07-01 15:38:12 UTC (rev 19885)
@@ -0,0 +1,55 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-
+ * party contributors as indicated by the @author tags or express
+ * copyright attribution statements applied by the authors.
+ * All third-party contributions are distributed under license by
+ * Red Hat, Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to
+ * use, modify, copy, or redistribute it subject to the terms and
+ * conditions of the GNU Lesser General Public License, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this distribution; if not, write to:
+ *
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+
+package org.hibernate.test.resulttransformer;
+
+/**
+ * @author Sharath Reddy
+ *
+ */
+public class PartnerA {
+
+ private Long id;
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
\ No newline at end of file
Added: core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerB.java
===================================================================
--- core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerB.java (rev 0)
+++ core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/PartnerB.java 2010-07-01 15:38:12 UTC (rev 19885)
@@ -0,0 +1,55 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-
+ * party contributors as indicated by the @author tags or express
+ * copyright attribution statements applied by the authors.
+ * All third-party contributions are distributed under license by
+ * Red Hat, Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to
+ * use, modify, copy, or redistribute it subject to the terms and
+ * conditions of the GNU Lesser General Public License, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this distribution; if not, write to:
+ *
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+
+package org.hibernate.test.resulttransformer;
+
+/**
+ * @author Sharath Reddy
+ *
+ */
+public class PartnerB {
+
+ private Long id;
+ private String name;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+}
Added: core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java
===================================================================
--- core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java (rev 0)
+++ core/branches/Branch_3_5/testsuite/src/test/java/org/hibernate/test/resulttransformer/ResultTransformerTest.java 2010-07-01 15:38:12 UTC (rev 19885)
@@ -0,0 +1,108 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-
+ * party contributors as indicated by the @author tags or express
+ * copyright attribution statements applied by the authors.
+ * All third-party contributions are distributed under license by
+ * Red Hat, Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to
+ * use, modify, copy, or redistribute it subject to the terms and
+ * conditions of the GNU Lesser General Public License, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this distribution; if not, write to:
+ *
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+
+package org.hibernate.test.resulttransformer;
+
+import java.util.List;
+
+import org.hibernate.Query;
+import org.hibernate.ScrollableResults;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.junit.functional.FunctionalTestCase;
+import org.hibernate.transform.ResultTransformer;
+
+/**
+ * @author Sharath Reddy
+ *
+ */
+public class ResultTransformerTest extends FunctionalTestCase {
+
+ public ResultTransformerTest(String string) {
+ super(string);
+ }
+
+ /**
+ * HHH-3694 ResultTransformer not used when scroll() is used on a named SQLQuery
+ */
+ public void testResultTransformerIsAppliedToScrollableResults() throws Exception
+ {
+ Session s = openSession();
+ Transaction tx = s.beginTransaction();
+
+ PartnerA a = new PartnerA();
+ a.setName("Partner A");
+ PartnerB b = new PartnerB();
+ b.setName("Partner B");
+ Contract obj1 = new Contract();
+ obj1.setName("Contract");
+ obj1.setA(a);
+ obj1.setB(b);
+ s.save(a);
+ s.save(b);
+ s.save(obj1);
+
+ tx.commit();
+ s.close();
+
+ s = openSession();
+
+ Query q = s.getNamedQuery(Contract.class.getName() + ".testQuery");
+ q.setFetchSize(100);
+ q.setResultTransformer(new ResultTransformer() {
+
+ private static final long serialVersionUID = -5815434828170704822L;
+
+ public Object transformTuple(Object[] arg0, String[] arg1)
+ {
+ // return only the PartnerA object from the query
+ return arg0[1];
+ }
+
+ @SuppressWarnings("unchecked")
+ public List transformList(List arg0)
+ {
+ return arg0;
+ }
+ });
+ ScrollableResults sr = q.scroll();
+ sr.first();
+ Object[] row = sr.get();
+ assertEquals(1, row.length);
+ Object obj = row[0];
+ assertTrue(obj instanceof PartnerA);
+ PartnerA obj2 = (PartnerA) obj;
+ assertEquals("Partner A", obj2.getName());
+ s.close();
+ }
+
+ public String[] getMappings() {
+ return new String[] { "resulttransformer/Contract.hbm.xml" };
+ }
+}
+
+
14 years, 4 months
Hibernate SVN: r19884 - core/branches/Branch_3_5/core/src/main/java/org/hibernate/loader/custom.
by hibernate-commits@lists.jboss.org
Author: sharathjreddy
Date: 2010-07-01 11:36:46 -0400 (Thu, 01 Jul 2010)
New Revision: 19884
Modified:
core/branches/Branch_3_5/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java
Log:
HHH-3694 ResultTransformer not used when scroll() is used on a named SQLQuery
Modified: core/branches/Branch_3_5/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java
===================================================================
--- core/branches/Branch_3_5/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java 2010-07-01 11:26:39 UTC (rev 19883)
+++ core/branches/Branch_3_5/core/src/main/java/org/hibernate/loader/custom/CustomLoader.java 2010-07-01 15:36:46 UTC (rev 19884)
@@ -328,7 +328,7 @@
}
static private HolderInstantiator getHolderInstantiator(ResultTransformer resultTransformer, String[] queryReturnAliases) {
- if ( resultTransformer != null ) {
+ if ( resultTransformer == null ) {
return HolderInstantiator.NOOP_INSTANTIATOR;
}
else {
14 years, 4 months
Hibernate SVN: r19883 - core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes.
by hibernate-commits@lists.jboss.org
Author: sharathjreddy
Date: 2010-07-01 07:26:39 -0400 (Thu, 01 Jul 2010)
New Revision: 19883
Added:
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/Printer.java
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/PrinterCable.java
Modified:
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/BackquoteTest.java
Log:
HHH-4647 Problems with @JoinColumn referencedColumnName and quoted column and table names
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/BackquoteTest.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/BackquoteTest.java 2010-07-01 11:25:53 UTC (rev 19882)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/BackquoteTest.java 2010-07-01 11:26:39 UTC (rev 19883)
@@ -6,6 +6,7 @@
import junit.framework.TestCase;
+import org.hibernate.MappingException;
import org.hibernate.cfg.AnnotationConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -34,4 +35,33 @@
fail(e.getMessage());
}
}
+
+ /**
+ * HHH-4647 : Problems with @JoinColumn referencedColumnName and quoted column and table names
+ *
+ * An invalid referencedColumnName to an entity having a quoted table name results in an
+ * infinite loop in o.h.c.Configuration$MappingsImpl#getPhysicalColumnName().
+ * The same issue exists with getLogicalColumnName()
+ */
+ public void testInvalidReferenceToQuotedTableName() {
+ try {
+ AnnotationConfiguration config = new AnnotationConfiguration();
+ config.addAnnotatedClass(Printer.class);
+ config.addAnnotatedClass(PrinterCable.class);
+ config.buildSessionFactory();
+ fail("expected MappingException to be thrown");
+ }
+ //we WANT MappingException to be thrown
+ catch( MappingException e ) {
+ assertTrue("MappingException was thrown", true);
+ }
+ catch(Exception e) {
+ StringWriter writer = new StringWriter();
+ e.printStackTrace(new PrintWriter(writer));
+ log.debug(writer.toString());
+ fail(e.getMessage());
+ }
+ }
+
+
}
Added: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/Printer.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/Printer.java (rev 0)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/Printer.java 2010-07-01 11:26:39 UTC (rev 19883)
@@ -0,0 +1,48 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-
+ * party contributors as indicated by the @author tags or express
+ * copyright attribution statements applied by the authors.
+ * All third-party contributions are distributed under license by
+ * Red Hat, Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to
+ * use, modify, copy, or redistribute it subject to the terms and
+ * conditions of the GNU Lesser General Public License, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this distribution; if not, write to:
+ *
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+
+package org.hibernate.test.annotations.backquotes;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+
+@Entity
+@Table(name="`Printer`")
+public class Printer {
+ private Long id;
+
+ @Id
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+}
\ No newline at end of file
Added: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/PrinterCable.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/PrinterCable.java (rev 0)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/backquotes/PrinterCable.java 2010-07-01 11:26:39 UTC (rev 19883)
@@ -0,0 +1,58 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat, Inc. and/or its affiliates or third-
+ * party contributors as indicated by the @author tags or express
+ * copyright attribution statements applied by the authors.
+ * All third-party contributions are distributed under license by
+ * Red Hat, Inc.
+ *
+ * This copyrighted material is made available to anyone wishing to
+ * use, modify, copy, or redistribute it subject to the terms and
+ * conditions of the GNU Lesser General Public License, as published
+ * by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this distribution; if not, write to:
+ *
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+
+package org.hibernate.test.annotations.backquotes;
+
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+@Entity
+public class PrinterCable {
+ private Long id;
+ private Printer printer;
+
+ @Id
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @ManyToOne
+ @JoinColumn(name="aId", referencedColumnName="missing")
+ public Printer getPrinter() {
+ return printer;
+ }
+
+ public void setPrinter(Printer a) {
+ this.printer = a;
+ }
+}
\ No newline at end of file
14 years, 4 months
Hibernate SVN: r19882 - core/branches/Branch_3_5/core/src/main/java/org/hibernate/cfg.
by hibernate-commits@lists.jboss.org
Author: sharathjreddy
Date: 2010-07-01 07:25:53 -0400 (Thu, 01 Jul 2010)
New Revision: 19882
Modified:
core/branches/Branch_3_5/core/src/main/java/org/hibernate/cfg/Configuration.java
Log:
HHH-4647 Problems with @JoinColumn referencedColumnName and quoted column and table names
Modified: core/branches/Branch_3_5/core/src/main/java/org/hibernate/cfg/Configuration.java
===================================================================
--- core/branches/Branch_3_5/core/src/main/java/org/hibernate/cfg/Configuration.java 2010-07-01 11:09:45 UTC (rev 19881)
+++ core/branches/Branch_3_5/core/src/main/java/org/hibernate/cfg/Configuration.java 2010-07-01 11:25:53 UTC (rev 19882)
@@ -2718,12 +2718,15 @@
finalName = ( String ) binding.logicalToPhysical.get( logicalName );
}
String key = buildTableNameKey(
- currentTable.getSchema(), currentTable.getCatalog(), currentTable.getName()
+ currentTable.getQuotedSchema(), currentTable.getCatalog(), currentTable.getQuotedName()
);
TableDescription description = ( TableDescription ) tableNameBinding.get( key );
if ( description != null ) {
currentTable = description.denormalizedSupertable;
}
+ else {
+ currentTable = null;
+ }
} while ( finalName == null && currentTable != null );
if ( finalName == null ) {
@@ -2744,12 +2747,15 @@
logical = ( String ) binding.physicalToLogical.get( physicalName );
}
String key = buildTableNameKey(
- currentTable.getSchema(), currentTable.getCatalog(), currentTable.getName()
+ currentTable.getQuotedSchema(), currentTable.getCatalog(), currentTable.getQuotedName()
);
description = ( TableDescription ) tableNameBinding.get( key );
if ( description != null ) {
currentTable = description.denormalizedSupertable;
}
+ else {
+ currentTable = null;
+ }
}
while ( logical == null && currentTable != null && description != null );
if ( logical == null ) {
14 years, 4 months
Hibernate SVN: r19881 - in core/branches/Branch_3_5/annotations/src: test/java/org/hibernate/test/annotations/onetoone and 1 other directory.
by hibernate-commits@lists.jboss.org
Author: sharathjreddy
Date: 2010-07-01 07:09:45 -0400 (Thu, 01 Jul 2010)
New Revision: 19881
Modified:
core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OwnerAddress.java
core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/Party.java
Log:
HHH-5109 @OneToOne - too many joins
Modified: core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java 2010-06-30 18:30:58 UTC (rev 19880)
+++ core/branches/Branch_3_5/annotations/src/main/java/org/hibernate/cfg/AnnotationBinder.java 2010-07-01 11:09:45 UTC (rev 19881)
@@ -1563,7 +1563,9 @@
}
}
//MapsId means the columns belong to the pk => not null
- final boolean mandatory = !ann.optional() || forcePersist;
+ //@PKJC must be constrained
+ final boolean mandatory = !ann.optional() || forcePersist || trueOneToOne;
+
bindOneToOne(
getCascadeStrategy( ann.cascade(), hibernateCascade, ann.orphanRemoval(), forcePersist ),
joinColumns,
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java 2010-06-30 18:30:58 UTC (rev 19880)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OneToOneTest.java 2010-07-01 11:09:45 UTC (rev 19881)
@@ -3,6 +3,7 @@
import java.util.Iterator;
+import org.hibernate.EmptyInterceptor;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
@@ -175,7 +176,6 @@
party.partyAffiliate = affiliate;
affiliate.party = party;
s.persist( party );
- s.persist( affiliate );
s.getTransaction().commit();
s.clear();
@@ -270,6 +270,40 @@
"The mapping defines join columns which could not be found in the metadata.", fooFound && barFound
);
}
+
+ /**
+ * HHH-5109 @OneToOne - too many joins
+ * This test uses an interceptor to verify that correct number of joins
+ * are generated.
+ */
+ public void testPkOneToOneSelectStatementDoesNotGenerateExtraJoin() {
+
+ Session s = openSession(new JoinCounter(1));
+ Transaction tx = s.beginTransaction();
+ Owner owner = new Owner();
+ OwnerAddress address = new OwnerAddress();
+ owner.setAddress( address );
+ address.setOwner( owner );
+ s.persist( owner );
+ s.flush();
+ s.clear();
+
+ owner = ( Owner ) s.get( Owner.class, owner.getId() );
+ assertNotNull( owner );
+ assertNotNull( owner.getAddress() );
+ assertEquals( owner.getId(), owner.getAddress().getId() );
+ s.flush();
+ s.clear();
+
+ address = ( OwnerAddress ) s.get( OwnerAddress.class, address.getId() );
+ assertNotNull( address );
+ assertNotNull( address.getOwner() );
+ assertEquals( address.getId(), address.getOwner().getId() );
+
+ tx.rollback();
+ s.close();
+ }
+
/**
* @see org.hibernate.test.annotations.TestCase#getAnnotatedClasses()
@@ -299,3 +333,55 @@
return new String[] { "org/hibernate/test/annotations/onetoone/orm.xml" };
}
}
+
+
+/**
+ * Verifies that generated 'select' statement has desired number of joins
+ * @author Sharath Reddy
+ *
+ */
+class JoinCounter extends EmptyInterceptor {
+
+ private static final long serialVersionUID = -3689681272273261051L;
+
+ private int expectedNumberOfJoins = 0;
+
+ public JoinCounter(int val) {
+ super();
+ this.expectedNumberOfJoins = val;
+ }
+
+ public String onPrepareStatement(String sql) {
+
+ int numberOfJoins = 0;
+ if (sql.startsWith("select")) {
+ numberOfJoins = count(sql, "join");
+ TestCase.assertEquals(expectedNumberOfJoins, numberOfJoins);
+ }
+
+ return sql;
+ }
+
+ /**
+ * Count the number of instances of substring within a string.
+ *
+ * @param string String to look for substring in.
+ * @param substring Sub-string to look for.
+ * @return Count of substrings in string.
+ */
+ private int count(final String string, final String substring)
+ {
+ int count = 0;
+ int idx = 0;
+
+ while ((idx = string.indexOf(substring, idx)) != -1)
+ {
+ idx++;
+ count++;
+ }
+
+ return count;
+ }
+
+}
+
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OwnerAddress.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OwnerAddress.java 2010-06-30 18:30:58 UTC (rev 19880)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/OwnerAddress.java 2010-07-01 11:09:45 UTC (rev 19881)
@@ -18,7 +18,7 @@
@GenericGenerator(strategy = "foreign", name = "fk", parameters = @Parameter(name="property", value="owner"))
private Integer id;
- @OneToOne(mappedBy="address", optional = false)
+ @OneToOne(mappedBy="address")
private Owner owner;
public Integer getId() {
Modified: core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/Party.java
===================================================================
--- core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/Party.java 2010-06-30 18:30:58 UTC (rev 19880)
+++ core/branches/Branch_3_5/annotations/src/test/java/org/hibernate/test/annotations/onetoone/Party.java 2010-07-01 11:09:45 UTC (rev 19881)
@@ -1,6 +1,7 @@
//$Id$
package org.hibernate.test.annotations.onetoone;
+import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
@@ -14,7 +15,7 @@
@Id
String partyId;
- @OneToOne
+ @OneToOne(cascade=CascadeType.ALL)
@PrimaryKeyJoinColumn
PartyAffiliate partyAffiliate;
}
14 years, 4 months