Author: skabashnyuk
Date: 2010-02-03 08:27:35 -0500 (Wed, 03 Feb 2010)
New Revision: 1645
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
Log:
EXOJCR-419 : fix
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2010-02-03
13:13:03 UTC (rev 1644)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchIndexConfigurationHelper.java 2010-02-03
13:27:35 UTC (rev 1645)
@@ -23,6 +23,7 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.SimpleParameterEntry;
import org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex;
+import org.exoplatform.services.jcr.util.StringNumberParser;
import java.io.IOException;
@@ -53,7 +54,6 @@
*/
public void init(QueryHandlerEntry queryHandlerEntry) throws IOException,
RepositoryConfigurationException
{
- // TODO: support human-readable values (
https://jira.jboss.org/jira/browse/EXOJCR-419 )
for (SimpleParameterEntry parameter : queryHandlerEntry.getParameters())
{
setParam(parameter.getName(), parameter.getValue());
@@ -68,59 +68,113 @@
{
if (QueryHandlerParams.PARAM_AUTO_REPAIR.equals(name))
+ {
searchIndex.setAutoRepair(Boolean.parseBoolean(value));
+ }
else if (QueryHandlerParams.PARAM_BUFFER_SIZE.equals(name))
- searchIndex.setBufferSize(Integer.parseInt(value));
+ {
+ searchIndex.setBufferSize(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_CACHE_SIZE.equals(name))
- searchIndex.setCacheSize(Integer.parseInt(value));
+ {
+ searchIndex.setCacheSize(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_CONSISTENCY_CHECK_ENABLED.equals(name))
+ {
searchIndex.setEnableConsistencyCheck(Boolean.parseBoolean(value));
+ }
else if (QueryHandlerParams.PARAM_DOCUMENT_ORDER.equals(name))
+ {
searchIndex.setRespectDocumentOrder(Boolean.parseBoolean(value));
+ }
else if (QueryHandlerParams.PARAM_EXCERPTPROVIDER_CLASS.equals(name))
+ {
searchIndex.setExcerptProviderClass(value);
+ }
else if (QueryHandlerParams.PARAM_EXTRACTOR_BACKLOG.equals(name))
- searchIndex.setExtractorBackLogSize(Integer.parseInt(value));
+ {
+ searchIndex.setExtractorBackLogSize(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_EXTRACTOR_POOLSIZE.equals(name))
- searchIndex.setExtractorPoolSize(Integer.parseInt(value));
+ {
+ searchIndex.setExtractorPoolSize(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_EXTRACTOR_TIMEOUT.equals(name))
- searchIndex.setExtractorTimeout(Long.parseLong(value));
+ {
+ searchIndex.setExtractorTimeout(StringNumberParser.parseLong(value));
+ }
else if (QueryHandlerParams.PARAM_FORCE_CONSISTENCYCHECK.equals(name))
+ {
searchIndex.setForceConsistencyCheck(Boolean.parseBoolean(value));
+ }
else if (QueryHandlerParams.PARAM_ERRORLOG_SIZE.equals(name))
- searchIndex.setErrorLogfileSize(Integer.parseInt(value));
+ {
+ searchIndex.setErrorLogfileSize(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_INDEXING_CONFIGURATION_PATH.equals(name))
+ {
searchIndex.setIndexingConfiguration(value);
+ }
else if (QueryHandlerParams.PARAM_INDEXING_CONFIGURATION_CLASS.equals(name))
+ {
searchIndex.setIndexingConfigurationClass(value);
+ }
else if (QueryHandlerParams.PARAM_MAX_FIELD_LENGTH.equals(name))
- searchIndex.setMaxFieldLength(Integer.parseInt(value));
+ {
+ searchIndex.setMaxFieldLength(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_MAX_MERGE_DOCS.equals(name))
- searchIndex.setMaxMergeDocs(Integer.parseInt(value));
+ {
+ searchIndex.setMaxMergeDocs(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_MERGE_FACTOR.equals(name))
- searchIndex.setMergeFactor(Integer.parseInt(value));
+ {
+ searchIndex.setMergeFactor(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_MIN_MERGE_DOCS.equals(name))
- searchIndex.setMinMergeDocs(Integer.parseInt(value));
+ {
+ searchIndex.setMinMergeDocs(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_QUERY_CLASS.equals(name))
+ {
searchIndex.setQueryClass(value);
+ }
else if (QueryHandlerParams.PARAM_RESULT_FETCH_SIZE.equals(name))
- searchIndex.setResultFetchSize(Integer.parseInt(value));
+ {
+ searchIndex.setResultFetchSize(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_SPELLCHECKER_CLASS.equals(name))
+ {
searchIndex.setSpellCheckerClass(value);
+ }
else if (QueryHandlerParams.PARAM_SUPPORT_HIGHLIGHTING.equals(name))
+ {
searchIndex.setSupportHighlighting(Boolean.parseBoolean(value));
+ }
else if (QueryHandlerParams.PARAM_SYNONYMPROVIDER_CLASS.equals(name))
+ {
searchIndex.setSynonymProviderClass(value);
+ }
else if (QueryHandlerParams.PARAM_SYNONYMPROVIDER_CONFIG_PATH.equals(name))
+ {
searchIndex.setSynonymProviderConfigPath(value);
+ }
else if (QueryHandlerParams.PARAM_USE_COMPOUNDFILE.equals(name))
+ {
searchIndex.setUseCompoundFile(Boolean.parseBoolean(value));
+ }
else if (QueryHandlerParams.PARAM_VOLATILE_IDLE_TIME.equals(name))
- searchIndex.setVolatileIdleTime(Integer.parseInt(value));
+ {
+ searchIndex.setVolatileIdleTime(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_MAX_VOLATILE_SIZE.equals(name))
- searchIndex.setMaxVolatileIndexSize(Integer.parseInt(value));
+ {
+ searchIndex.setMaxVolatileIndexSize(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_MAX_VOLATILE_TIME.equals(name))
- searchIndex.setMaxVolatileTime(Integer.parseInt(value));
+ {
+ searchIndex.setMaxVolatileTime(StringNumberParser.parseInt(value));
+ }
else if (QueryHandlerParams.PARAM_ANALYZER_CLASS.equals(name))
{
searchIndex.setAnalyzer(value);