mirror of https://github.com/apache/lucene.git
SOLR-3336: SolrEntityProcessor substitutes most variables at query time
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1338240 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9d70bf609b
commit
63f87a7bdb
|
@ -21,6 +21,13 @@ Other Changes
|
|||
* SOLR-3422: Refactored internal data classes.
|
||||
All entities in data-config.xml must have a name (James Dyer)
|
||||
|
||||
================== 3.6.1 ==================
|
||||
|
||||
Bug Fixes
|
||||
----------------------
|
||||
* SOLR-3336: SolrEntityProcessor substitutes most variables at query time
|
||||
(Michael Kroh, Lance Norskog, via Martijn van Groningen)
|
||||
|
||||
================== 3.6.0 ==================
|
||||
|
||||
New Features
|
||||
|
|
|
@ -110,34 +110,6 @@ public class SolrEntityProcessor extends EntityProcessorBase {
|
|||
} catch (MalformedURLException e) {
|
||||
throw new DataImportHandlerException(DataImportHandlerException.SEVERE, e);
|
||||
}
|
||||
|
||||
this.queryString = context.getResolvedEntityAttribute(QUERY);
|
||||
if (this.queryString == null) {
|
||||
throw new DataImportHandlerException(
|
||||
DataImportHandlerException.SEVERE,
|
||||
"SolrEntityProcessor: parameter 'query' is required"
|
||||
);
|
||||
}
|
||||
|
||||
String rowsP = context.getResolvedEntityAttribute(CommonParams.ROWS);
|
||||
if (rowsP != null) {
|
||||
rows = Integer.parseInt(rowsP);
|
||||
}
|
||||
|
||||
String fqAsString = context.getResolvedEntityAttribute(CommonParams.FQ);
|
||||
if (fqAsString != null) {
|
||||
this.filterQueries = fqAsString.split(",");
|
||||
}
|
||||
|
||||
String fieldsAsString = context.getResolvedEntityAttribute(CommonParams.FL);
|
||||
if (fieldsAsString != null) {
|
||||
this.fields = fieldsAsString.split(",");
|
||||
}
|
||||
this.queryType = context.getResolvedEntityAttribute(CommonParams.QT);
|
||||
String timeoutAsString = context.getResolvedEntityAttribute(TIMEOUT);
|
||||
if (timeoutAsString != null) {
|
||||
this.timeout = Integer.parseInt(timeoutAsString);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -176,6 +148,34 @@ public class SolrEntityProcessor extends EntityProcessorBase {
|
|||
}
|
||||
|
||||
protected SolrDocumentList doQuery(int start) {
|
||||
this.queryString = context.getResolvedEntityAttribute(QUERY);
|
||||
if (this.queryString == null) {
|
||||
throw new DataImportHandlerException(
|
||||
DataImportHandlerException.SEVERE,
|
||||
"SolrEntityProcessor: parameter 'query' is required"
|
||||
);
|
||||
}
|
||||
|
||||
String rowsP = context.getResolvedEntityAttribute(CommonParams.ROWS);
|
||||
if (rowsP != null) {
|
||||
rows = Integer.parseInt(rowsP);
|
||||
}
|
||||
|
||||
String fqAsString = context.getResolvedEntityAttribute(CommonParams.FQ);
|
||||
if (fqAsString != null) {
|
||||
this.filterQueries = fqAsString.split(",");
|
||||
}
|
||||
|
||||
String fieldsAsString = context.getResolvedEntityAttribute(CommonParams.FL);
|
||||
if (fieldsAsString != null) {
|
||||
this.fields = fieldsAsString.split(",");
|
||||
}
|
||||
this.queryType = context.getResolvedEntityAttribute(CommonParams.QT);
|
||||
String timeoutAsString = context.getResolvedEntityAttribute(TIMEOUT);
|
||||
if (timeoutAsString != null) {
|
||||
this.timeout = Integer.parseInt(timeoutAsString);
|
||||
}
|
||||
|
||||
SolrQuery solrQuery = new SolrQuery(queryString);
|
||||
solrQuery.setRows(rows);
|
||||
solrQuery.setStart(start);
|
||||
|
|
Loading…
Reference in New Issue