Author: rwesten
Date: Mon Jul 9 14:21:22 2012
New Revision: 1359186
URL: http://svn.apache.org/viewvc?rev=1359186&view=rev
Log:
two changes:
* fixes STANBOL-678 by quoting all escaped query string in the SolrYard
* adds property to allow default initialisation of the SolrCore (if users want
to create a new empty SolrYard instance using the default SolrCore
configuration)
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/query/QueryUtils.java
incubator/stanbol/trunk/entityhub/yard/solr/src/main/resources/OSGI-INF/metatype/metatype.properties
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java?rev=1359186&r1=1359185&r2=1359186&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java
(original)
+++
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/impl/SolrYard.java
Mon Jul 9 14:21:22 2012
@@ -138,6 +138,7 @@ import org.xml.sax.SAXException;
@Property(name = AbstractYard.MAX_QUERY_RESULT_NUMBER, intValue = -1),
// BEGIN SolrYard specific Properties
@Property(name = SolrYard.SOLR_SERVER_LOCATION),
+ @Property(name =
SolrYard.SOLR_INDEX_DEFAULT_CONFIG,boolValue=SolrYard.DEFAULT_SOLR_INDEX_DEFAULT_CONFIG_STATE),
@Property(name = SolrYard.MULTI_YARD_INDEX_LAYOUT,boolValue=false),
@Property(name = SolrYard.MAX_BOOLEAN_CLAUSES, intValue =
SolrYard.defaultMaxBooleanClauses)})
public class SolrYard extends AbstractYard implements Yard {
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/query/QueryUtils.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/query/QueryUtils.java?rev=1359186&r1=1359185&r2=1359186&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/query/QueryUtils.java
(original)
+++
incubator/stanbol/trunk/entityhub/yard/solr/src/main/java/org/apache/stanbol/entityhub/yard/solr/query/QueryUtils.java
Mon Jul 9 14:21:22 2012
@@ -97,8 +97,8 @@ public final class QueryUtils {
if (IndexDataTypeEnum.TXT.getIndexType().equals(indexValue.getType()))
{
if(escape) {
//value does not contain '*' and '?' as they would be escaped.
- queryConstraints = new String[] { value.indexOf(' ')>=0 ?
- '"'+value+'"' : value
+ queryConstraints = new String[] {
+ new StringBuilder(value).insert(0,
'"').append('"').toString()
};
} else { //non escaped strings might contain wildcard chars '*',
'?'
//those need to be treated specially (STANBOL-607)
Modified:
incubator/stanbol/trunk/entityhub/yard/solr/src/main/resources/OSGI-INF/metatype/metatype.properties
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/entityhub/yard/solr/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1359186&r1=1359185&r2=1359186&view=diff
==============================================================================
---
incubator/stanbol/trunk/entityhub/yard/solr/src/main/resources/OSGI-INF/metatype/metatype.properties
(original)
+++
incubator/stanbol/trunk/entityhub/yard/solr/src/main/resources/OSGI-INF/metatype/metatype.properties
Mon Jul 9 14:21:22 2012
@@ -45,6 +45,12 @@ org.apache.stanbol.entityhub.yard.maxQue
org.apache.stanbol.entityhub.yard.defaultQueryResultNumber.name=Default Query
Results
org.apache.stanbol.entityhub.yard.defaultQueryResultNumber.description=The
default number of results set for queries that do not define such a value (set
to <= 0 for no restriction, values > maximumQueryResult will be replaced by
maximumQueryResult)
+#org.apache.stanbol.entityhub.yard.solr.useDefaultConfig
+org.apache.stanbol.entityhub.yard.solr.useDefaultConfig.name=Use default
SolrCore configuration
+org.apache.stanbol.entityhub.yard.solr.useDefaultConfig.description=This
enables the \
+use of the default SolrCore configuration for this SolrYard. Enabling this
will create \
+an empty SolrCore.
+
#org.apache.stanbol.entityhub.yard.solr.maxBooleanClauses
org.apache.stanbol.entityhub.yard.solr.maxBooleanClauses.name=Max Boolean
Clauses
org.apache.stanbol.entityhub.yard.solr.maxBooleanClauses.description=This is
the maximum number of boolean clauses allowed for Solr queries. This value is
configured in the solrconf.xml by the maxBooleanClauses element.