lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [56/62] [abbrv] lucenenet git commit: Lucene.Net.Core.Search: Deleted obsolete files that are no longer in use
Date Sat, 01 Apr 2017 01:09:49 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc1473d/src/Lucene.Net.Core/Search/MultiSearcher.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/MultiSearcher.cs b/src/Lucene.Net.Core/Search/MultiSearcher.cs
deleted file mode 100644
index 267c4da..0000000
--- a/src/Lucene.Net.Core/Search/MultiSearcher.cs
+++ /dev/null
@@ -1,458 +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.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Lucene.Net.Support;
-using Lucene.Net.Util;
-using Document = Lucene.Net.Documents.Document;
-using FieldSelector = Lucene.Net.Documents.FieldSelector;
-using CorruptIndexException = Lucene.Net.Index.CorruptIndexException;
-using IndexReader = Lucene.Net.Index.IndexReader;
-using Term = Lucene.Net.Index.Term;
-using ReaderUtil = Lucene.Net.Util.ReaderUtil;
-
-namespace Lucene.Net.Search
-{
-    
-    /// <summary>Implements search over a set of <c>Searchables</c>.
-    /// 
-    /// <p/>Applications usually need only call the inherited <see cref="Searcher.Search(Query, int)" />
-    /// or <see cref="Searcher.Search(Query,Filter, int)" /> methods.
-    /// </summary>
-    public class MultiSearcher:Searcher
-    {
-        private class AnonymousClassCollector:Collector
-        {
-            public AnonymousClassCollector(Lucene.Net.Search.Collector collector, int start, MultiSearcher enclosingInstance)
-            {
-                InitBlock(collector, start, enclosingInstance);
-            }
-            private void  InitBlock(Lucene.Net.Search.Collector collector, int start, MultiSearcher enclosingInstance)
-            {
-                this.collector = collector;
-                this.start = start;
-                this.enclosingInstance = enclosingInstance;
-            }
-            private Lucene.Net.Search.Collector collector;
-            private int start;
-            private MultiSearcher enclosingInstance;
-            public MultiSearcher Enclosing_Instance
-            {
-                get
-                {
-                    return enclosingInstance;
-                }
-                
-            }
-            public override void  SetScorer(Scorer scorer)
-            {
-                collector.SetScorer(scorer);
-            }
-            public override void  Collect(int doc)
-            {
-                collector.Collect(doc);
-            }
-            public override void  SetNextReader(IndexReader reader, int docBase)
-            {
-                collector.SetNextReader(reader, start + docBase);
-            }
-
-            public override bool AcceptsDocsOutOfOrder
-            {
-                get { return collector.AcceptsDocsOutOfOrder; }
-            }
-        }
-        
-        /// <summary> Document Frequency cache acting as a Dummy-Searcher. This class is no
-        /// full-fledged Searcher, but only supports the methods necessary to
-        /// initialize Weights.
-        /// </summary>
-        private class CachedDfSource:Searcher
-        {
-            private readonly Dictionary<Term,int> dfMap; // Map from Terms to corresponding doc freqs
-            private readonly int maxDoc; // document count
-            
-            public CachedDfSource(Dictionary<Term,int> dfMap, int maxDoc, Similarity similarity)
-            {
-                this.dfMap = dfMap;
-                this.maxDoc = maxDoc;
-                Similarity = similarity;
-            }
-            
-            public override int DocFreq(Term term)
-            {
-                int df;
-                try
-                {
-                    df = dfMap[term];
-                }
-                catch (KeyNotFoundException) // C# equiv. of java code.
-                {
-                    throw new System.ArgumentException("df for term " + term.Text + " not available");
-                }
-                return df;
-            }
-            
-            public override int[] DocFreqs(Term[] terms)
-            {
-                int[] result = new int[terms.Length];
-                for (int i = 0; i < terms.Length; i++)
-                {
-                    result[i] = DocFreq(terms[i]);
-                }
-                return result;
-            }
-            
-            public override int MaxDoc
-            {
-                get { return maxDoc; }
-            }
-            
-            public override Query Rewrite(Query query)
-            {
-                // this is a bit of a hack. We know that a query which
-                // creates a Weight based on this Dummy-Searcher is
-                // always already rewritten (see preparedWeight()).
-                // Therefore we just return the unmodified query here
-                return query;
-            }
-
-            // TODO: This probably shouldn't throw an exception?
-            protected override void Dispose(bool disposing)
-            {
-                throw new System.NotSupportedException();
-            }
-            
-            public override Document Doc(int i)
-            {
-                throw new System.NotSupportedException();
-            }
-            
-            public override Document Doc(int i, FieldSelector fieldSelector)
-            {
-                throw new System.NotSupportedException();
-            }
-            
-            public override Explanation Explain(Weight weight, int doc)
-            {
-                throw new System.NotSupportedException();
-            }
-            
-            public override void  Search(Weight weight, Filter filter, Collector results)
-            {
-                throw new System.NotSupportedException();
-            }
-            
-            public override TopDocs Search(Weight weight, Filter filter, int n)
-            {
-                throw new System.NotSupportedException();
-            }
-            
-            public override TopFieldDocs Search(Weight weight, Filter filter, int n, Sort sort)
-            {
-                throw new System.NotSupportedException();
-            }
-        }
-        
-        private Searchable[] searchables;
-        private int[] starts;
-        private int maxDoc = 0;
-
-        private bool isDisposed;
-        
-        /// <summary>Creates a searcher which searches <i>searchers</i>. </summary>
-        public MultiSearcher(params Searchable[] searchables)
-        {
-            this.searchables = searchables;
-            
-            starts = new int[searchables.Length + 1]; // build starts array
-            for (int i = 0; i < searchables.Length; i++)
-            {
-                starts[i] = maxDoc;
-                maxDoc += searchables[i].MaxDoc; // compute maxDocs
-            }
-            starts[searchables.Length] = maxDoc;
-        }
-        
-        /// <summary>Return the array of <see cref="Searchable" />s this searches. </summary>
-        public virtual Searchable[] GetSearchables()
-        {
-            return searchables;
-        }
-        
-        protected internal virtual int[] GetStarts()
-        {
-            return starts;
-        }
-
-        protected override void Dispose(bool disposing)
-        {
-            if (isDisposed) return;
-
-            if (disposing)
-            {
-                for (int i = 0; i < searchables.Length; i++)
-                    searchables[i].Close();
-            }
-
-            isDisposed = true;
-        }
-
-        public override int DocFreq(Term term)
-        {
-            int docFreq = 0;
-            for (int i = 0; i < searchables.Length; i++)
-                docFreq += searchables[i].DocFreq(term);
-            return docFreq;
-        }
-        
-        // inherit javadoc
-        public override Document Doc(int n)
-        {
-            int i = SubSearcher(n); // find searcher index
-            return searchables[i].Doc(n - starts[i]); // dispatch to searcher
-        }
-        
-        // inherit javadoc
-        public override Document Doc(int n, FieldSelector fieldSelector)
-        {
-            int i = SubSearcher(n); // find searcher index
-            return searchables[i].Doc(n - starts[i], fieldSelector); // dispatch to searcher
-        }
-        
-        /// <summary>Returns index of the searcher for document <c>n</c> in the array
-        /// used to construct this searcher. 
-        /// </summary>
-        public virtual int SubSearcher(int n)
-        {
-            // find searcher for doc n:
-            return ReaderUtil.SubIndex(n, starts);
-        }
-        
-        /// <summary>Returns the document number of document <c>n</c> within its
-        /// sub-index. 
-        /// </summary>
-        public virtual int SubDoc(int n)
-        {
-            return n - starts[SubSearcher(n)];
-        }
-
-        public override int MaxDoc
-        {
-            get { return maxDoc; }
-        }
-
-        public override TopDocs Search(Weight weight, Filter filter, int nDocs)
-        {
-            HitQueue hq = new HitQueue(nDocs, false);
-            int totalHits = 0;
-
-            var lockObj = new object();
-            for (int i = 0; i < searchables.Length; i++)
-            {
-                // search each searcher
-                // use NullLock, we don't care about synchronization for these
-                TopDocs docs = MultiSearcherCallableNoSort(ThreadLock.NullLock, lockObj, searchables[i], weight, filter, nDocs, hq, i, starts);
-                totalHits += docs.TotalHits; // update totalHits
-            }
-            
-            ScoreDoc[] scoreDocs2 = new ScoreDoc[hq.Size()];
-            for (int i = hq.Size() - 1; i >= 0; i--)
-            // put docs in array
-                scoreDocs2[i] = hq.Pop();
-            
-            float maxScore = (totalHits == 0)?System.Single.NegativeInfinity:scoreDocs2[0].Score;
-            
-            return new TopDocs(totalHits, scoreDocs2, maxScore);
-        }
-        
-        public override TopFieldDocs Search(Weight weight, Filter filter, int n, Sort sort)
-        {
-            var hq = new FieldDocSortedHitQueue(n);
-            int totalHits = 0;
-            
-            float maxScore = System.Single.NegativeInfinity;
-
-            var lockObj = new object();
-            for (int i = 0; i < searchables.Length; i++)
-            {
-                // search each searcher
-                // use NullLock, we don't care about synchronization for these
-                TopFieldDocs docs = MultiSearcherCallableWithSort(ThreadLock.NullLock, lockObj, searchables[i], weight, filter, n, hq, sort,
-                                                      i, starts);
-                totalHits += docs.TotalHits;
-                maxScore = System.Math.Max(maxScore, docs.MaxScore);
-            }
-            
-            ScoreDoc[] scoreDocs2 = new ScoreDoc[hq.Size()];
-            for (int i = hq.Size() - 1; i >= 0; i--)
-            // put docs in array
-                scoreDocs2[i] = hq.Pop();
-            
-            return new TopFieldDocs(totalHits, scoreDocs2, hq.GetFields(), maxScore);
-        }
-        
-        ///<inheritdoc />
-        public override void  Search(Weight weight, Filter filter, Collector collector)
-        {
-            for (int i = 0; i < searchables.Length; i++)
-            {
-                int start = starts[i];
-                
-                Collector hc = new AnonymousClassCollector(collector, start, this);
-                searchables[i].Search(weight, filter, hc);
-            }
-        }
-        
-        public override Query Rewrite(Query original)
-        {
-            Query[] queries = new Query[searchables.Length];
-            for (int i = 0; i < searchables.Length; i++)
-            {
-                queries[i] = searchables[i].Rewrite(original);
-            }
-            return queries[0].Combine(queries);
-        }
-        
-        public override Explanation Explain(Weight weight, int doc)
-        {
-            int i = SubSearcher(doc); // find searcher index
-            return searchables[i].Explain(weight, doc - starts[i]); // dispatch to searcher
-        }
-        
-        /// <summary> Create weight in multiple index scenario.
-        /// 
-        /// Distributed query processing is done in the following steps:
-        /// 1. rewrite query
-        /// 2. extract necessary terms
-        /// 3. collect dfs for these terms from the Searchables
-        /// 4. create query weight using aggregate dfs.
-        /// 5. distribute that weight to Searchables
-        /// 6. merge results
-        /// 
-        /// Steps 1-4 are done here, 5+6 in the search() methods
-        /// 
-        /// </summary>
-        /// <returns> rewritten queries
-        /// </returns>
-        public /*protected internal*/ override Weight CreateWeight(Query original)
-        {
-            // step 1
-            Query rewrittenQuery = Rewrite(original);
-            
-            // step 2
-            ISet<Term> terms = Lucene.Net.Support.Compatibility.SetFactory.CreateHashSet<Term>();
-            rewrittenQuery.ExtractTerms(terms);
-            
-            // step3
-            Term[] allTermsArray = terms.ToArray();
-            int[] aggregatedDfs = new int[terms.Count];
-            for (int i = 0; i < searchables.Length; i++)
-            {
-                int[] dfs = searchables[i].DocFreqs(allTermsArray);
-                for (int j = 0; j < aggregatedDfs.Length; j++)
-                {
-                    aggregatedDfs[j] += dfs[j];
-                }
-            }
-            
-            var dfMap = new Dictionary<Term, int>();
-            for (int i = 0; i < allTermsArray.Length; i++)
-            {
-                dfMap[allTermsArray[i]] = aggregatedDfs[i];
-            }
-            
-            // step4
-            int numDocs = MaxDoc;
-            CachedDfSource cacheSim = new CachedDfSource(dfMap, numDocs, Similarity);
-            
-            return rewrittenQuery.Weight(cacheSim);
-        }
-
-        internal Func<ThreadLock, object, Searchable, Weight, Filter, int, HitQueue, int, int[], TopDocs> MultiSearcherCallableNoSort =
-            (threadLock, lockObj, searchable, weight, filter, nDocs, hq, i, starts) =>
-                {
-                    TopDocs docs = searchable.Search(weight, filter, nDocs);
-                    ScoreDoc[] scoreDocs = docs.ScoreDocs;
-                    for(int j = 0; j < scoreDocs.Length; j++) // merge scoreDocs into hq
-                    {
-                        ScoreDoc scoreDoc = scoreDocs[j];
-                        scoreDoc.Doc += starts[i]; //convert doc
-                        //it would be so nice if we had a thread-safe insert
-                        try
-                        {
-                            threadLock.Enter(lockObj);
-                            if (scoreDoc == hq.InsertWithOverflow(scoreDoc))
-                                break;
-                        }
-                        finally
-                        {
-                            threadLock.Exit(lockObj);
-                        }
-                    }
-                    return docs;
-                };
-
-        internal Func<ThreadLock, object, Searchable, Weight, Filter, int, FieldDocSortedHitQueue, Sort, int, int[], TopFieldDocs>
-            MultiSearcherCallableWithSort = (threadLock, lockObj, searchable, weight, filter, nDocs, hq, sort, i, starts) =>
-                                                {
-                                                    TopFieldDocs docs = searchable.Search(weight, filter, nDocs, sort);
-                                                    // if one of the Sort fields is FIELD_DOC, need to fix its values, so that
-                                                    // it will break ties by doc Id properly.  Otherwise, it will compare to
-                                                    // 'relative' doc Ids, that belong to two different searchables.
-                                                    for (int j = 0; j < docs.fields.Length; j++)
-                                                    {
-                                                        if (docs.fields[j].Type == SortField.DOC)
-                                                        {
-                                                            // iterate over the score docs and change their fields value
-                                                            for (int j2 = 0; j2 < docs.ScoreDocs.Length; j2++)
-                                                            {
-                                                                FieldDoc fd = (FieldDoc) docs.ScoreDocs[j2];
-                                                                fd.fields[j] = (int)fd.fields[j] + starts[i];
-                                                            }
-                                                            break;
-                                                        }
-                                                    }
-                                                    try
-                                                    {
-                                                        threadLock.Enter(lockObj);
-                                                        hq.SetFields(docs.fields);
-                                                    }
-                                                    finally
-                                                    {
-                                                        threadLock.Exit(lockObj);
-                                                    }
-
-                                                    ScoreDoc[] scoreDocs = docs.ScoreDocs;
-                                                    for (int j = 0; j < scoreDocs.Length; j++) // merge scoreDocs into hq
-                                                    {
-                                                        FieldDoc fieldDoc = (FieldDoc) scoreDocs[j];
-                                                        fieldDoc.Doc += starts[i]; //convert doc
-                                                        //it would be so nice if we had a thread-safe insert
-                                                        lock (lockObj)
-                                                        {
-                                                            if (fieldDoc == hq.InsertWithOverflow(fieldDoc))
-                                                                break;
-
-                                                        }
-                                                    }
-                                                    return docs;
-                                                };
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc1473d/src/Lucene.Net.Core/Search/ParallelMultiSearcher.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/ParallelMultiSearcher.cs b/src/Lucene.Net.Core/Search/ParallelMultiSearcher.cs
deleted file mode 100644
index a6f9efb..0000000
--- a/src/Lucene.Net.Core/Search/ParallelMultiSearcher.cs
+++ /dev/null
@@ -1,199 +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.
- */
-
-#if !NET35
-
-using System;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Linq;
-using Lucene.Net.Support;
-using Lucene.Net.Util;
-using IndexReader = Lucene.Net.Index.IndexReader;
-using Term = Lucene.Net.Index.Term;
-
-namespace Lucene.Net.Search
-{
-    /// <summary>Implements parallel search over a set of <c>Searchables</c>.
-    /// 
-    /// <p/>Applications usually need only call the inherited <see cref="Searcher.Search(Query, int)" />
-    /// or <see cref="Searcher.Search(Query,Filter,int)" /> methods.
-    /// </summary>
-    public class ParallelMultiSearcher : MultiSearcher/*, IDisposable*/ //No need to implement IDisposable like java, nothing to dispose with the TPL
-    {
-        private class AnonymousClassCollector1 : Collector
-        {
-            public AnonymousClassCollector1(Lucene.Net.Search.Collector collector, int start, ParallelMultiSearcher enclosingInstance)
-            {
-                InitBlock(collector, start, enclosingInstance);
-            }
-            private void InitBlock(Lucene.Net.Search.Collector collector, int start, ParallelMultiSearcher enclosingInstance)
-            {
-                this.collector = collector;
-                this.start = start;
-                this.enclosingInstance = enclosingInstance;
-            }
-            private Lucene.Net.Search.Collector collector;
-            private int start;
-            private ParallelMultiSearcher enclosingInstance;
-            public ParallelMultiSearcher Enclosing_Instance
-            {
-                get
-                {
-                    return enclosingInstance;
-                }
-
-            }
-            public override void SetScorer(Scorer scorer)
-            {
-                collector.SetScorer(scorer);
-            }
-            public override void Collect(int doc)
-            {
-                collector.Collect(doc);
-            }
-            public override void SetNextReader(IndexReader reader, int docBase)
-            {
-                collector.SetNextReader(reader, start + docBase);
-            }
-
-            public override bool AcceptsDocsOutOfOrder
-            {
-                get { return collector.AcceptsDocsOutOfOrder; }
-            }
-        }
-
-        private Searchable[] searchables;
-        private int[] starts;
-
-        /// <summary>Creates a <see cref="Searchable"/> which searches <i>searchables</i>. </summary>
-        public ParallelMultiSearcher(params Searchable[] searchables)
-            : base(searchables)
-        {
-            this.searchables = searchables;
-            this.starts = GetStarts();
-        }
-
-        /// <summary>
-        /// Executes each <see cref="Searchable"/>'s docFreq() in its own thread and 
-        /// waits for each search to complete and merge the results back together.
-        /// </summary>
-        public override int DocFreq(Term term)
-        {
-            int[] results = new int[searchables.Length];
-            Parallel.For(0, searchables.Length, (i) => results[i] = searchables[i].DocFreq(term));
-
-            return results.Sum();
-        }
-
-        /// <summary> A search implementation which executes each
-        /// <see cref="Searchable"/> in its own thread and waits for each search to complete
-        /// and merge the results back together.
-        /// </summary>
-        public override TopDocs Search(Weight weight, Filter filter, int nDocs)
-        {
-            HitQueue hq = new HitQueue(nDocs, false);
-            object lockObj = new object();
-
-            TopDocs[] results = new TopDocs[searchables.Length];
-            //search each searchable
-            Parallel.For(0, searchables.Length, (i) => results[i] = MultiSearcherCallableNoSort(ThreadLock.MonitorLock, lockObj, searchables[i], weight, filter,
-                                                                            nDocs, hq, i, starts));
-            int totalHits = 0;
-            float maxScore = float.NegativeInfinity;
-
-            foreach (TopDocs topDocs in results)
-            {
-                totalHits += topDocs.TotalHits;
-                maxScore = Math.Max(maxScore, topDocs.MaxScore);
-            }
-
-            ScoreDoc[] scoreDocs = new ScoreDoc[hq.Size()];
-            for (int i = hq.Size() - 1; i >= 0; i--) // put docs in array
-                scoreDocs[i] = hq.Pop();
-
-            return new TopDocs(totalHits, scoreDocs, maxScore);
-        }
-
-        /// <summary> A search implementation allowing sorting which spans a new thread for each
-        /// Searchable, waits for each search to complete and merges
-        /// the results back together.
-        /// </summary>
-        public override TopFieldDocs Search(Weight weight, Filter filter, int nDocs, Sort sort)
-        {
-            if (sort == null) throw new ArgumentNullException("sort");
-
-            FieldDocSortedHitQueue hq = new FieldDocSortedHitQueue(nDocs);
-            object lockObj = new object();
-
-
-            TopFieldDocs[] results = new TopFieldDocs[searchables.Length];
-
-            Parallel.For(0, searchables.Length, (i) => results[i] = MultiSearcherCallableWithSort(ThreadLock.MonitorLock, lockObj, searchables[i], weight, filter, nDocs, hq, sort, i, starts));
-
-
-            int totalHits = 0;
-            float maxScore = float.NegativeInfinity;
-
-            foreach (TopFieldDocs topFieldDocs in results)
-            {
-                totalHits += topFieldDocs.TotalHits;
-                maxScore = Math.Max(maxScore, topFieldDocs.MaxScore);
-            }
-
-            ScoreDoc[] scoreDocs = new ScoreDoc[hq.Size()];
-            for (int i = hq.Size() - 1; i >= 0; i--)
-                scoreDocs[i] = hq.Pop();
-
-            return new TopFieldDocs(totalHits, scoreDocs, hq.GetFields(), maxScore);
-        }
-
-        /// <summary>Lower-level search API.
-        /// 
-        /// <p/><see cref="Collector.Collect(int)" /> is called for every matching document.
-        /// 
-        /// <p/>Applications should only use this if they need <i>all</i> of the
-        /// matching documents.  The high-level search API (<see cref="Searcher.Search(Query, int)" />)
-        /// is usually more efficient, as it skips
-        /// non-high-scoring hits.
-        /// <p/>This method cannot be parallelized, because <see cref="Collector"/>
-        /// supports no concurrent access.
-        /// </summary>
-        /// <param name="weight">to match documents
-        /// </param>
-        /// <param name="filter">if non-null, a bitset used to eliminate some documents
-        /// </param>
-        /// <param name="collector">to receive hits
-        /// 
-        /// TODO: parallelize this one too
-        /// </param>
-        public override void Search(Weight weight, Filter filter, Collector collector)
-        {
-            for (int i = 0; i < searchables.Length; i++)
-            {
-
-                int start = starts[i];
-
-                Collector hc = new AnonymousClassCollector1(collector, start, this);
-
-                searchables[i].Search(weight, filter, hc);
-            }
-        }
-    }
-}
-
-#endif 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc1473d/src/Lucene.Net.Core/Search/PhraseScorer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/PhraseScorer.cs b/src/Lucene.Net.Core/Search/PhraseScorer.cs
deleted file mode 100644
index 57c7cae..0000000
--- a/src/Lucene.Net.Core/Search/PhraseScorer.cs
+++ /dev/null
@@ -1,224 +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.
- */
-
-using System;
-
-using TermPositions = Lucene.Net.Index.TermPositions;
-
-namespace Lucene.Net.Search
-{
-    
-    /// <summary>Expert: Scoring functionality for phrase queries.
-    /// <br/>A document is considered matching if it contains the phrase-query terms  
-    /// at "valid" positons. What "valid positions" are
-    /// depends on the type of the phrase query: for an exact phrase query terms are required 
-    /// to appear in adjacent locations, while for a sloppy phrase query some distance between 
-    /// the terms is allowed. The abstract method <see cref="PhraseFreq()" /> of extending classes
-    /// is invoked for each document containing all the phrase query terms, in order to 
-    /// compute the frequency of the phrase query in that document. A non zero frequency
-    /// means a match. 
-    /// </summary>
-    abstract class PhraseScorer:Scorer
-    {
-        private Weight weight;
-        protected internal byte[] norms;
-        protected internal float value_Renamed;
-        
-        private bool firstTime = true;
-        private bool more = true;
-        protected internal PhraseQueue pq;
-        protected internal PhrasePositions first, last;
-        
-        private float freq; //prhase frequency in current doc as computed by phraseFreq().
-        
-        internal PhraseScorer(Weight weight, TermPositions[] tps, int[] offsets, Similarity similarity, byte[] norms):base(similarity)
-        {
-            this.norms = norms;
-            this.weight = weight;
-            this.value_Renamed = weight.Value;
-            
-            // convert tps to a list of phrase positions.
-            // note: phrase-position differs from term-position in that its position
-            // reflects the phrase offset: pp.pos = tp.pos - offset.
-            // this allows to easily identify a matching (exact) phrase 
-            // when all PhrasePositions have exactly the same position.
-            for (int i = 0; i < tps.Length; i++)
-            {
-                PhrasePositions pp = new PhrasePositions(tps[i], offsets[i]);
-                if (last != null)
-                {
-                    // add next to end of list
-                    last.next = pp;
-                }
-                else
-                {
-                    first = pp;
-                }
-                last = pp;
-            }
-            
-            pq = new PhraseQueue(tps.Length); // construct empty pq
-            first.doc = - 1;
-        }
-        
-        public override int DocID()
-        {
-            return first.doc;
-        }
-        
-        public override int NextDoc()
-        {
-            if (firstTime)
-            {
-                Init();
-                firstTime = false;
-            }
-            else if (more)
-            {
-                more = last.Next(); // trigger further scanning
-            }
-            if (!DoNext())
-            {
-                first.doc = NO_MORE_DOCS;
-            }
-            return first.doc;
-        }
-        
-        // next without initial increment
-        private bool DoNext()
-        {
-            while (more)
-            {
-                while (more && first.doc < last.doc)
-                {
-                    // find doc w/ all the terms
-                    more = first.SkipTo(last.doc); // skip first upto last
-                    FirstToLast(); // and move it to the end
-                }
-                
-                if (more)
-                {
-                    // found a doc with all of the terms
-                    freq = PhraseFreq(); // check for phrase
-                    if (freq == 0.0f)
-                    // no match
-                        more = last.Next();
-                    // trigger further scanning
-                    else
-                        return true; // found a match
-                }
-            }
-            return false; // no more matches
-        }
-        
-        public override float Score()
-        {
-            //System.out.println("scoring " + first.doc);
-            float raw = Similarity.Tf(freq) * value_Renamed; // raw score
-            return norms == null?raw:raw * Similarity.DecodeNorm(norms[first.doc]); // normalize
-        }
-        
-        public override int Advance(int target)
-        {
-            firstTime = false;
-            for (PhrasePositions pp = first; more && pp != null; pp = pp.next)
-            {
-                more = pp.SkipTo(target);
-            }
-            if (more)
-            {
-                Sort(); // re-sort
-            }
-            if (!DoNext())
-            {
-                first.doc = NO_MORE_DOCS;
-            }
-            return first.doc;
-        }
-
-        /// <summary>
-        /// Phrase frequency in current doc as computed by PhraseFreq()
-        /// </summary>
-        /// <returns></returns>
-        public float CurrentFreq()
-        {
-            return freq;
-        }
-
-        /// <summary> For a document containing all the phrase query terms, compute the
-        /// frequency of the phrase in that document. 
-        /// A non zero frequency means a match.
-        /// <br/>Note, that containing all phrase terms does not guarantee a match - they have to be found in matching locations.  
-        /// </summary>
-        /// <returns> frequency of the phrase in current doc, 0 if not found. 
-        /// </returns>
-        protected internal abstract float PhraseFreq();
-        
-        private void  Init()
-        {
-            for (PhrasePositions pp = first; more && pp != null; pp = pp.next)
-            {
-                more = pp.Next();
-            }
-            if (more)
-            {
-                Sort();
-            }
-        }
-        
-        private void  Sort()
-        {
-            pq.Clear();
-            for (PhrasePositions pp = first; pp != null; pp = pp.next)
-            {
-                pq.Add(pp);
-            }
-            PqToList();
-        }
-        
-        protected internal void  PqToList()
-        {
-            last = first = null;
-            while (pq.Top() != null)
-            {
-                PhrasePositions pp = pq.Pop();
-                if (last != null)
-                {
-                    // add next to end of list
-                    last.next = pp;
-                }
-                else
-                    first = pp;
-                last = pp;
-                pp.next = null;
-            }
-        }
-        
-        protected internal void  FirstToLast()
-        {
-            last.next = first; // move first to end of list
-            last = first;
-            first = first.next;
-            last.next = null;
-        }
-        
-        public override System.String ToString()
-        {
-            return "scorer(" + weight + ")";
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc1473d/src/Lucene.Net.Core/Search/PrefixTermEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/PrefixTermEnum.cs b/src/Lucene.Net.Core/Search/PrefixTermEnum.cs
deleted file mode 100644
index 2832fdc..0000000
--- a/src/Lucene.Net.Core/Search/PrefixTermEnum.cs
+++ /dev/null
@@ -1,71 +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.
- */
-
-using System;
-
-using IndexReader = Lucene.Net.Index.IndexReader;
-using Term = Lucene.Net.Index.Term;
-
-namespace Lucene.Net.Search
-{
-    
-    /// <summary> Subclass of FilteredTermEnum for enumerating all terms that match the
-    /// specified prefix filter term.
-    /// <p/>
-    /// Term enumerations are always ordered by Term.compareTo().  Each term in
-    /// the enumeration is greater than all that precede it.
-    /// 
-    /// </summary>
-    public class PrefixTermEnum:FilteredTermEnum
-    {
-        
-        private Term prefix;
-        private bool endEnum = false;
-        
-        public PrefixTermEnum(IndexReader reader, Term prefix)
-        {
-            this.prefix = prefix;
-            
-            SetEnum(reader.Terms(new Term(prefix.Field, prefix.Text)));
-        }
-        
-        public override float Difference()
-        {
-            return 1.0f;
-        }
-        
-        public override bool EndEnum()
-        {
-            return endEnum;
-        }
-
-        protected internal virtual Term PrefixTerm
-        {
-            get { return prefix; }
-        }
-
-        protected internal override bool TermCompare(Term term)
-        {
-            if ((System.Object) term.Field == (System.Object) prefix.Field && term.Text.StartsWith(prefix.Text))
-            {
-                return true;
-            }
-            endEnum = true;
-            return false;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc1473d/src/Lucene.Net.Core/Search/QueryTermVector.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/QueryTermVector.cs b/src/Lucene.Net.Core/Search/QueryTermVector.cs
deleted file mode 100644
index 9d531cc..0000000
--- a/src/Lucene.Net.Core/Search/QueryTermVector.cs
+++ /dev/null
@@ -1,167 +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.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Lucene.Net.Analysis.Tokenattributes;
-using Lucene.Net.Index;
-using Lucene.Net.Support;
-using Analyzer = Lucene.Net.Analysis.Analyzer;
-using TokenStream = Lucene.Net.Analysis.TokenStream;
-
-namespace Lucene.Net.Search
-{
-    
-    /// <summary> 
-    /// 
-    /// 
-    /// </summary>
-    public class QueryTermVector : ITermFreqVector
-    {
-        private System.String[] terms = new System.String[0];
-        private int[] termFreqs = new int[0];
-
-        public virtual string Field
-        {
-            get { return null; }
-        }
-
-        /// <summary> </summary>
-        /// <param name="queryTerms">The original list of terms from the query, can contain duplicates
-        /// </param>
-        public QueryTermVector(System.String[] queryTerms)
-        {
-            
-            ProcessTerms(queryTerms);
-        }
-        
-        public QueryTermVector(System.String queryString, Analyzer analyzer)
-        {
-            if (analyzer != null)
-            {
-                TokenStream stream = analyzer.TokenStream("", new System.IO.StringReader(queryString));
-                if (stream != null)
-                {
-                    IList<string> terms = new List<string>();
-                    try
-                    {
-                        bool hasMoreTokens = false;
-                        
-                        stream.Reset();
-                        ITermAttribute termAtt = stream.AddAttribute<ITermAttribute>();
-                        
-                        hasMoreTokens = stream.IncrementToken();
-                        while (hasMoreTokens)
-                        {
-                            terms.Add(termAtt.Term);
-                            hasMoreTokens = stream.IncrementToken();
-                        }
-                        ProcessTerms(terms.ToArray());
-                    }
-                    catch (System.IO.IOException)
-                    {
-                    }
-                }
-            }
-        }
-        
-        private void  ProcessTerms(System.String[] queryTerms)
-        {
-            if (queryTerms != null)
-            {
-                System.Array.Sort(queryTerms);
-                IDictionary<string, int> tmpSet = new HashMap<string, int>(queryTerms.Length);
-                //filter out duplicates
-                IList<string> tmpList = new List<string>(queryTerms.Length);
-                IList<int> tmpFreqs = new List<int>(queryTerms.Length);
-                int j = 0;
-                for (int i = 0; i < queryTerms.Length; i++)
-                {
-                    var term = queryTerms[i];
-                    var position = tmpSet[term];
-                    if (!tmpSet.ContainsKey(term)) // if temp_position == null
-                    {
-                        tmpSet[term] = j++;
-                        tmpList.Add(term);
-                        tmpFreqs.Add(1);
-                    }
-                    else
-                    {
-                        int integer = tmpFreqs[position];
-                        tmpFreqs[position] = (integer + 1);
-                    }
-                }
-                terms = tmpList.ToArray();
-                //termFreqs = (int[])tmpFreqs.toArray(termFreqs);
-                termFreqs = new int[tmpFreqs.Count];
-                int i2 = 0;
-                foreach (int integer in tmpFreqs)
-                {
-                    termFreqs[i2++] = integer;
-                }
-            }
-        }
-        
-        public override System.String ToString()
-        {
-            System.Text.StringBuilder sb = new System.Text.StringBuilder();
-            sb.Append('{');
-            for (int i = 0; i < terms.Length; i++)
-            {
-                if (i > 0)
-                    sb.Append(", ");
-                sb.Append(terms[i]).Append('/').Append(termFreqs[i]);
-            }
-            sb.Append('}');
-            return sb.ToString();
-        }
-
-
-        public virtual int Size
-        {
-            get { return terms.Length; }
-        }
-
-        public virtual System.String[] GetTerms()
-        {
-            return terms;
-        }
-        
-        public virtual int[] GetTermFrequencies()
-        {
-            return termFreqs;
-        }
-        
-        public virtual int IndexOf(System.String term)
-        {
-            int res = System.Array.BinarySearch(terms, term);
-            return res >= 0?res:- 1;
-        }
-        
-        public virtual int[] IndexesOf(System.String[] terms, int start, int len)
-        {
-            int[] res = new int[len];
-            
-            for (int i = 0; i < len; i++)
-            {
-                res[i] = IndexOf(terms[i]);
-            }
-            return res;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc1473d/src/Lucene.Net.Core/Search/Searchable.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Searchable.cs b/src/Lucene.Net.Core/Search/Searchable.cs
deleted file mode 100644
index e6bc5e4..0000000
--- a/src/Lucene.Net.Core/Search/Searchable.cs
+++ /dev/null
@@ -1,169 +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.
- */
-
-using System;
-using Lucene.Net.Documents;
-using Document = Lucene.Net.Documents.Document;
-using FieldSelector = Lucene.Net.Documents.FieldSelector;
-using CorruptIndexException = Lucene.Net.Index.CorruptIndexException;
-using Term = Lucene.Net.Index.Term;
-
-namespace Lucene.Net.Search
-{
-    
-    /// <summary> The interface for search implementations.
-    /// 
-    /// <p/>
-    /// Searchable is the abstract network protocol for searching. Implementations
-    /// provide search over a single index, over multiple indices, and over indices
-    /// on remote servers.
-    /// 
-    /// <p/>
-    /// Queries, filters and sort criteria are designed to be compact so that they
-    /// may be efficiently passed to a remote index, with only the top-scoring hits
-    /// being returned, rather than every matching hit.
-    /// 
-    /// <b>NOTE:</b> this interface is kept public for convenience. Since it is not
-    /// expected to be implemented directly, it may be changed unexpectedly between
-    /// releases.
-    /// </summary>
-    public interface Searchable : IDisposable
-    {
-        /// <summary> Lower-level search API.
-        /// 
-        /// <p/>
-        /// <see cref="Collector.Collect(int)" /> is called for every document. <br/>
-        /// Collector-based access to remote indexes is discouraged.
-        /// 
-        /// <p/>
-        /// Applications should only use this if they need <i>all</i> of the matching
-        /// documents. The high-level search API (<see cref="Searcher.Search(Query,int)" />) is
-        /// usually more efficient, as it skips non-high-scoring hits.
-        /// 
-        /// </summary>
-        /// <param name="weight">to match documents
-        /// </param>
-        /// <param name="filter">if non-null, used to permit documents to be collected.
-        /// </param>
-        /// <param name="collector">to receive hits
-        /// </param>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        void  Search(Weight weight, Filter filter, Collector collector);
-        
-        /// <summary>Frees resources associated with this Searcher.
-        /// Be careful not to call this method while you are still using objects
-        /// that reference this searchable
-        /// </summary>
-        void  Close();
-        
-        /// <summary>Expert: Returns the number of documents containing <c>term</c>.
-        /// Called by search code to compute term weights.
-        /// </summary>
-        /// <seealso cref="Lucene.Net.Index.IndexReader.DocFreq(Term)">
-        /// </seealso>
-        int DocFreq(Term term);
-        
-        /// <summary>Expert: For each term in the terms array, calculates the number of
-        /// documents containing <c>term</c>. Returns an array with these
-        /// document frequencies. Used to minimize number of remote calls.
-        /// </summary>
-        int[] DocFreqs(Term[] terms);
-
-        /// <summary>Expert: Returns one greater than the largest possible document number.
-        /// Called by search code to compute term weights.
-        /// </summary>
-        /// <seealso cref="Lucene.Net.Index.IndexReader.MaxDoc">
-        /// </seealso>
-        int MaxDoc { get; }
-        
-        /// <summary>
-        /// Expert: Low-level search implementation.  Finds the top <c>n</c>
-        /// hits for <c>query</c>, applying <c>filter</c> if non-null.
-        /// 
-        /// <p/>Applications should usually call <see cref="Searcher.Search(Query, int)" /> or
-        /// <see cref="Searcher.Search(Query,Filter,int)" /> instead.
-        /// </summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        TopDocs Search(Weight weight, Filter filter, int n);
-        
-        /// <summary>Expert: Returns the stored fields of document <c>i</c>.</summary>
-        /// <seealso cref="Lucene.Net.Index.IndexReader.Document(int)" />
-        /// <throws>  CorruptIndexException if the index is corrupt </throws>
-        /// <throws>  IOException if there is a low-level IO error </throws>
-        Document Doc(int i);
-
-        /// <summary> Get the <see cref="Lucene.Net.Documents.Document" />at the <c>n</c><sup>th</sup> position. The <see cref="Lucene.Net.Documents.FieldSelector"/>
-        /// may be used to determine what <see cref="Lucene.Net.Documents.Field" />s to load and how they should be loaded.
-        /// 
-        /// <b>NOTE:</b> If the underlying Reader (more specifically, the underlying <c>FieldsReader</c>) is closed before the lazy <see cref="Lucene.Net.Documents.Field" /> is
-        /// loaded an exception may be thrown.  If you want the value of a lazy <see cref="Lucene.Net.Documents.Field" /> to be available after closing you must
-        /// explicitly load it or fetch the Document again with a new loader.
-        /// 
-        /// 
-        /// </summary>
-        /// <param name="n">Get the document at the <c>n</c><sup>th</sup> position
-        /// </param>
-        /// <param name="fieldSelector">The <see cref="Lucene.Net.Documents.FieldSelector" /> to use to determine what Fields should be loaded on the Document.  May be null, in which case all Fields will be loaded.
-        /// </param>
-        /// <returns> The stored fields of the <see cref="Lucene.Net.Documents.Document" /> at the nth position
-        /// </returns>
-        /// <throws>  CorruptIndexException if the index is corrupt </throws>
-        /// <throws>  IOException if there is a low-level IO error </throws>
-        /// <summary> 
-        /// </summary>
-        /// <seealso cref="Lucene.Net.Index.IndexReader.Document(int, FieldSelector)">
-        /// </seealso>
-        /// <seealso cref="IFieldable">
-        /// </seealso>
-        /// <seealso cref="Lucene.Net.Documents.FieldSelector">
-        /// </seealso>
-        /// <seealso cref="Lucene.Net.Documents.SetBasedFieldSelector">
-        /// </seealso>
-        /// <seealso cref="Lucene.Net.Documents.LoadFirstFieldSelector">
-        /// </seealso>
-        Document Doc(int n, FieldSelector fieldSelector);
-        
-        /// <summary>Expert: called to re-write queries into primitive queries.</summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        Query Rewrite(Query query);
-        
-        /// <summary>Expert: low-level implementation method
-        /// Returns an Explanation that describes how <c>doc</c> scored against
-        /// <c>weight</c>.
-        /// 
-        /// <p/>This is intended to be used in developing Similarity implementations,
-        /// and, for good performance, should not be displayed with every hit.
-        /// Computing an explanation is as expensive as executing the query over the
-        /// entire index.
-        /// <p/>Applications should call <see cref="Searcher.Explain(Query, int)" />.
-        /// </summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        Explanation Explain(Weight weight, int doc);
-        
-        /// <summary>Expert: Low-level search implementation with arbitrary sorting.  Finds
-        /// the top <c>n</c> hits for <c>query</c>, applying
-        /// <c>filter</c> if non-null, and sorting the hits by the criteria in
-        /// <c>sort</c>.
-        /// 
-        /// <p/>Applications should usually call
-        /// <see cref="Searcher.Search(Query,Filter,int,Sort)" /> instead.
-        /// 
-        /// </summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        TopFieldDocs Search(Weight weight, Filter filter, int n, Sort sort);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc1473d/src/Lucene.Net.Core/Search/Searcher.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/Searcher.cs b/src/Lucene.Net.Core/Search/Searcher.cs
deleted file mode 100644
index 6f36e44..0000000
--- a/src/Lucene.Net.Core/Search/Searcher.cs
+++ /dev/null
@@ -1,192 +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.
- */
-
-using System;
-using Lucene.Net.Documents;
-using Document = Lucene.Net.Documents.Document;
-using CorruptIndexException = Lucene.Net.Index.CorruptIndexException;
-using Term = Lucene.Net.Index.Term;
-
-namespace Lucene.Net.Search
-{
-    
-    /// <summary> An abstract base class for search implementations. Implements the main search
-    /// methods.
-    /// 
-    /// <p/>
-    /// Note that you can only access hits from a Searcher as long as it is not yet
-    /// closed, otherwise an IOException will be thrown.
-    /// </summary>
-    public abstract class Searcher : System.MarshalByRefObject, Searchable, System.IDisposable
-    {
-        protected Searcher()
-        {
-            InitBlock();
-        }
-        private void  InitBlock()
-        {
-            similarity = Net.Search.Similarity.Default;
-        }
-        
-        /// <summary>Search implementation with arbitrary sorting.  Finds
-        /// the top <c>n</c> hits for <c>query</c>, applying
-        /// <c>filter</c> if non-null, and sorting the hits by the criteria in
-        /// <c>sort</c>.
-        /// 
-        /// <p/>NOTE: this does not compute scores by default; use
-        /// <see cref="IndexSearcher.SetDefaultFieldSortScoring(bool,bool)" /> to enable scoring.
-        /// 
-        /// </summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        public virtual TopFieldDocs Search(Query query, Filter filter, int n, Sort sort)
-        {
-            return Search(CreateWeight(query), filter, n, sort);
-        }
-        
-        /// <summary>Lower-level search API.
-        /// 
-        /// <p/><see cref="Collector.Collect(int)" /> is called for every matching document.
-        /// 
-        /// <p/>Applications should only use this if they need <i>all</i> of the matching
-        /// documents. The high-level search API (<see cref="Searcher.Search(Query, int)" />
-        /// ) is usually more efficient, as it skips non-high-scoring hits.
-        /// <p/>Note: The <c>score</c> passed to this method is a raw score.
-        /// In other words, the score will not necessarily be a float whose value is
-        /// between 0 and 1.
-        /// </summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        public virtual void  Search(Query query, Collector results)
-        {
-            Search(CreateWeight(query), null, results);
-        }
-        
-        /// <summary>Lower-level search API.
-        /// 
-        /// <p/><see cref="Collector.Collect(int)" /> is called for every matching
-        /// document.
-        /// <br/>Collector-based access to remote indexes is discouraged.
-        /// 
-        /// <p/>Applications should only use this if they need <i>all</i> of the
-        /// matching documents.  The high-level search API (<see cref="Searcher.Search(Query, Filter, int)" />)
-        /// is usually more efficient, as it skips
-        /// non-high-scoring hits.
-        /// 
-        /// </summary>
-        /// <param name="query">to match documents
-        /// </param>
-        /// <param name="filter">if non-null, used to permit documents to be collected.
-        /// </param>
-        /// <param name="results">to receive hits
-        /// </param>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        public virtual void  Search(Query query, Filter filter, Collector results)
-        {
-            Search(CreateWeight(query), filter, results);
-        }
-        
-        /// <summary>Finds the top <c>n</c>
-        /// hits for <c>query</c>, applying <c>filter</c> if non-null.
-        /// 
-        /// </summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        public virtual TopDocs Search(Query query, Filter filter, int n)
-        {
-            return Search(CreateWeight(query), filter, n);
-        }
-        
-        /// <summary>Finds the top <c>n</c>
-        /// hits for <c>query</c>.
-        /// 
-        /// </summary>
-        /// <throws>  BooleanQuery.TooManyClauses </throws>
-        public virtual TopDocs Search(Query query, int n)
-        {
-            return Search(query, null, n);
-        }
-        
-        /// <summary>Returns an Explanation that describes how <c>doc</c> scored against
-        /// <c>query</c>.
-        /// 
-        /// <p/>This is intended to be used in developing Similarity implementations,
-        /// and, for good performance, should not be displayed with every hit.
-        /// Computing an explanation is as expensive as executing the query over the
-        /// entire index.
-        /// </summary>
-        public virtual Explanation Explain(Query query, int doc)
-        {
-            return Explain(CreateWeight(query), doc);
-        }
-        
-        /// <summary>The Similarity implementation used by this searcher. </summary>
-        private Similarity similarity;
-
-        /// <summary>Expert: Gets or Sets the Similarity implementation used by this Searcher.
-        /// 
-        /// </summary>
-        /// <seealso cref="Lucene.Net.Search.Similarity.Default">
-        /// </seealso>
-        public virtual Similarity Similarity
-        {
-            get { return this.similarity; }
-            set { this.similarity = value; }
-        }
-
-        /// <summary> creates a weight for <c>query</c></summary>
-        /// <returns> new weight
-        /// </returns>
-        public /*protected internal*/ virtual Weight CreateWeight(Query query)
-        {
-            return query.Weight(this);
-        }
-        
-        // inherit javadoc
-        public virtual int[] DocFreqs(Term[] terms)
-        {
-            int[] result = new int[terms.Length];
-            for (int i = 0; i < terms.Length; i++)
-            {
-                result[i] = DocFreq(terms[i]);
-            }
-            return result;
-        }
-
-        public abstract void  Search(Weight weight, Filter filter, Collector results);
-
-        [Obsolete("Use Dispose() instead")]
-        public void Close()
-        {
-            Dispose();
-        }
-
-        public void Dispose()
-        {
-            Dispose(true);
-        }
-
-        protected abstract void Dispose(bool disposing);
-
-        public abstract int DocFreq(Term term);
-        public abstract int MaxDoc { get; }
-        public abstract TopDocs Search(Weight weight, Filter filter, int n);
-        public abstract Document Doc(int i);
-        public abstract Document Doc(int docid, FieldSelector fieldSelector);
-        public abstract Query Rewrite(Query query);
-        public abstract Explanation Explain(Weight weight, int doc);
-        public abstract TopFieldDocs Search(Weight weight, Filter filter, int n, Sort sort);
-        /* End patch for GCJ bug #15411. */
-    }
-}
\ No newline at end of file


Mime
View raw message