SOLR-10801: Remove several deprecated methods that were exposed to plugin writers

This commit is contained in:
Chris Hostetter 2017-06-02 10:49:26 -07:00
parent 3b45d8284f
commit 038baaed92
5 changed files with 2 additions and 105 deletions

View File

@ -228,6 +228,8 @@ Other Changes
* SOLR-10799: Extracted functionality to collect eligible replicas from HttpShardHandler.prepDistributed()
to a new method (Domenico Fabio Marino via Tomás Fernández Löbbe)
* SOLR-10801: Remove several deprecated methods that were exposed to plugin writers (hossman)
================== 6.7.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

View File

@ -78,12 +78,6 @@ class OldLuceneQParser extends LuceneQParser {
return super.parse();
}
@Override
@Deprecated
public SortSpec getSort(boolean useGlobal) throws SyntaxError {
return getSortSpec(useGlobal);
}
@Override
public SortSpec getSortSpec(boolean useGlobal) throws SyntaxError {
SortSpec sort = super.getSortSpec(useGlobal);

View File

@ -235,16 +235,6 @@ public abstract class QParser {
return nestedParser;
}
/**
* @param useGlobalParams look up sort, start, rows in global params if not in local params
* @return the sort specification
* @deprecated Use the not misleadingly named getSortSpec() function instead.
*/
@Deprecated
public SortSpec getSort(boolean useGlobalParams) throws SyntaxError {
return getSortSpec(useGlobalParams);
}
/**
* @param useGlobalParams look up sort, start, rows in global params if not in local params
* @return the sort specification

View File

@ -57,32 +57,6 @@ public class QueryParsing {
// true if the value was specified by the "v" param (i.e. v=myval, or v=$param)
public static final String VAL_EXPLICIT = "__VAL_EXPLICIT__";
/**
* Returns the default operator for use by Query Parsers, parsed from the df string
* @param notUsed is not used, but is there for back compat with 3rd party QParsers
* @param df the df string from request
* @deprecated this method is here purely not to break code back compat in 7.x
*/
@Deprecated
public static QueryParser.Operator getQueryParserDefaultOperator(final IndexSchema notUsed,
final String df) {
return parseOP(df);
}
/**
* Returns the effective default field based on the 'df' param.
* TODO: This is kept for 3rd party QParser compat in 7.x. Remove this method in Solr 8.0
* @param ignored Not in use
* @param df the default field, which will be returned as-is
* @see org.apache.solr.common.params.CommonParams#DF
* @deprecated IndexScema does not contain defaultField anymore, you must rely on df alone
*/
@Deprecated
public static String getDefaultField(final IndexSchema ignored, final String df) {
return df;
}
/**
* @param txt Text to parse
* @param start Index into text for start of parsing

View File

@ -35,7 +35,6 @@ import java.util.TreeMap;
import java.util.regex.Pattern;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexableField;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
@ -44,8 +43,6 @@ import org.apache.lucene.search.DisjunctionMaxQuery;
import org.apache.lucene.search.Explanation;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.MapSolrParams;
@ -1009,66 +1006,6 @@ public class SolrPluginUtils {
}
}
/**
* Convert a DocList to a SolrDocumentList
*
* The optional param "ids" is populated with the lucene document id
* for each SolrDocument.
*
* @param docs The {@link org.apache.solr.search.DocList} to convert
* @param searcher The {@link org.apache.solr.search.SolrIndexSearcher} to use to load the docs from the Lucene index
* @param fields The names of the Fields to load
* @param ids A map to store the ids of the docs
* @return The new {@link org.apache.solr.common.SolrDocumentList} containing all the loaded docs
* @throws java.io.IOException if there was a problem loading the docs
* @since solr 1.4
* @deprecated TODO in 7.0 remove this. It was inlined into ClusteringComponent. DWS: 'ids' is ugly.
*/
public static SolrDocumentList docListToSolrDocumentList(
DocList docs,
SolrIndexSearcher searcher,
Set<String> fields,
Map<SolrDocument, Integer> ids ) throws IOException
{
/* DWS deprecation note:
It's only called by ClusteringComponent, and I think the "ids" param aspect is a bit messy and not worth supporting.
If someone wants a similar method they can speak up and we can add a method to SolrDocumentFetcher.
*/
IndexSchema schema = searcher.getSchema();
SolrDocumentList list = new SolrDocumentList();
list.setNumFound(docs.matches());
list.setMaxScore(docs.maxScore());
list.setStart(docs.offset());
DocIterator dit = docs.iterator();
while (dit.hasNext()) {
int docid = dit.nextDoc();
Document luceneDoc = searcher.doc(docid, fields);
SolrDocument doc = new SolrDocument();
for( IndexableField field : luceneDoc) {
if (null == fields || fields.contains(field.name())) {
SchemaField sf = schema.getField( field.name() );
doc.addField( field.name(), sf.getType().toObject( field ) );
}
}
if (docs.hasScores() && (null == fields || fields.contains("score"))) {
doc.addField("score", dit.score());
}
list.add( doc );
if( ids != null ) {
ids.put( doc, new Integer(docid) );
}
}
return list;
}
public static void invokeSetters(Object bean, Iterable<Map.Entry<String,Object>> initArgs) {
invokeSetters(bean, initArgs, false);
}