mirror of https://github.com/apache/lucene.git
SOLR-10778: eliminate local variables in (PageTool,AnalyzeEvaluator,ClassifyStream)
This commit is contained in:
parent
55b0227d8c
commit
3a017e4cf2
|
@ -44,9 +44,8 @@ public class PageTool {
|
|||
Object docs = response.getResponse();
|
||||
if (docs != null) {
|
||||
if (docs instanceof DocSlice) {
|
||||
DocSlice doc_slice = (DocSlice) docs;
|
||||
results_found = doc_slice.matches();
|
||||
start = doc_slice.offset();
|
||||
results_found = ((DocSlice) docs).matches();
|
||||
start = ((DocSlice) docs).offset();
|
||||
} else if(docs instanceof ResultContext) {
|
||||
DocList dl = ((ResultContext) docs).getDocList();
|
||||
results_found = dl.matches();
|
||||
|
|
|
@ -59,9 +59,8 @@ public class AnalyzeEvaluator extends SimpleEvaluator {
|
|||
if (solrCoreObj == null || !(solrCoreObj instanceof SolrCore) ) {
|
||||
throw new SolrException(SolrException.ErrorCode.INVALID_STATE, "StreamContext must have SolrCore in solr-core key");
|
||||
}
|
||||
SolrCore solrCore = (SolrCore) solrCoreObj;
|
||||
|
||||
analyzer = solrCore.getLatestSchema().getFieldType(analyzerField).getIndexAnalyzer();
|
||||
analyzer = ((SolrCore) solrCoreObj).getLatestSchema().getFieldType(analyzerField).getIndexAnalyzer();
|
||||
}
|
||||
|
||||
private void init(String fieldName, String analyzerField) {
|
||||
|
|
|
@ -85,8 +85,7 @@ public class ClassifyStream extends TupleStream implements Expressible {
|
|||
if (solrCoreObj == null || !(solrCoreObj instanceof SolrCore) ) {
|
||||
throw new SolrException(SolrException.ErrorCode.INVALID_STATE, "StreamContext must have SolrCore in solr-core key");
|
||||
}
|
||||
SolrCore solrCore = (SolrCore) solrCoreObj;
|
||||
analyzer = solrCore.getLatestSchema().getFieldType(analyzerField).getIndexAnalyzer();
|
||||
analyzer = ((SolrCore) solrCoreObj).getLatestSchema().getFieldType(analyzerField).getIndexAnalyzer();
|
||||
|
||||
this.docStream.setStreamContext(context);
|
||||
this.modelStream.setStreamContext(context);
|
||||
|
|
Loading…
Reference in New Issue