You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/01/28 10:16:03 UTC
[20/22] lucenenet git commit: Lucene.Net.Queries: documentation
comments
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs
index 63e48e1..96eec41 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/RangeMapFloatFunction.cs
@@ -24,12 +24,10 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// <code>RangeMapFloatFunction</code> implements a map function over
- /// another <seealso cref="ValueSource"/> whose values fall within min and max inclusive to target.
- /// <br>
- /// Normally Used as an argument to a <seealso cref="FunctionQuery"/>
- ///
- ///
+ /// <see cref="RangeMapFloatFunction"/> implements a map function over
+ /// another <see cref="ValueSource"/> whose values fall within <paramref name="min"/> and <paramref name="max"/> inclusive to <paramref name="target"/>.
+ /// <para/>
+ /// Normally used as an argument to a <see cref="FunctionQuery"/>
/// </summary>
public class RangeMapFloatFunction : ValueSource
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs
index bc6d799..70032c8 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ReciprocalFloatFunction.cs
@@ -25,26 +25,19 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// <code>ReciprocalFloatFunction</code> implements a reciprocal function f(x) = a/(mx+b), based on
- /// the float value of a field or function as exported by <seealso cref="ValueSource"/>.
- /// <br>
- ///
- /// When a and b are equal, and x>=0, this function has a maximum value of 1 that drops as x increases.
+ /// <see cref="ReciprocalFloatFunction"/> implements a reciprocal function <c>f(x) = a/(mx+b)</c>, based on
+ /// the <see cref="float"/> value of a field or function as exported by <see cref="ValueSource"/>.
+ /// <para/>
+ /// When a and b are equal, and <c>x>=0</c>, this function has a maximum value of 1 that drops as x increases.
/// Increasing the value of a and b together results in a movement of the entire function to a flatter part of the curve.
- /// <para>These properties make this an idea function for boosting more recent documents.
- /// </para>
- /// <para>Example:<code> recip(ms(NOW,mydatefield),3.16e-11,1,1)</code>
- /// </para>
- /// <para>A multiplier of 3.16e-11 changes the units from milliseconds to years (since there are about 3.16e10 milliseconds
+ /// <para/>These properties make this an idea function for boosting more recent documents.
+ /// <para/>Example:<c> recip(ms(NOW,mydatefield),3.16e-11,1,1)</c>
+ /// <para/>A multiplier of 3.16e-11 changes the units from milliseconds to years (since there are about 3.16e10 milliseconds
/// per year). Thus, a very recent date will yield a value close to 1/(0+1) or 1,
/// a date a year in the past will get a multiplier of about 1/(1+1) or 1/2,
/// and date two years old will yield 1/(2+1) or 1/3.
- ///
- /// </para>
/// </summary>
- /// <seealso cref= org.apache.lucene.queries.function.FunctionQuery
- ///
- /// </seealso>
+ /// <seealso cref="FunctionQuery"/>
public class ReciprocalFloatFunction : ValueSource
{
protected readonly ValueSource m_source;
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
index 34bd66e..01015f4 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ReverseOrdFieldSource.cs
@@ -23,27 +23,25 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// Obtains the ordinal of the field value from the default Lucene <seealso cref="FieldCache"/> using getTermsIndex()
+ /// Obtains the ordinal of the field value from the default Lucene <see cref="FieldCache"/> using <see cref="IFieldCache.GetTermsIndex"/>
/// and reverses the order.
- /// <br>
+ /// <para/>
/// The native lucene index order is used to assign an ordinal value for each field value.
- /// <br>Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1.
- /// <br>
- /// Example of reverse ordinal (rord):<br>
- /// If there were only three field values: "apple","banana","pear"
- /// <br>then rord("apple")=3, rord("banana")=2, ord("pear")=1
- /// <para>
- /// WARNING: ord() depends on the position in an index and can thus change when other documents are inserted or deleted,
+ /// <para/>Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1.
+ /// <para/>
+ /// Example of reverse ordinal (rord):
+ /// <code>
+ /// If there were only three field values: "apple","banana","pear"
+ /// then rord("apple")=3, rord("banana")=2, ord("pear")=1
+ /// </code>
+ /// <para/>
+ /// WARNING: Ord depends on the position in an index and can thus change when other documents are inserted or deleted,
/// or if a MultiSearcher is used.
- /// <br>
+ /// <para/>
/// WARNING: as of Solr 1.4, ord() and rord() can cause excess memory use since they must use a FieldCache entry
/// at the top level reader, while sorting and function queries now use entries at the segment level. Hence sorting
/// or using a different function query, in addition to ord()/rord() will double memory use.
- ///
- ///
- /// </para>
/// </summary>
-
public class ReverseOrdFieldSource : ValueSource
{
// LUCENENET NOTE: Made private and added public property for reading
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs
index deaf177..9acf763 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ScaleFloatFunction.cs
@@ -24,17 +24,15 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// Scales values to be between min and max.
- /// <para>This implementation currently traverses all of the source values to obtain
+ /// Scales values to be between <paramref name="min"/> and <paramref name="max"/>.
+ /// <para/>This implementation currently traverses all of the source values to obtain
/// their min and max.
- /// </para>
- /// <para>This implementation currently cannot distinguish when documents have been
+ /// <para/>This implementation currently cannot distinguish when documents have been
/// deleted or documents that have no value, and 0.0 values will be used for
/// these cases. This means that if values are normally all greater than 0.0, one can
/// still end up with 0.0 as the min value to map from. In these cases, an
/// appropriate map() function could be used as a workaround to change 0.0
/// to a value in the real range.
- /// </para>
/// </summary>
public class ScaleFloatFunction : ValueSource
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs
index f590948..d2d7c23 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/ShortFieldSource.cs
@@ -23,10 +23,9 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// Obtains short field values from the <seealso cref="org.apache.lucene.search.FieldCache"/>
- /// using <code>getShorts()</code>
+ /// Obtains <see cref="short"/> field values from the <see cref="FieldCache"/>
+ /// using <see cref="IFieldCache.GetShorts"/>
/// and makes those values available as other numeric types, casting as needed.
- ///
/// </summary>
[Obsolete]
public class ShortFieldSource : FieldCacheSource
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
index e13cad3..abfec40 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SimpleBoolFunction.cs
@@ -23,11 +23,11 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// <seealso cref="BoolFunction"/> implementation which applies an extendible boolean
- /// function to the values of a single wrapped <seealso cref="ValueSource"/>.
+ /// <see cref="BoolFunction"/> implementation which applies an extendible <see cref="bool"/>
+ /// function to the values of a single wrapped <see cref="ValueSource"/>.
///
/// Functions this can be used for include whether a field has a value or not,
- /// or inverting the boolean value of the wrapped ValueSource.
+ /// or inverting the <see cref="bool"/> value of the wrapped <see cref="ValueSource"/>.
/// </summary>
public abstract class SimpleBoolFunction : BoolFunction
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
index f421011..bf4bc28 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SimpleFloatFunction.cs
@@ -22,7 +22,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// A simple float function with a single argument
+ /// A simple <see cref="float"/> function with a single argument
/// </summary>
public abstract class SimpleFloatFunction : SingleFunction
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
index 6f76752..fcff158 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SumFloatFunction.cs
@@ -20,7 +20,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// <code>SumFloatFunction</code> returns the sum of it's components.
+ /// <see cref="SumFloatFunction"/> returns the sum of its components.
/// </summary>
public class SumFloatFunction : MultiFloatFunction
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
index 907481b..f46ca0e 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/SumTotalTermFreqValueSource.cs
@@ -23,7 +23,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// <code>SumTotalTermFreqValueSource</code> returns the number of tokens.
+ /// <see cref="SumTotalTermFreqValueSource"/> returns the number of tokens.
/// (sum of term freqs across all documents, across all terms).
/// Returns -1 if frequencies were omitted for the field, or if
/// the codec doesn't support this statistic.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
index 8780c98..1be78d0 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TFValueSource.cs
@@ -27,13 +27,12 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// Function that returns <seealso cref="TFIDFSimilarity#tf(float)"/>
+ /// Function that returns <see cref="TFIDFSimilarity.Tf(float)"/>
/// for every document.
- /// <para>
+ /// <para/>
/// Note that the configured Similarity for the field must be
- /// a subclass of <seealso cref="TFIDFSimilarity"/>
+ /// a subclass of <see cref="TFIDFSimilarity"/>
/// @lucene.internal
- /// </para>
/// </summary>
public class TFValueSource : TermFreqValueSource
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
index 213a548..3019d79 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TermFreqValueSource.cs
@@ -26,12 +26,11 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// Function that returns <seealso cref="DocsEnum#freq()"/> for the
+ /// Function that returns <see cref="DocsEnum.Freq"/> for the
/// supplied term in every document.
- /// <para>
+ /// <para/>
/// If the term does not exist in the document, returns 0.
/// If frequencies are omitted, returns 1.
- /// </para>
/// </summary>
public class TermFreqValueSource : DocFreqValueSource
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
index f083968..6da5703 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/TotalTermFreqValueSource.cs
@@ -24,7 +24,7 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// <code>TotalTermFreqValueSource</code> returns the total term freq
+ /// <see cref="TotalTermFreqValueSource"/> returns the total term freq
/// (sum of term freqs across all documents).
/// Returns -1 if frequencies were omitted for the field, or if
/// the codec doesn't support this statistic.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
index 31706cf..1bae536 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/VectorValueSource.cs
@@ -24,8 +24,8 @@ namespace Lucene.Net.Queries.Function.ValueSources
*/
/// <summary>
- /// Converts individual ValueSource instances to leverage the FunctionValues *Val functions that work with multiple values,
- /// i.e. <seealso cref="FunctionValues#DoubleVal(int, double[])"/>
+ /// Converts individual <see cref="ValueSource"/> instances to leverage the FunctionValues *Val functions that work with multiple values,
+ /// i.e. <see cref="FunctionValues.DoubleVal(int, double[])"/>
/// </summary>
//Not crazy about the name, but...
public class VectorValueSource : MultiValueSource
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
index 9258ff3..8ccbd1f 100644
--- a/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
+++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThis.cs
@@ -10,7 +10,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
-using Reader = System.IO.TextReader;
namespace Lucene.Net.Queries.Mlt
{
@@ -34,13 +33,13 @@ namespace Lucene.Net.Queries.Mlt
/// <summary>
/// Generate "more like this" similarity queries.
/// Based on this mail:
- /// <code><pre>
- /// Lucene does let you access the document frequency of terms, with IndexReader.docFreq().
+ /// <code>
+ /// Lucene does let you access the document frequency of terms, with <see cref="IndexReader.DocFreq"/>.
/// Term frequencies can be computed by re-tokenizing the text, which, for a single document,
- /// is usually fast enough. But looking up the docFreq() of every term in the document is
+ /// is usually fast enough. But looking up the <see cref="IndexReader.DocFreq"/> of every term in the document is
/// probably too slow.
- /// <p/>
- /// You can use some heuristics to prune the set of terms, to avoid calling docFreq() too much,
+ /// <para/>
+ /// You can use some heuristics to prune the set of terms, to avoid calling <see cref="IndexReader.DocFreq"/> too much,
/// or at all. Since you're trying to maximize a tf*idf score, you're probably most interested
/// in terms with a high tf. Choosing a tf threshold even as low as two or three will radically
/// reduce the number of terms under consideration. Another heuristic is that terms with a
@@ -48,76 +47,73 @@ namespace Lucene.Net.Queries.Mlt
/// number of characters, not selecting anything less than, e.g., six or seven characters.
/// With these sorts of heuristics you can usually find small set of, e.g., ten or fewer terms
/// that do a pretty good job of characterizing a document.
- /// <p/>
+ /// <para/>
/// It all depends on what you're trying to do. If you're trying to eek out that last percent
/// of precision and recall regardless of computational difficulty so that you can win a TREC
/// competition, then the techniques I mention above are useless. But if you're trying to
/// provide a "more like this" button on a search results page that does a decent job and has
/// good performance, such techniques might be useful.
- /// <p/>
+ /// <para/>
/// An efficient, effective "more-like-this" query generator would be a great contribution, if
/// anyone's interested. I'd imagine that it would take a Reader or a String (the document's
/// text), analyzer Analyzer, and return a set of representative terms using heuristics like those
/// above. The frequency and length thresholds could be parameters, etc.
- /// <p/>
+ /// <para/>
/// Doug
- /// </pre></code>
- /// <p/>
- /// <p/>
- /// <p/>
- /// <h3>Initial Usage</h3>
- /// <p/>
+ /// </code>
+ /// <para/>
+ /// <para/>
+ /// <para/>
+ /// <b>Initial Usage</b>
+ /// <para/>
/// This class has lots of options to try to make it efficient and flexible.
/// The simplest possible usage is as follows. The bold
/// fragment is specific to this class.
- /// <p/>
- /// <pre class="prettyprint">
- /// <p/>
+ /// <para/>
+ /// <code>
/// IndexReader ir = ...
/// IndexSearcher is = ...
- /// <p/>
+ ///
/// MoreLikeThis mlt = new MoreLikeThis(ir);
- /// Reader target = ... // orig source of doc you want to find similarities to
- /// Query query = mlt.like( target);
- /// <p/>
- /// Hits hits = is.search(query);
+ /// TextReader target = ... // orig source of doc you want to find similarities to
+ /// Query query = mlt.Like(target);
+ ///
+ /// Hits hits = is.Search(query);
/// // now the usual iteration thru 'hits' - the only thing to watch for is to make sure
/// //you ignore the doc if it matches your 'target' document, as it should be similar to itself
- /// <p/>
- /// </pre>
- /// <p/>
+ /// </code>
+ /// <para/>
/// Thus you:
- /// <ol>
- /// <li> do your normal, Lucene setup for searching,
- /// <li> create a MoreLikeThis,
- /// <li> get the text of the doc you want to find similarities to
- /// <li> then call one of the like() calls to generate a similarity query
- /// <li> call the searcher to find the similar docs
- /// </ol>
- /// <p/>
- /// <h3>More Advanced Usage</h3>
- /// <p/>
- /// You may want to use <seealso cref="#setFieldNames setFieldNames(...)"/> so you can examine
+ /// <list type="bullet">
+ /// <item>do your normal, Lucene setup for searching,</item>
+ /// <item>create a MoreLikeThis,</item>
+ /// <item>get the text of the doc you want to find similarities to</item>
+ /// <item>then call one of the <see cref="Like"/> calls to generate a similarity query</item>
+ /// <item>call the searcher to find the similar docs</item>
+ /// </list>
+ /// <para/>
+ /// <b>More Advanced Usage</b>
+ /// <para/>
+ /// You may want to use the setter for <see cref="FieldNames"/> so you can examine
/// multiple fields (e.g. body and title) for similarity.
- /// <p/>
- /// <p/>
+ /// <para/>
+ /// <para/>
/// Depending on the size of your index and the size and makeup of your documents you
/// may want to call the other set methods to control how the similarity queries are
/// generated:
- /// <ul>
- /// <li> <seealso cref="#setMinTermFreq setMinTermFreq(...)"/>
- /// <li> <seealso cref="#setMinDocFreq setMinDocFreq(...)"/>
- /// <li> <seealso cref="#setMaxDocFreq setMaxDocFreq(...)"/>
- /// <li> <seealso cref="#setMaxDocFreqPct setMaxDocFreqPct(...)"/>
- /// <li> <seealso cref="#setMinWordLen setMinWordLen(...)"/>
- /// <li> <seealso cref="#setMaxWordLen setMaxWordLen(...)"/>
- /// <li> <seealso cref="#setMaxQueryTerms setMaxQueryTerms(...)"/>
- /// <li> <seealso cref="#setMaxNumTokensParsed setMaxNumTokensParsed(...)"/>
- /// <li> <seealso cref="#setStopWords setStopWord(...)"/>
- /// </ul>
- /// <p/>
- /// <hr>
- /// <pre>
+ /// <list type="bullet">
+ /// <item><see cref="MinTermFreq"/></item>
+ /// <item><see cref="MinDocFreq"/></item>
+ /// <item><see cref="MaxDocFreq"/></item>
+ /// <item><see cref="SetMaxDocFreqPct(int)"/></item>
+ /// <item><see cref="MinWordLen"/></item>
+ /// <item><see cref="MaxWordLen"/></item>
+ /// <item><see cref="MaxQueryTerms"/></item>
+ /// <item><see cref="MaxNumTokensParsed"/></item>
+ /// <item><see cref="StopWords"/></item>
+ /// </list>
+ /// </summary>
+ /// <remarks>
/// Changes: Mark Harwood 29/02/04
/// Some bugfixing, some refactoring, some optimisation.
/// - bugfix: retrieveTerms(int docNum) was not working for indexes without a termvector -added missing code
@@ -125,44 +121,38 @@ namespace Lucene.Net.Queries.Mlt
/// was only counting one occurrence per term/field pair in calculations(ie not including frequency info from TermVector)
/// - refactor: moved common code into isNoiseWord()
/// - optimise: when no termvector support available - used maxNumTermsParsed to limit amount of tokenization
- /// </pre>
- /// </summary>
+ /// </remarks>
public sealed class MoreLikeThis
{
-
/// <summary>
/// Default maximum number of tokens to parse in each example doc field that is not stored with TermVector support.
/// </summary>
- /// <seealso cref= #getMaxNumTokensParsed </seealso>
+ /// <seealso cref="MaxNumTokensParsed"/>
public static readonly int DEFAULT_MAX_NUM_TOKENS_PARSED = 5000;
/// <summary>
/// Ignore terms with less than this frequency in the source doc.
/// </summary>
- /// <seealso cref= #getMinTermFreq </seealso>
- /// <seealso cref= #setMinTermFreq </seealso>
+ /// <seealso cref="MinTermFreq"/>
public static readonly int DEFAULT_MIN_TERM_FREQ = 2;
/// <summary>
/// Ignore words which do not occur in at least this many docs.
/// </summary>
- /// <seealso cref= #getMinDocFreq </seealso>
- /// <seealso cref= #setMinDocFreq </seealso>
+ /// <seealso cref="MinDocFreq"/>
public static readonly int DEFAULT_MIN_DOC_FREQ = 5;
/// <summary>
/// Ignore words which occur in more than this many docs.
/// </summary>
- /// <seealso cref= #getMaxDocFreq </seealso>
- /// <seealso cref= #setMaxDocFreq </seealso>
- /// <seealso cref= #setMaxDocFreqPct </seealso>
+ /// <seealso cref="MaxDocFreq"/>
+ /// <seealso cref="SetMaxDocFreqPct(int)"/>
public static readonly int DEFAULT_MAX_DOC_FREQ = int.MaxValue;
/// <summary>
/// Boost terms in query based on score.
/// </summary>
- /// <seealso cref= #isBoost </seealso>
- /// <seealso cref= #setBoost </seealso>
+ /// <seealso cref="ApplyBoost"/>
public static readonly bool DEFAULT_BOOST = false;
/// <summary>
@@ -174,31 +164,27 @@ namespace Lucene.Net.Queries.Mlt
/// <summary>
/// Ignore words less than this length or if 0 then this has no effect.
/// </summary>
- /// <seealso cref= #getMinWordLen </seealso>
- /// <seealso cref= #setMinWordLen </seealso>
+ /// <seealso cref="MinWordLen"/>
public static readonly int DEFAULT_MIN_WORD_LENGTH = 0;
/// <summary>
/// Ignore words greater than this length or if 0 then this has no effect.
/// </summary>
- /// <seealso cref= #getMaxWordLen </seealso>
- /// <seealso cref= #setMaxWordLen </seealso>
+ /// <seealso cref="MaxWordLen"/>
public static readonly int DEFAULT_MAX_WORD_LENGTH = 0;
/// <summary>
/// Default set of stopwords.
/// If null means to allow stop words.
/// </summary>
- /// <seealso cref= #setStopWords </seealso>
- /// <seealso cref= #getStopWords </seealso>
+ /// <seealso cref="StopWords"/>
public static readonly ISet<string> DEFAULT_STOP_WORDS = null;
/// <summary>
/// Return a Query with no more than this many terms.
/// </summary>
- /// <seealso cref= BooleanQuery#getMaxClauseCount </seealso>
- /// <seealso cref= #getMaxQueryTerms </seealso>
- /// <seealso cref= #setMaxQueryTerms </seealso>
+ /// <seealso cref="BooleanQuery.MaxClauseCount"/>
+ /// <seealso cref="MaxQueryTerms"/>
public static readonly int DEFAULT_MAX_QUERY_TERMS = 25;
// LUCNENENET NOTE: The following fields were made into auto-implemented properties:
@@ -207,7 +193,7 @@ namespace Lucene.Net.Queries.Mlt
// maxQueryTerms, similarity
/// <summary>
- /// IndexReader to use
+ /// <see cref="IndexReader"/> to use
/// </summary>
private readonly IndexReader ir;
@@ -217,10 +203,8 @@ namespace Lucene.Net.Queries.Mlt
private float boostFactor = 1;
/// <summary>
- /// Returns the boost factor used when boosting terms
+ /// Gets or Sets the boost factor used when boosting terms
/// </summary>
- /// <returns> the boost factor used when boosting terms </returns>
- /// <seealso cref= #setBoostFactor(float) </seealso>
public float BoostFactor
{
get
@@ -235,7 +219,7 @@ namespace Lucene.Net.Queries.Mlt
/// <summary>
- /// Constructor requiring an IndexReader.
+ /// Constructor requiring an <see cref="IndexReader"/>.
/// </summary>
public MoreLikeThis(IndexReader ir)
: this(ir, new DefaultSimilarity())
@@ -267,37 +251,32 @@ namespace Lucene.Net.Queries.Mlt
/// <summary>
- /// Returns an analyzer that will be used to parse source doc with. The default analyzer
- /// is not set.
+ /// Gets or Sets an analyzer that will be used to parse source doc with. The default analyzer
+ /// is not set. An analyzer is not required for generating a query with the
+ /// <see cref="Like(int)"/> method, all other 'like' methods require an analyzer.
/// </summary>
- /// <returns> the analyzer that will be used to parse source doc with. </returns>
public Analyzer Analyzer { get; set; }
/// <summary>
- /// Returns the frequency below which terms will be ignored in the source doc. The default
- /// frequency is the <seealso cref="#DEFAULT_MIN_TERM_FREQ"/>.
+ /// Gets or Sets the frequency below which terms will be ignored in the source doc. The default
+ /// frequency is the <see cref="DEFAULT_MIN_TERM_FREQ"/>.
/// </summary>
- /// <returns> the frequency below which terms will be ignored in the source doc. </returns>
public int MinTermFreq { get; set; }
/// <summary>
- /// Returns the frequency at which words will be ignored which do not occur in at least this
- /// many docs. The default frequency is <seealso cref="#DEFAULT_MIN_DOC_FREQ"/>.
+ /// Gets or Sets the frequency at which words will be ignored which do not occur in at least this
+ /// many docs. The default frequency is <see cref="DEFAULT_MIN_DOC_FREQ"/>.
/// </summary>
- /// <returns> the frequency at which words will be ignored which do not occur in at least this
- /// many docs. </returns>
public int MinDocFreq { get; set; }
/// <summary>
- /// Returns the maximum frequency in which words may still appear.
+ /// Gets or Sets the maximum frequency in which words may still appear.
/// Words that appear in more than this many docs will be ignored. The default frequency is
- /// <seealso cref="#DEFAULT_MAX_DOC_FREQ"/>.
+ /// <see cref="DEFAULT_MAX_DOC_FREQ"/>.
/// </summary>
- /// <returns> get the maximum frequency at which words are still allowed,
- /// words which occur in more docs than this are ignored. </returns>
public int MaxDocFreq { get; set; }
@@ -317,55 +296,50 @@ namespace Lucene.Net.Queries.Mlt
/// Gets or Sets whether to boost terms in query based on "score" or not. The default is
/// <see cref="DEFAULT_BOOST"/>.
/// </summary>
- /// <returns> whether to boost terms in query based on "score" or not. </returns>
public bool ApplyBoost { get; set; }
/// <summary>
- /// Returns the field names that will be used when generating the 'More Like This' query.
- /// The default field names that will be used is <seealso cref="#DEFAULT_FIELD_NAMES"/>.
+ /// Gets or Sets the field names that will be used when generating the 'More Like This' query.
+ /// The default field names that will be used is <see cref="DEFAULT_FIELD_NAMES"/>.
+ /// Set this to null for the field names to be determined at runtime from the <see cref="IndexReader"/>
+ /// provided in the constructor.
/// </summary>
- /// <returns> the field names that will be used when generating the 'More Like This' query. </returns>
[WritableArray]
public string[] FieldNames { get; set; }
/// <summary>
- /// Returns the minimum word length below which words will be ignored. Set this to 0 for no
- /// minimum word length. The default is <seealso cref="#DEFAULT_MIN_WORD_LENGTH"/>.
+ /// Gets or Sets the minimum word length below which words will be ignored. Set this to 0 for no
+ /// minimum word length. The default is <see cref="DEFAULT_MIN_WORD_LENGTH"/>.
/// </summary>
- /// <returns> the minimum word length below which words will be ignored. </returns>
public int MinWordLen { get; set; }
/// <summary>
- /// Returns the maximum word length above which words will be ignored. Set this to 0 for no
- /// maximum word length. The default is <seealso cref="#DEFAULT_MAX_WORD_LENGTH"/>.
+ /// Gets or Sets the maximum word length above which words will be ignored. Set this to 0 for no
+ /// maximum word length. The default is <see cref="DEFAULT_MAX_WORD_LENGTH"/>.
/// </summary>
- /// <returns> the maximum word length above which words will be ignored. </returns>
public int MaxWordLen { get; set; }
/// <summary>
- /// Set the set of stopwords.
+ /// Gets or Sets the set of stopwords.
/// Any word in this set is considered "uninteresting" and ignored.
- /// Even if your Analyzer allows stopwords, you might want to tell the MoreLikeThis code to ignore them, as
+ /// Even if your <see cref="Analysis.Analyzer"/> allows stopwords, you might want to tell the <see cref="MoreLikeThis"/> code to ignore them, as
/// for the purposes of document similarity it seems reasonable to assume that "a stop word is never interesting".
/// </summary>
- /// <param name="stopWords"> set of stopwords, if null it means to allow stop words </param>
- /// <seealso cref= #getStopWords </seealso>
public ISet<string> StopWords { get; set; }
/// <summary>
- /// Returns the maximum number of query terms that will be included in any generated query.
- /// The default is <seealso cref="#DEFAULT_MAX_QUERY_TERMS"/>.
+ /// Gets or Sets the maximum number of query terms that will be included in any generated query.
+ /// The default is <see cref="DEFAULT_MAX_QUERY_TERMS"/>.
/// </summary>
- /// <returns> the maximum number of query terms that will be included in any generated query. </returns>
public int MaxQueryTerms { get; set; }
- /// <returns> The maximum number of tokens to parse in each example doc field that is not stored with TermVector support </returns>
- /// <seealso cref= #DEFAULT_MAX_NUM_TOKENS_PARSED </seealso>
+ /// <returns> Gets or Sets the maximum number of tokens to parse in each example doc field that is not stored with TermVector support </returns>
+ /// <seealso cref="DEFAULT_MAX_NUM_TOKENS_PARSED"/>
public int MaxNumTokensParsed { get; set; }
@@ -388,16 +362,16 @@ namespace Lucene.Net.Queries.Mlt
}
/// <summary>
- /// Return a query that will return docs like the passed Reader.
+ /// Return a query that will return docs like the passed <see cref="TextReader"/>.
/// </summary>
- /// <returns> a query that will return docs like the passed Reader. </returns>
- public Query Like(Reader r, string fieldName)
+ /// <returns> a query that will return docs like the passed <see cref="TextReader"/>. </returns>
+ public Query Like(TextReader r, string fieldName)
{
return CreateQuery(RetrieveTerms(r, fieldName));
}
/// <summary>
- /// Create the More like query from a PriorityQueue
+ /// Create the More like query from a <see cref="Util.PriorityQueue{Object[]}"/>
/// </summary>
private Query CreateQuery(Util.PriorityQueue<object[]> q)
{
@@ -442,9 +416,9 @@ namespace Lucene.Net.Queries.Mlt
}
/// <summary>
- /// Create a PriorityQueue from a word->tf map.
+ /// Create a <see cref="Util.PriorityQueue{Object[]}"/> from a word->tf map.
/// </summary>
- /// <param name="words"> a map of words keyed on the word(String) with Int objects as the values. </param>
+ /// <param name="words"> a map of words keyed on the word(<see cref="string"/>) with <see cref="Int"/> objects as the values. </param>
/// <exception cref="IOException"/>
private Util.PriorityQueue<object[]> CreateQueue(IDictionary<string, Int> words)
{
@@ -562,9 +536,9 @@ namespace Lucene.Net.Queries.Mlt
}
/// <summary>
- /// Adds terms and frequencies found in vector into the Map termFreqMap
+ /// Adds terms and frequencies found in vector into the <see cref="IDictionary{string, Int}"/> <paramref name="termFreqMap"/>
/// </summary>
- /// <param name="termFreqMap"> a Map of terms and their frequencies </param>
+ /// <param name="termFreqMap"> a <see cref="IDictionary{string, Int}"/> of terms and their frequencies </param>
/// <param name="vector"> List of terms and their frequencies for a doc/field </param>
private void AddTermFrequencies(IDictionary<string, Int> termFreqMap, Terms vector)
{
@@ -597,12 +571,12 @@ namespace Lucene.Net.Queries.Mlt
}
/// <summary>
- /// Adds term frequencies found by tokenizing text from reader into the Map words
+ /// Adds term frequencies found by tokenizing text from reader into the <see cref="IDictionary{string, Int}"/> words
/// </summary>
/// <param name="r"> a source of text to be tokenized </param>
- /// <param name="termFreqMap"> a Map of terms and their frequencies </param>
+ /// <param name="termFreqMap"> a <see cref="IDictionary{string, Int}"/> of terms and their frequencies </param>
/// <param name="fieldName"> Used by analyzer for any special per-field analysis </param>
- private void AddTermFrequencies(Reader r, IDictionary<string, Int> termFreqMap, string fieldName)
+ private void AddTermFrequencies(TextReader r, IDictionary<string, Int> termFreqMap, string fieldName)
{
if (Analyzer == null)
{
@@ -652,7 +626,7 @@ namespace Lucene.Net.Queries.Mlt
/// determines if the passed term is likely to be of interest in "more like" comparisons
/// </summary>
/// <param name="term"> The word being considered </param>
- /// <returns> true if should be ignored, false if should be used in further analysis </returns>
+ /// <returns> <c>true</c> if should be ignored, <c>false</c> if should be used in further analysis </returns>
private bool IsNoiseWord(string term)
{
int len = term.Length;
@@ -673,31 +647,31 @@ namespace Lucene.Net.Queries.Mlt
/// The result is a priority queue of arrays with one entry for <b>every word</b> in the document.
/// Each array has 6 elements.
/// The elements are:
- /// <ol>
- /// <li> The word (String)
- /// <li> The top field that this word comes from (String)
- /// <li> The score for this word (Float)
- /// <li> The IDF value (Float)
- /// <li> The frequency of this word in the index (Integer)
- /// <li> The frequency of this word in the source document (Integer)
- /// </ol>
+ /// <list type="bullet">
+ /// <item>The word (<see cref="string"/>)</item>
+ /// <item>The top field that this word comes from (<see cref="string"/>)</item>
+ /// <item>The score for this word (<see cref="float"/>)</item>
+ /// <item>The IDF value (<see cref="float"/>)</item>
+ /// <item>The frequency of this word in the index (<see cref="int"/>)</item>
+ /// <item>The frequency of this word in the source document (<see cref="int"/>)</item>
+ /// </list>
/// This is a somewhat "advanced" routine, and in general only the 1st entry in the array is of interest.
/// This method is exposed so that you can identify the "interesting words" in a document.
- /// For an easier method to call see <seealso cref="#retrieveInterestingTerms retrieveInterestingTerms()"/>.
+ /// For an easier method to call see <see cref="RetrieveInterestingTerms"/>.
/// </summary>
/// <param name="r"> the reader that has the content of the document </param>
/// <param name="fieldName"> field passed to the analyzer to use when analyzing the content </param>
/// <returns> the most interesting words in the document ordered by score, with the highest scoring, or best entry, first </returns>
/// <exception cref="IOException"/>
- /// <seealso cref= #retrieveInterestingTerms </seealso>
- public Util.PriorityQueue<object[]> RetrieveTerms(Reader r, string fieldName)
+ /// <seealso cref="RetrieveInterestingTerms"/>
+ public Util.PriorityQueue<object[]> RetrieveTerms(TextReader r, string fieldName)
{
IDictionary<string, Int> words = new Dictionary<string, Int>();
AddTermFrequencies(r, words, fieldName);
return CreateQueue(words);
}
- /// <seealso cref= #retrieveInterestingTerms(java.io.Reader, String) </seealso>
+ /// <seealso cref="RetrieveInterestingTerms(TextReader, string)"/>
public string[] RetrieveInterestingTerms(int docNum)
{
var al = new List<string>(MaxQueryTerms);
@@ -715,14 +689,14 @@ namespace Lucene.Net.Queries.Mlt
/// <summary>
/// Convenience routine to make it easy to return the most interesting words in a document.
- /// More advanced users will call <seealso cref="#retrieveTerms(Reader, String) retrieveTerms()"/> directly.
+ /// More advanced users will call <see cref="RetrieveTerms(TextReader, string)"/> directly.
/// </summary>
/// <param name="r"> the source document </param>
/// <param name="fieldName"> field passed to analyzer to use when analyzing the content </param>
/// <returns> the most interesting words in the document </returns>
- /// <seealso cref= #retrieveTerms(java.io.Reader, String) </seealso>
- /// <seealso cref= #setMaxQueryTerms </seealso>
- public string[] RetrieveInterestingTerms(Reader r, string fieldName)
+ /// <seealso cref="RetrieveTerms(TextReader, string)"/>
+ /// <seealso cref="MaxQueryTerms"/>
+ public string[] RetrieveInterestingTerms(TextReader r, string fieldName)
{
var al = new List<string>(MaxQueryTerms);
Util.PriorityQueue<object[]> pq = RetrieveTerms(r, fieldName);
@@ -738,7 +712,7 @@ namespace Lucene.Net.Queries.Mlt
}
/// <summary>
- /// PriorityQueue that orders words by score.
+ /// <see cref="Util.PriorityQueue{object[]}"/> that orders words by score.
/// </summary>
private class FreqQ : Util.PriorityQueue<object[]>
{
@@ -756,7 +730,7 @@ namespace Lucene.Net.Queries.Mlt
}
/// <summary>
- /// Use for frequencies and to avoid renewing Integers.
+ /// Use for frequencies and to avoid renewing <see cref="int"/>s.
/// </summary>
private class Int
{
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs b/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
index 3344adc..a0c9746 100644
--- a/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
+++ b/src/Lucene.Net.Queries/Mlt/MoreLikeThisQuery.cs
@@ -28,9 +28,9 @@ namespace Lucene.Net.Queries.Mlt
*/
/// <summary>
- /// A simple wrapper for MoreLikeThis for use in scenarios where a Query object is required eg
- /// in custom QueryParser extensions. At query.rewrite() time the reader is used to construct the
- /// actual MoreLikeThis object and obtain the real Query object.
+ /// A simple wrapper for <see cref="MoreLikeThis"/> for use in scenarios where a <see cref="Query"/> object is required eg
+ /// in custom QueryParser extensions. At query.Rewrite() time the reader is used to construct the
+ /// actual <see cref="MoreLikeThis"/> object and obtain the real <see cref="Query"/> object.
/// </summary>
public class MoreLikeThisQuery : Query
{
@@ -75,9 +75,9 @@ namespace Lucene.Net.Queries.Mlt
return bq;
}
- /* (non-Javadoc)
- * @see org.apache.lucene.search.Query#toString(java.lang.String)
- */
+ /// <summary>
+ /// <see cref="Query.ToString(string)"/>
+ /// </summary>
public override string ToString(string field)
{
return "like:" + LikeText;
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/TermFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/TermFilter.cs b/src/Lucene.Net.Queries/TermFilter.cs
index 880ddfb..a3a48a8 100644
--- a/src/Lucene.Net.Queries/TermFilter.cs
+++ b/src/Lucene.Net.Queries/TermFilter.cs
@@ -42,7 +42,7 @@ namespace Lucene.Net.Queries
this.term = term;
}
- /// <returns> The term this filter includes documents with. </returns>
+ /// <summary> Gets the term this filter includes documents with. </summary>
public Term Term
{
get
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4438d239/src/Lucene.Net.Queries/TermsFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/TermsFilter.cs b/src/Lucene.Net.Queries/TermsFilter.cs
index 3cff069..73a2611 100644
--- a/src/Lucene.Net.Queries/TermsFilter.cs
+++ b/src/Lucene.Net.Queries/TermsFilter.cs
@@ -31,7 +31,7 @@ namespace Lucene.Net.Queries
/// Unlike a RangeFilter this can be used for filtering on multiple terms that are not necessarily in
/// a sequence. An example might be a collection of primary keys from a database query result or perhaps
/// a choice of "category" labels picked by the end user. As a filter, this is much faster than the
- /// equivalent query (a BooleanQuery with many "should" TermQueries)
+ /// equivalent query (a <see cref="BooleanQuery"/> with many "should" <see cref="TermQuery"/>s)
/// </summary>
public sealed class TermsFilter : Filter
{
@@ -52,7 +52,7 @@ namespace Lucene.Net.Queries
private const int PRIME = 31;
/// <summary>
- /// Creates a new <seealso cref="TermsFilter"/> from the given list. The list
+ /// Creates a new <see cref="TermsFilter"/> from the given list. The list
/// can contain duplicate terms and multiple fields.
/// </summary>
public TermsFilter(List<Term> terms)
@@ -91,7 +91,7 @@ namespace Lucene.Net.Queries
}
/// <summary>
- /// Creates a new <seealso cref="TermsFilter"/> from the given <seealso cref="BytesRef"/> list for
+ /// Creates a new <see cref="TermsFilter"/> from the given <see cref="BytesRef"/> list for
/// a single field.
/// </summary>
public TermsFilter(string field, List<BytesRef> terms)
@@ -129,7 +129,7 @@ namespace Lucene.Net.Queries
}
/// <summary>
- /// Creates a new <seealso cref="TermsFilter"/> from the given <seealso cref="BytesRef"/> array for
+ /// Creates a new <see cref="TermsFilter"/> from the given <see cref="BytesRef"/> array for
/// a single field.
/// </summary>
public TermsFilter(string field, params BytesRef[] terms)
@@ -139,7 +139,7 @@ namespace Lucene.Net.Queries
}
/// <summary>
- /// Creates a new <seealso cref="TermsFilter"/> from the given array. The array can
+ /// Creates a new <see cref="TermsFilter"/> from the given array. The array can
/// contain duplicate terms and multiple fields.
/// </summary>
public TermsFilter(params Term[] terms)