@@ -0,0 +1,3165 @@
+/*%0A * Licensed to the Apache Software Foundation (ASF) under one or more%0A * contributor license agreements.  See the NOTICE file distributed with%0A * this work for additional information regarding copyright ownership.%0A * The ASF licenses this file to You under the Apache License, Version 2.0%0A * (the %22License%22); you may not use this file except in compliance with%0A * the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.apache.jackrabbit.core.query.lucene;%0A%0Aimport java.io.IOException;%0A%0Aimport org.apache.lucene.search.TermQuery;%0Aimport org.apache.lucene.search.Weight;%0Aimport org.apache.lucene.search.Searcher;%0Aimport org.apache.lucene.search.Scorer;%0Aimport org.apache.lucene.search.Query;%0Aimport org.apache.lucene.search.Explanation;%0Aimport org.apache.lucene.index.Term;%0Aimport org.apache.lucene.index.IndexReader;%0A%0A/**%0A * %3Ccode%3EJackrabbitTermQuery%3C/code%3E implements a %7B@link TermQuery%7D where score%0A * values are retrieved on a per index segment basis using %7B@link MultiScorer%7D.%0A */%0Apublic class JackrabbitTermQuery extends TermQuery %7B%0A%0A    private static final long serialVersionUID = 4244799812287335957L;%0A%0A    public JackrabbitTermQuery(Term t) %7B%0A        super(t);%0A    %7D%0A%0A    protected Weight createWeight(Searcher searcher) throws IOException %7B%0A        return new JackrabbitTermWeight(searcher, super.createWeight(searcher));%0A    %7D%0A%0A    /**%0A     * The weight implementation.%0A     */%0A    protected class JackrabbitTermWeight extends AbstractWeight %7B%0A%0A        private static final long serialVersionUID = -2070964510010945854L;%0A%0A        /**%0A         * The default lucene TermQuery weight.%0A         */%0A        private final Weight weight;%0A%0A        public JackrabbitTermWeight(Searcher searcher, Weight weight) %7B%0A            super(searcher);%0A            this.weight = weight;%0A        %7D%0A%0A        /**%0A         * %7B@inheritDoc%7D%0A         */%0A        protected Scorer createScorer(IndexReader reader) throws IOException %7B%0A            return weight.scorer(reader);%0A        %7D%0A%0A        /**%0A         * %7B@inheritDoc%7D%0A         */%0A        public Query getQuery() %7B%0A            return JackrabbitTermQuery.this;%0A        %7D%0A%0A        /**%0A         * %7B@inheritDoc%7D%0A         */%0A        public float getValue() %7B%0A            return weight.getValue();%0A        %7D%0A%0A        /**%0A         * %7B@inheritDoc%7D%0A         */%0A        public float sumOfSquaredWeights() throws IOException %7B%0A            return weight.sumOfSquaredWeights();%0A        %7D%0A%0A        /**%0A         * %7B@inheritDoc%7D%0A         */%0A        public void normalize(float norm) %7B%0A            weight.normalize(norm);%0A        %7D%0A%0A        /**%0A         * %7B@inheritDoc%7D%0A         */%0A        public Explanation explain(IndexReader reader, int doc) throws%0A                IOException %7B%0A            return weight.explain(reader, doc);%0A        %7D%0A    %7D%0A%7D%0A

Optimize concurrent queries