mirror of https://github.com/apache/lucene.git
SOLR-1930: remove solr deprecations
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1052883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
70a3334295
commit
91e9459ef2
|
@ -1,159 +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.util;
|
||||
|
||||
import org.apache.lucene.util.OpenBitSet;
|
||||
|
||||
/** An iterator to iterate over set bits in an OpenBitSet.
|
||||
* This is faster than nextSetBit() for iterating over the complete set of bits,
|
||||
* especially when the density of the bits set is high.
|
||||
*
|
||||
* @deprecated Use {@link org.apache.lucene.util.OpenBitSetIterator} instead.
|
||||
* @version $Id$
|
||||
*/
|
||||
@Deprecated
|
||||
public class BitSetIterator {
|
||||
|
||||
// The General Idea: instead of having an array per byte that has
|
||||
// the offsets of the next set bit, that array could be
|
||||
// packed inside a 32 bit integer (8 4 bit numbers). That
|
||||
// should be faster than accessing an array for each index, and
|
||||
// the total array size is kept smaller (256*sizeof(int))=1K
|
||||
protected final static int[] bitlist={
|
||||
0x0,0x1,0x2,0x21,0x3,0x31,0x32,0x321,0x4,0x41,0x42,0x421,0x43,0x431,0x432,0x4321,0x5,0x51,0x52,0x521,0x53,0x531,0x532,0x5321,0x54,0x541,0x542,0x5421,0x543,0x5431,0x5432,0x54321,0x6,0x61,0x62,0x621,0x63,0x631,0x632,0x6321,0x64,0x641,0x642,0x6421,0x643,0x6431,0x6432,0x64321,0x65,0x651,0x652,0x6521,0x653,0x6531,0x6532,0x65321,0x654,0x6541,0x6542,0x65421,0x6543,0x65431,0x65432,0x654321,0x7,0x71,0x72,0x721,0x73,0x731,0x732,0x7321,0x74,0x741,0x742,0x7421,0x743,0x7431,0x7432,0x74321,0x75,0x751,0x752,0x7521,0x753,0x7531,0x7532,0x75321,0x754,0x7541,0x7542,0x75421,0x7543,0x75431,0x75432,0x754321,0x76,0x761,0x762,0x7621,0x763,0x7631,0x7632,0x76321,0x764,0x7641,0x7642,0x76421,0x7643,0x76431,0x76432,0x764321,0x765,0x7651,0x7652,0x76521,0x7653,0x76531,0x76532,0x765321,0x7654,0x76541,0x76542,0x765421,0x76543,0x765431,0x765432,0x7654321,0x8,0x81,0x82,0x821,0x83,0x831,0x832,0x8321,0x84,0x841,0x842,0x8421,0x843,0x8431,0x8432,0x84321,0x85,0x851,0x852,0x8521,0x853,0x8531,0x8532,0x85321,0x854,0x8541,0x8542,0x85421,0x8543,0x85431,0x85432,0x854321,0x86,0x861,0x862,0x8621,0x863,0x8631,0x8632,0x86321,0x864,0x8641,0x8642,0x86421,0x8643,0x86431,0x86432,0x864321,0x865,0x8651,0x8652,0x86521,0x8653,0x86531,0x86532,0x865321,0x8654,0x86541,0x86542,0x865421,0x86543,0x865431,0x865432,0x8654321,0x87,0x871,0x872,0x8721,0x873,0x8731,0x8732,0x87321,0x874,0x8741,0x8742,0x87421,0x8743,0x87431,0x87432,0x874321,0x875,0x8751,0x8752,0x87521,0x8753,0x87531,0x87532,0x875321,0x8754,0x87541,0x87542,0x875421,0x87543,0x875431,0x875432,0x8754321,0x876,0x8761,0x8762,0x87621,0x8763,0x87631,0x87632,0x876321,0x8764,0x87641,0x87642,0x876421,0x87643,0x876431,0x876432,0x8764321,0x8765,0x87651,0x87652,0x876521,0x87653,0x876531,0x876532,0x8765321,0x87654,0x876541,0x876542,0x8765421,0x876543,0x8765431,0x8765432,0x87654321
|
||||
};
|
||||
/***** the python code that generated bitlist
|
||||
def bits2int(val):
|
||||
arr=0
|
||||
for shift in range(8,0,-1):
|
||||
if val & 0x80:
|
||||
arr = (arr << 4) | shift
|
||||
val = val << 1
|
||||
return arr
|
||||
|
||||
def int_table():
|
||||
tbl = [ hex(bits2int(val)).strip('L') for val in range(256) ]
|
||||
return ','.join(tbl)
|
||||
******/
|
||||
|
||||
// hmmm, what about an iterator that finds zeros though,
|
||||
// or a reverse iterator... should they be separate classes
|
||||
// for efficiency, or have a common root interface? (or
|
||||
// maybe both? could ask for a SetBitsIterator, etc...
|
||||
|
||||
|
||||
private final long[] arr;
|
||||
private final int words;
|
||||
private int i=-1;
|
||||
private long word;
|
||||
private int wordShift;
|
||||
private int indexArray;
|
||||
|
||||
public BitSetIterator(OpenBitSet obs) {
|
||||
this(obs.getBits(), obs.getNumWords());
|
||||
}
|
||||
|
||||
public BitSetIterator(long[] bits, int numWords) {
|
||||
arr = bits;
|
||||
words = numWords;
|
||||
}
|
||||
|
||||
// 64 bit shifts
|
||||
private void shift() {
|
||||
if ((int)word ==0) {wordShift +=32; word = word >>>32; }
|
||||
if ((word & 0x0000FFFF) == 0) { wordShift +=16; word >>>=16; }
|
||||
if ((word & 0x000000FF) == 0) { wordShift +=8; word >>>=8; }
|
||||
indexArray = bitlist[(int)word & 0xff];
|
||||
}
|
||||
|
||||
/***** alternate shift implementations
|
||||
// 32 bit shifts, but a long shift needed at the end
|
||||
private void shift2() {
|
||||
int y = (int)word;
|
||||
if (y==0) {wordShift +=32; y = (int)(word >>>32); }
|
||||
if ((y & 0x0000FFFF) == 0) { wordShift +=16; y>>>=16; }
|
||||
if ((y & 0x000000FF) == 0) { wordShift +=8; y>>>=8; }
|
||||
indexArray = bitlist[y & 0xff];
|
||||
word >>>= (wordShift +1);
|
||||
}
|
||||
|
||||
private void shift3() {
|
||||
int lower = (int)word;
|
||||
int lowByte = lower & 0xff;
|
||||
if (lowByte != 0) {
|
||||
indexArray=bitlist[lowByte];
|
||||
return;
|
||||
}
|
||||
shift();
|
||||
}
|
||||
******/
|
||||
|
||||
public int next() {
|
||||
if (indexArray==0) {
|
||||
if (word!=0) {
|
||||
word >>>= 8;
|
||||
wordShift += 8;
|
||||
}
|
||||
|
||||
while (word==0) {
|
||||
if (++i >= words) return -1;
|
||||
word = arr[i];
|
||||
wordShift =-1; // loop invariant code motion should move this
|
||||
}
|
||||
|
||||
// after the first time, should I go with a linear search, or
|
||||
// stick with the binary search in shift?
|
||||
shift();
|
||||
}
|
||||
|
||||
int bitIndex = (indexArray & 0x0f) + wordShift;
|
||||
indexArray >>>= 4;
|
||||
// should i<<6 be cached as a separate variable?
|
||||
// it would only save one cycle in the best circumstances.
|
||||
return (i<<6) + bitIndex;
|
||||
}
|
||||
|
||||
public int next(int fromIndex) {
|
||||
indexArray=0;
|
||||
i = fromIndex >> 6;
|
||||
if (i>=words) {
|
||||
word =0; // setup so next() will also return -1
|
||||
return -1;
|
||||
}
|
||||
wordShift = fromIndex & 0x3f;
|
||||
word = arr[i] >>> wordShift;
|
||||
if (word !=0) {
|
||||
wordShift--; // compensate for 1 based arrIndex
|
||||
} else {
|
||||
while (word ==0) {
|
||||
if (++i >= words) return -1;
|
||||
word = arr[i];
|
||||
}
|
||||
wordShift =-1;
|
||||
}
|
||||
|
||||
shift();
|
||||
|
||||
int bitIndex = (indexArray & 0x0f) + wordShift;
|
||||
indexArray >>>= 4;
|
||||
// should i<<6 be cached as a separate variable?
|
||||
// it would only save one cycle in the best circumstances.
|
||||
return (i<<6) + bitIndex;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,122 +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.util;
|
||||
|
||||
import org.apache.solr.common.util.NamedList;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* A collection on common params, both for Plugin initialization and
|
||||
* for Requests.
|
||||
* @deprecated Use {@link org.apache.solr.common.params.CommonParams} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public class CommonParams implements org.apache.solr.common.params.CommonParams {
|
||||
|
||||
public static Logger log = LoggerFactory.getLogger(CommonParams.class);
|
||||
|
||||
|
||||
/** the default field list to be used */
|
||||
public String fl = null;
|
||||
/** the default field to query */
|
||||
public String df = null;
|
||||
/** do not debug by default **/
|
||||
public String debugQuery = null;
|
||||
/** no default other explanation query **/
|
||||
public String explainOther = null;
|
||||
/** whether to highlight */
|
||||
public boolean highlight = false;
|
||||
/** fields to highlight */
|
||||
public String highlightFields = null;
|
||||
/** maximum highlight fragments to return */
|
||||
public int maxSnippets = 1;
|
||||
/** override default highlight Formatter class */
|
||||
public String highlightFormatterClass = null;
|
||||
|
||||
|
||||
public CommonParams() {
|
||||
/* :NOOP: */
|
||||
}
|
||||
|
||||
/** @see #setValues */
|
||||
public CommonParams(NamedList args) {
|
||||
this();
|
||||
setValues(args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the params using values from a NamedList, usefull in the
|
||||
* init method for your handler.
|
||||
*
|
||||
* <p>
|
||||
* If any param is not of the expected type, a severe error is
|
||||
* logged,and the param is skipped.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If any param is not of in the NamedList, it is skipped and the
|
||||
* old value is left alone.
|
||||
* </p>
|
||||
*
|
||||
*/
|
||||
public void setValues(NamedList args) {
|
||||
|
||||
Object tmp;
|
||||
|
||||
tmp = args.get(FL);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
fl = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + FL);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(DF);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
df = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + DF);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(DEBUG_QUERY);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
debugQuery = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + DEBUG_QUERY);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(EXPLAIN_OTHER);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
explainOther = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + EXPLAIN_OTHER);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,28 +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.util;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.ContentStream.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface ContentStream extends org.apache.solr.common.util.ContentStream {
|
||||
|
||||
}
|
|
@ -1,29 +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.util;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.ContentStreamBase
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class ContentStreamBase extends org.apache.solr.common.util.ContentStreamBase
|
||||
{
|
||||
|
||||
}
|
|
@ -1,28 +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.util;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.DOMUtil.
|
||||
*/
|
||||
@Deprecated
|
||||
public class DOMUtil extends org.apache.solr.common.util.DOMUtil {
|
||||
|
||||
}
|
|
@ -1,188 +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.util;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.apache.solr.common.util.NamedList;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
* @deprecated Use {@link org.apache.solr.common.params.DisMaxParams} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public class DisMaxParams extends CommonParams implements org.apache.solr.common.params.DisMaxParams {
|
||||
|
||||
public static Logger log = LoggerFactory.getLogger(DisMaxParams.class);
|
||||
|
||||
|
||||
/** query and init param for filtering query
|
||||
* @deprecated use SolrParams.FQ or SolrPluginUtils.parseFilterQueries
|
||||
*/
|
||||
@Deprecated
|
||||
public static String FQ = "fq";
|
||||
|
||||
/**
|
||||
* the default tie breaker to use in DisjunctionMaxQueries
|
||||
* @deprecated - use explicit default with SolrParams.getFloat
|
||||
*/
|
||||
@Deprecated
|
||||
public float tiebreaker = 0.0f;
|
||||
/**
|
||||
* the default query fields to be used
|
||||
* @deprecated - use explicit default with SolrParams.get
|
||||
*/
|
||||
@Deprecated
|
||||
public String qf = null;
|
||||
/**
|
||||
* the default phrase boosting fields to be used
|
||||
* @deprecated - use explicit default with SolrParams.get
|
||||
*/
|
||||
@Deprecated
|
||||
public String pf = null;
|
||||
/**
|
||||
* the default min should match to be used
|
||||
* @deprecated - use explicit default with SolrParams.get
|
||||
*/
|
||||
@Deprecated
|
||||
public String mm = "100%";
|
||||
/**
|
||||
* the default phrase slop to be used
|
||||
* @deprecated - use explicit default with SolrParams.getInt
|
||||
*/
|
||||
@Deprecated
|
||||
public int pslop = 0;
|
||||
/**
|
||||
* the default boosting query to be used
|
||||
* @deprecated - use explicit default with SolrParams.get
|
||||
*/
|
||||
@Deprecated
|
||||
public String bq = null;
|
||||
/**
|
||||
* the default boosting functions to be used
|
||||
* @deprecated - use explicit default with SolrParams.get
|
||||
*/
|
||||
@Deprecated
|
||||
public String bf = null;
|
||||
/**
|
||||
* the default filtering query to be used
|
||||
* @deprecated - use explicit default with SolrParams.get
|
||||
*/
|
||||
@Deprecated
|
||||
public String fq = null;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the params using values from a NamedList, usefull in the
|
||||
* init method for your handler.
|
||||
*
|
||||
* <p>
|
||||
* If any param is not of the expected type, a severe error is
|
||||
* logged,and the param is skipped.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If any param is not of in the NamedList, it is skipped and the
|
||||
* old value is left alone.
|
||||
* </p>
|
||||
* @deprecated use SolrParams.toSolrParams
|
||||
*/
|
||||
@Deprecated
|
||||
public void setValues(NamedList args) {
|
||||
|
||||
super.setValues(args);
|
||||
|
||||
Object tmp;
|
||||
|
||||
tmp = args.get(TIE);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof Float) {
|
||||
tiebreaker = ((Float)tmp).floatValue();
|
||||
} else {
|
||||
log.error("init param is not a float: " + TIE);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(QF);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
qf = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + QF);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(PF);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
pf = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + PF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
tmp = args.get(MM);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
mm = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + MM);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(PS);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof Integer) {
|
||||
pslop = ((Integer)tmp).intValue();
|
||||
} else {
|
||||
log.error("init param is not an int: " + PS);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(BQ);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
bq = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + BQ);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(BF);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
bf = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + BF);
|
||||
}
|
||||
}
|
||||
|
||||
tmp = args.get(FQ);
|
||||
if (null != tmp) {
|
||||
if (tmp instanceof String) {
|
||||
fq = tmp.toString();
|
||||
} else {
|
||||
log.error("init param is not a str: " + FQ);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,157 +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.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.LinkedList;
|
||||
import java.util.ArrayList;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.apache.solr.common.params.DefaultSolrParams;
|
||||
import org.apache.solr.common.params.HighlightParams;
|
||||
import org.apache.solr.common.params.MapSolrParams;
|
||||
import org.apache.solr.common.params.SolrParams;
|
||||
import org.apache.solr.common.util.NamedList;
|
||||
import org.apache.solr.common.util.SimpleOrderedMap;
|
||||
import org.apache.solr.request.*;
|
||||
import org.apache.solr.search.DocIterator;
|
||||
import org.apache.solr.search.DocList;
|
||||
import org.apache.solr.search.SolrIndexSearcher;
|
||||
import org.apache.solr.schema.SchemaField;
|
||||
import org.apache.solr.highlight.SolrHighlighter;
|
||||
import org.apache.solr.highlight.DefaultSolrHighlighter;
|
||||
|
||||
import org.apache.lucene.analysis.*;
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.search.Query;
|
||||
import org.apache.lucene.search.highlight.*;
|
||||
|
||||
/**
|
||||
* DEPRECATED Collection of Utility and Factory methods for Highlighting.
|
||||
*
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter
|
||||
*/
|
||||
@Deprecated
|
||||
public class HighlightingUtils implements HighlightParams {
|
||||
|
||||
static SolrParams DEFAULTS = null;
|
||||
static {
|
||||
Map<String,String> map = new HashMap<String,String>();
|
||||
map.put(SNIPPETS, "1");
|
||||
map.put(FRAGSIZE, "100");
|
||||
map.put(FORMATTER, SIMPLE);
|
||||
map.put(SIMPLE_PRE, "<em>");
|
||||
map.put(SIMPLE_POST, "</em>");
|
||||
|
||||
DEFAULTS = new MapSolrParams(map);
|
||||
}
|
||||
|
||||
private static SolrHighlighterX HIGHLIGHTER = new SolrHighlighterX();
|
||||
|
||||
/** Combine request parameters with highlighting defaults. */
|
||||
static SolrParams getParams(SolrQueryRequest request) {
|
||||
return new DefaultSolrParams(request.getParams(), DEFAULTS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter#isHighlightingEnabled
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isHighlightingEnabled(SolrQueryRequest request) {
|
||||
return HIGHLIGHTER.isHighlightingEnabled(getParams(request));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter
|
||||
*/
|
||||
@Deprecated
|
||||
public static Highlighter getHighlighter(Query query, String fieldName, SolrQueryRequest request) {
|
||||
return HIGHLIGHTER.getHighlighterX(query, fieldName, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter#getHighlightFields
|
||||
*/
|
||||
@Deprecated
|
||||
public static String[] getHighlightFields(Query query, SolrQueryRequest request, String[] defaultFields) {
|
||||
return HIGHLIGHTER.getHighlightFields(query, request, defaultFields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter
|
||||
*/
|
||||
@Deprecated
|
||||
public static int getMaxSnippets(String fieldName, SolrQueryRequest request) {
|
||||
return HIGHLIGHTER.getMaxSnippetsX(fieldName, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter
|
||||
*/
|
||||
@Deprecated
|
||||
public static Formatter getFormatter(String fieldName, SolrQueryRequest request) {
|
||||
return HIGHLIGHTER.getFormatterX(fieldName, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter
|
||||
*/
|
||||
@Deprecated
|
||||
public static Fragmenter getFragmenter(String fieldName, SolrQueryRequest request) {
|
||||
return HIGHLIGHTER.getFragmenterX(fieldName, request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use DefaultSolrHighlighter
|
||||
* @see DefaultSolrHighlighter#doHighlighting
|
||||
*/
|
||||
@Deprecated @SuppressWarnings("unchecked")
|
||||
public static NamedList doHighlighting(DocList docs, Query query, SolrQueryRequest req, String[] defaultFields) throws IOException {
|
||||
return HIGHLIGHTER.doHighlighting(docs, query, req, defaultFields);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* subclass containing package protected versions of some protected methods, used for proxying calls to deprecated methods that have been moved and made protected.
|
||||
*/
|
||||
class SolrHighlighterX extends DefaultSolrHighlighter {
|
||||
Highlighter getHighlighterX(Query query, String fieldName, SolrQueryRequest request) {
|
||||
return getHighlighter(query, fieldName, request);
|
||||
}
|
||||
int getMaxSnippetsX(String fieldName, SolrQueryRequest request) {
|
||||
return getMaxSnippets(fieldName, HighlightingUtils.getParams(request));
|
||||
}
|
||||
Formatter getFormatterX(String fieldName, SolrQueryRequest request) {
|
||||
return getFormatter(fieldName, HighlightingUtils.getParams(request));
|
||||
}
|
||||
Fragmenter getFragmenterX(String fieldName, SolrQueryRequest request) {
|
||||
return getFragmenter(fieldName, HighlightingUtils.getParams(request));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +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.util;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.IteratorChain<E>.
|
||||
*/
|
||||
@Deprecated
|
||||
public class IteratorChain<E> extends org.apache.solr.common.util.IteratorChain<E> {
|
||||
|
||||
}
|
|
@ -1,42 +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.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.NamedList<T>.
|
||||
*/
|
||||
@Deprecated
|
||||
public class NamedList<T> extends org.apache.solr.common.util.NamedList<T> {
|
||||
public NamedList() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public NamedList(List nameValuePairs) {
|
||||
super(nameValuePairs);
|
||||
}
|
||||
|
||||
public NamedList(Map.Entry<String, T>[] nameValuePairs) {
|
||||
super(nameValuePairs);
|
||||
}
|
||||
}
|
|
@ -1,42 +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.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.SimpleOrderedMap<T>.
|
||||
*/
|
||||
@Deprecated
|
||||
public class SimpleOrderedMap<T> extends org.apache.solr.common.util.SimpleOrderedMap<T> {
|
||||
|
||||
public SimpleOrderedMap() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public SimpleOrderedMap(List nameValuePairs) {
|
||||
super(nameValuePairs);
|
||||
}
|
||||
|
||||
public SimpleOrderedMap(Map.Entry<String, T> [] nameValuePairs) {
|
||||
super(nameValuePairs);
|
||||
}
|
||||
}
|
|
@ -1,29 +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.util;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.StrUtils.
|
||||
*/
|
||||
@Deprecated
|
||||
public class StrUtils extends org.apache.solr.common.util.StrUtils
|
||||
{
|
||||
|
||||
}
|
|
@ -1,29 +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.util;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.params.UpdateParams.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface UpdateParams extends org.apache.solr.common.params.UpdateParams
|
||||
{
|
||||
|
||||
}
|
|
@ -1,28 +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.util;
|
||||
|
||||
/**
|
||||
* This class is scheduled for deletion. Please update your code to the moved package.
|
||||
*
|
||||
* @deprecated Use org.apache.solr.common.util.XML.
|
||||
*/
|
||||
@Deprecated
|
||||
public class XML extends org.apache.solr.common.util.XML {
|
||||
|
||||
}
|
Loading…
Reference in New Issue