diff --git a/solr/src/java/org/apache/solr/core/SolrConfig.java b/solr/src/java/org/apache/solr/core/SolrConfig.java index 27a8d4b724a..408ebef4269 100644 --- a/solr/src/java/org/apache/solr/core/SolrConfig.java +++ b/solr/src/java/org/apache/solr/core/SolrConfig.java @@ -17,6 +17,7 @@ package org.apache.solr.core; +import org.apache.solr.common.SolrException; import org.apache.solr.common.util.DOMUtil; import org.apache.solr.common.util.RegexFileFilter; import org.apache.solr.common.util.NamedList; diff --git a/solr/src/java/org/apache/solr/core/SolrException.java b/solr/src/java/org/apache/solr/core/SolrException.java deleted file mode 100644 index 5e92a61a4d8..00000000000 --- a/solr/src/java/org/apache/solr/core/SolrException.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.solr.core; - -/** - * This class is scheduled for deletion. Please update your code to the moved package. - * - * @deprecated Use org.apache.solr.common.SolrException - */ -@Deprecated -public class SolrException extends org.apache.solr.common.SolrException { - - public SolrException(ErrorCode code, String msg, boolean alreadyLogged) { - super(code, msg, alreadyLogged); - } - - public SolrException(ErrorCode code, String msg, Throwable th, boolean alreadyLogged) { - super(code, msg, th, alreadyLogged); - } - - public SolrException(ErrorCode code, String msg, Throwable th) { - super(code, msg, th); - } - - public SolrException(ErrorCode code, Throwable th) { - super(code, th); - } - - public SolrException(ErrorCode code, String msg) { - super(code, msg); - } -} diff --git a/solr/src/java/org/apache/solr/core/SolrInfoRegistry.java b/solr/src/java/org/apache/solr/core/SolrInfoRegistry.java deleted file mode 100644 index cf179a6d723..00000000000 --- a/solr/src/java/org/apache/solr/core/SolrInfoRegistry.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.solr.core; - -import org.apache.solr.core.SolrInfoMBean; -import org.apache.solr.core.SolrCore; -import java.util.*; - -/** - * @version $Id$ - * - * @deprecated Solr now supports multiple cores and no longer uses a static singleton for SolrCore. - */ - -// A Registry to hold a collection of SolrInfo objects - -@Deprecated -public class SolrInfoRegistry { - - @Deprecated - public static Map getRegistry() { - return SolrCore.getSolrCore().getInfoRegistry(); - } -} diff --git a/solr/src/java/org/apache/solr/tst/OldRequestHandler.java b/solr/src/java/org/apache/solr/tst/OldRequestHandler.java deleted file mode 100644 index 13183e3ed2d..00000000000 --- a/solr/src/java/org/apache/solr/tst/OldRequestHandler.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.solr.tst; - -import org.apache.lucene.search.*; -import org.apache.lucene.document.Document; - -import java.util.List; -import java.io.IOException; -import java.net.URL; - -import org.apache.solr.search.DocSlice; -import org.apache.solr.search.QueryParsing; -import org.apache.solr.common.util.NamedList; -import org.apache.solr.common.util.StrUtils; -import org.apache.solr.core.SolrCore; -import org.apache.solr.request.SolrRequestHandler; -import org.apache.solr.request.SolrQueryRequest; -import org.apache.solr.response.SolrQueryResponse; - -/** - * @version $Id$ - * - * @deprecated Test against the real request handlers instead. - */ -@Deprecated -public class OldRequestHandler implements SolrRequestHandler { - long numRequests; - long numErrors; - - public void init(NamedList args) { - SolrCore.log.info( "Unused request handler arguments:" + args); - } - - - public void handleRequest(SolrQueryRequest req, SolrQueryResponse rsp) { - numRequests++; - - Query query = null; - Filter filter = null; - - List commands = StrUtils.splitSmart(req.getQueryString(),';'); - - String qs = commands.size() >= 1 ? commands.get(0) : ""; - query = QueryParsing.parseQuery(qs, req.getSchema()); - - // If the first non-query, non-filter command is a simple sort on an indexed field, then - // we can use the Lucene sort ability. - Sort sort = null; - if (commands.size() >= 2) { - sort = QueryParsing.parseSort(commands.get(1), req); - } - - - try { - - int numHits; - ScoreDoc[] scoreDocs; - if (sort != null) { - TopFieldDocs hits = req.getSearcher().search(query, filter, - req.getStart() + req.getLimit(), sort); - scoreDocs = hits.scoreDocs; - numHits = hits.totalHits; - } else { - TopDocs hits = req.getSearcher().search(query, filter, - req.getStart() + req.getLimit()); - scoreDocs = hits.scoreDocs; - numHits = hits.totalHits; - } - - int startRow = Math.min(numHits, req.getStart()); - int endRow = Math.min(numHits,req.getStart()+req.getLimit()); - int numRows = endRow-startRow; - - int[] ids = new int[numRows]; - Document[] data = new Document[numRows]; - for (int i=startRow; i commands = StrUtils.splitSmart(sreq,';'); - - String qs = commands.size() >= 1 ? commands.get(0) : ""; - Query query = QueryParsing.parseQuery(qs, req.getSchema()); - - // find fieldnames to return (fieldlist) - String fl = req.getParam("fl"); - int flags=0; - if (fl != null) { - // TODO - this could become more efficient if widely used. - // TODO - should field order be maintained? - String[] flst = splitList.split(fl,0); - if (flst.length > 0 && !(flst.length==1 && flst[0].length()==0)) { - Set set = new HashSet(); - for (String fname : flst) { - if ("score".equals(fname)) flags |= SolrIndexSearcher.GET_SCORES; - set.add(fname); - } - rsp.setReturnFields(set); - } - } - - - // If the first non-query, non-filter command is a simple sort on an indexed field, then - // we can use the Lucene sort ability. - Sort sort = null; - if (commands.size() >= 2) { - sort = QueryParsing.parseSort(commands.get(1), req); - } - - SolrIndexSearcher searcher = req.getSearcher(); - - /*** - Object o = searcher.cacheLookup("dfllNode", query); - if (o == null) { - searcher.cacheInsert("dfllNode",query,"Hello Bob"); - } else { - System.out.println("User Cache Hit On " + o); - } - ***/ - - int start=req.getStart(); - int limit=req.getLimit(); - - Query filterQuery=null; - DocSet filter=null; - Filter lfilter=null; - - DocList results = req.getSearcher().getDocList(query, null, sort, req.getStart(), req.getLimit(), flags); - rsp.add(null, results); - - - if (qs.startsWith("values")) { - rsp.add("testname1","testval1"); - - rsp.add("testarr1",new String[]{"my val 1","my val 2"}); - - NamedList nl = new NamedList(); - nl.add("myInt", 333); - nl.add("myNullVal", null); - nl.add("myFloat",1.414213562f); - nl.add("myDouble", 1e100d); - nl.add("myBool", false); - nl.add("myLong",999999999999L); - - Document doc = new Document(); - doc.add(new Field("id","55",Field.Store.YES, Field.Index.NOT_ANALYZED)); - nl.add("myDoc",doc); - - nl.add("myResult",results); - nl.add("myStr","&wow! test escaping: a&b(); - args.put("version","2.0"); - req = new LocalSolrQueryRequest(h.getCore(), "values", - "test", 0, 10, args); - assertQ(req - ); - } } diff --git a/solr/src/test/test-files/solr/conf/solrconfig.xml b/solr/src/test/test-files/solr/conf/solrconfig.xml index 32729918d8d..39dbea3f994 100644 --- a/solr/src/test/test-files/solr/conf/solrconfig.xml +++ b/solr/src/test/test-files/solr/conf/solrconfig.xml @@ -279,22 +279,10 @@ - - 1000 - 1.4142135 - 12 - foo - - - sqrt 2 - log 10 - - -