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/10/13 11:09:58 UTC

[01/10] lucenenet git commit: Lucene.Net.Index.SegmentCoreReaders: Removed try catch block for AccessViolationException, which did not exist in Lucene. There does not appear to be a valid reason to include it.

Repository: lucenenet
Updated Branches:
  refs/heads/master b856f1eb0 -> d5ea2010a


Lucene.Net.Index.SegmentCoreReaders: Removed try catch block for AccessViolationException, which did not exist in Lucene. There does not appear to be a valid reason to include it.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/8081bbc1
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/8081bbc1
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/8081bbc1

Branch: refs/heads/master
Commit: 8081bbc1123b3fee183cd136d9faa91abb8854a6
Parents: b856f1e
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Oct 3 21:02:37 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Oct 3 21:02:37 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net/Index/SegmentCoreReaders.cs | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8081bbc1/src/Lucene.Net/Index/SegmentCoreReaders.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/SegmentCoreReaders.cs b/src/Lucene.Net/Index/SegmentCoreReaders.cs
index 6a406a2..d6fbee2 100644
--- a/src/Lucene.Net/Index/SegmentCoreReaders.cs
+++ b/src/Lucene.Net/Index/SegmentCoreReaders.cs
@@ -163,23 +163,7 @@ namespace Lucene.Net.Index
                     normsProducer = null;
                 }
 
-                // LUCENENET TODO: EXCEPTIONS Not sure why this catch block is swallowing AccessViolationException, 
-                // because it didn't exist in Lucene. Is it really needed? AVE is for protected memory...could
-                // this be needed because we are using unchecked??
-
-#if !NETSTANDARD
-                try
-                {
-#endif
-                    fieldsReaderOrig = si.Info.Codec.StoredFieldsFormat.FieldsReader(cfsDir, si.Info, fieldInfos, context);
-#if !NETSTANDARD
-                }
-#pragma warning disable 168
-                catch (System.AccessViolationException ave)
-#pragma warning restore 168
-                {
-                }
-#endif
+                fieldsReaderOrig = si.Info.Codec.StoredFieldsFormat.FieldsReader(cfsDir, si.Info, fieldInfos, context);
 
                 if (fieldInfos.HasVectors) // open term vector files only as needed
                 {


[08/10] lucenenet git commit: Lucene.Net: Added extension methods to Document class for adding Field types (except for those marked obsolete)

Posted by ni...@apache.org.
Lucene.Net: Added extension methods to Document class for adding Field types (except for those marked obsolete)


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a06752f6
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a06752f6
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a06752f6

Branch: refs/heads/master
Commit: a06752f670bd363062b69597ec52d97cf9b38690
Parents: ecf3e4e
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Oct 5 03:47:38 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Oct 5 03:49:39 2017 +0700

----------------------------------------------------------------------
 .../Support/Document/DocumentExtensions.cs      | 459 ++++++++++++++++++-
 1 file changed, 453 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a06752f6/src/Lucene.Net/Support/Document/DocumentExtensions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/Document/DocumentExtensions.cs b/src/Lucene.Net/Support/Document/DocumentExtensions.cs
index a736a96..8e1bb86 100644
--- a/src/Lucene.Net/Support/Document/DocumentExtensions.cs
+++ b/src/Lucene.Net/Support/Document/DocumentExtensions.cs
@@ -1,4 +1,7 @@
-using Lucene.Net.Index;
+using Lucene.Net.Analysis;
+using Lucene.Net.Index;
+using Lucene.Net.Util;
+using System.IO;
 using System.Linq;
 
 namespace Lucene.Net.Documents
@@ -21,7 +24,7 @@ namespace Lucene.Net.Documents
      */
 
     /// <summary>
-    /// Extension methods to the <see cref="Document"/> class.
+    /// LUCENENET specific extensions to the <see cref="Document"/> class.
     /// </summary>
     public static class DocumentExtensions
     {
@@ -29,9 +32,9 @@ namespace Lucene.Net.Documents
         /// Returns a field with the given name if any exist in this document cast to type <typeparamref name="T"/>, or
         /// <c>null</c>. If multiple fields exists with this name, this method returns the
         /// first value added.
-        /// <para/>
-        /// LUCENENET specific
         /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name">Field name</param>
         /// <exception cref="System.InvalidCastException">If the field type cannot be cast to <typeparamref name="T"/>.</exception>
         public static T GetField<T>(this Document document, string name) where T : IIndexableField
         {
@@ -42,9 +45,8 @@ namespace Lucene.Net.Documents
         /// Returns an array of <see cref="IIndexableField"/>s with the given name, cast to type <typeparamref name="T"/>.
         /// This method returns an empty array when there are no
         /// matching fields. It never returns <c>null</c>.
-        /// <para/>
-        /// LUCENENET specific
         /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
         /// <param name="name"> the name of the field </param>
         /// <returns> a <see cref="T:IndexableField[]"/> array </returns>
         /// <exception cref="System.InvalidCastException">If the field type cannot be cast to <typeparam name="T"/>.</exception>
@@ -52,5 +54,450 @@ namespace Lucene.Net.Documents
         {
             return document.GetFields(name).Cast<T>().ToArray();
         }
+
+        /// <summary>
+        /// Adds a new <see cref="BinaryDocValuesField"/>.
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> binary content </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field name is null </exception>
+        public static BinaryDocValuesField AddBinaryDocValuesField(this Document document, string name, BytesRef value)
+        {
+            var field = new BinaryDocValuesField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="DoubleDocValuesField"/> field with the specified 64-bit double value </summary>
+        /// <remarks>
+        /// Syntactic sugar for encoding doubles as <see cref="Index.NumericDocValues"/>
+        /// via <see cref="Support.Number.DoubleToRawInt64Bits(double)"/>.
+        /// <para/>
+        /// Per-document double values can be retrieved via
+        /// <see cref="Search.IFieldCache.GetDoubles(Lucene.Net.Index.AtomicReader, string, bool)"/>.
+        /// <para/>
+        /// <b>NOTE</b>: In most all cases this will be rather inefficient,
+        /// requiring eight bytes per document. Consider encoding double
+        /// values yourself with only as much precision as you require.
+        /// </remarks>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 64-bit double value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field name is <c>null</c> </exception>
+        public static DoubleDocValuesField AddDoubleDocValuesField(this Document document, string name, double value)
+        {
+            var field = new DoubleDocValuesField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="DoubleField"/> with the provided value
+        /// and default <c>precisionStep</c> 
+        /// <see cref="Util.NumericUtils.PRECISION_STEP_DEFAULT"/> (4).
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 64-bit <see cref="double"/> value </param>
+        /// <param name="stored"> <see cref="Field.Store.YES"/> if the content should also be stored </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field name is <c>null</c>.  </exception>
+        public static DoubleField AddDoubleField(this Document document, string name, double value, Field.Store stored)
+        {
+            var field = new DoubleField(name, value, stored);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="DoubleField"/> with the provided value.
+        /// <para/>
+        /// Expert: allows you to customize the <see cref="FieldType"/>. 
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 64-bit double value </param>
+        /// <param name="type"> customized field type: must have <see cref="FieldType.NumericType"/>
+        ///         of <see cref="NumericType.DOUBLE"/>. </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field name or type is <c>null</c>, or
+        ///          if the field type does not have a <see cref="NumericType.DOUBLE"/> <see cref="FieldType.NumericType"/> </exception>
+        public static DoubleField AddDoubleField(this Document document, string name, double value, FieldType type)
+        {
+            var field = new DoubleField(name, value, type);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="SingleDocValuesField"/> field with the specified 32-bit <see cref="float"/> value </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 32-bit <see cref="float"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field name is <c>null</c> </exception>
+        public static SingleDocValuesField AddSingleDocValuesField(this Document document, string name, float value)
+        {
+            var field = new SingleDocValuesField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="SingleField"/> with the provided value
+        /// and default <c>precisionStep</c> <see cref="Util.NumericUtils.PRECISION_STEP_DEFAULT"/>
+        /// (4).
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 32-bit <see cref="float"/> value </param>
+        /// <param name="stored"> <see cref="Field.Store.YES"/> if the content should also be stored </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static SingleField AddSingleField(this Document document, string name, float value, Field.Store stored)
+        {
+            var field = new SingleField(name, value, stored);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="SingleField"/> with the provided value.
+        /// <para/>
+        /// Expert: allows you to customize the <see cref="FieldType"/>. 
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 32-bit <see cref="float"/> value </param>
+        /// <param name="type"> customized field type: must have <see cref="FieldType.NumericType"/>
+        ///         of <see cref="NumericType.SINGLE"/>. </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="type"/> is <see cref="NumericType.NONE"/> </exception>
+        /// <exception cref="System.ArgumentException">if the field type does not have a <see cref="NumericType.SINGLE"/> <see cref="FieldType.NumericType"/></exception>
+        public static SingleField AddSingleField(this Document document, string name, float value, FieldType type)
+        {
+            var field = new SingleField(name, value, type);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="Int32Field"/> with the provided value
+        /// and default <c>precisionStep</c> 
+        /// <see cref="Util.NumericUtils.PRECISION_STEP_DEFAULT"/> (4). 
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 32-bit <see cref="int"/> value </param>
+        /// <param name="stored"> <see cref="Field.Store.YES"/> if the content should also be stored </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static Int32Field AddInt32Field(this Document document, string name, int value, Field.Store stored)
+        {
+            var field = new Int32Field(name, value, stored);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="Int32Field"/> with the provided value.
+        /// <para/>
+        /// Expert: allows you to customize the 
+        /// <see cref="FieldType"/>.
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 32-bit <see cref="int"/> value </param>
+        /// <param name="type"> customized field type: must have <see cref="FieldType.NumericType"/>
+        ///         of <see cref="NumericType.INT32"/>. </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="type"/> is <see cref="NumericType.NONE"/> </exception>
+        /// <exception cref="System.ArgumentException">if the field type does not have a 
+        ///         <see cref="FieldType.NumericType"/> of <see cref="NumericType.INT32"/> </exception>
+        public static Int32Field AddInt32Field(this Document document, string name, int value, FieldType type)
+        {
+            var field = new Int32Field(name, value, type);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="Int64Field"/> with the provided value
+        /// and default <c>precisionStep</c> 
+        /// <see cref="Util.NumericUtils.PRECISION_STEP_DEFAULT"/> (4). 
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 64-bit <see cref="long"/> value </param>
+        /// <param name="stored"> <see cref="Field.Store.YES"/> if the content should also be stored </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static Int64Field AddInt64Field(this Document document, string name, long value, Field.Store stored)
+        {
+            var field = new Int64Field(name, value, stored);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored or un-stored <see cref="Int64Field"/> with the provided value.
+        /// <para/>
+        /// Expert: allows you to customize the <see cref="FieldType"/>. 
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 64-bit <see cref="long"/> value </param>
+        /// <param name="type"> customized field type: must have <see cref="FieldType.NumericType"/>
+        ///         of <see cref="NumericType.INT64"/>. </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="type"/> is <see cref="NumericType.NONE"/> </exception>
+        /// <exception cref="System.ArgumentException"> if the field type does not have a 
+        /// <see cref="FieldType.NumericType"/> of <see cref="NumericType.INT64"/> </exception>
+        public static Int64Field AddInt64Field(this Document document, string name, long value, FieldType type)
+        {
+            var field = new Int64Field(name, value, type);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="NumericDocValuesField"/> field with the specified 64-bit <see cref="long"/> value </summary>
+        /// <remarks>
+        /// If you also need to store the value, you should add a
+        /// separate <see cref="StoredField"/> instance.
+        /// </remarks>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> 64-bit <see cref="long"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c> </exception>
+        public static NumericDocValuesField AddNumericDocValuesField(this Document document, string name, long value)
+        {
+            var field = new NumericDocValuesField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="SortedDocValuesField"/> field. </summary>
+        /// <remarks>
+        /// If you also need to store the value, you should add a
+        /// separate <see cref="StoredField"/> instance.
+        /// </remarks>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="bytes"> binary content </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c> </exception>
+        public static SortedDocValuesField AddSortedDocValuesField(this Document document, string name, BytesRef bytes)
+        {
+            var field = new SortedDocValuesField(name, bytes);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="SortedSetDocValuesField"/> field. </summary>
+        /// <remarks>
+        /// If you also need to store the value, you should add a
+        /// separate <see cref="StoredField"/> instance.
+        /// </remarks>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="bytes"> binary content </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c> </exception>
+        public static SortedSetDocValuesField AddSortedSetDocValuesField(this Document document, string name, BytesRef bytes)
+        {
+            var field = new SortedSetDocValuesField(name, bytes);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given binary value.
+        /// <para>NOTE: the provided <see cref="T:byte[]"/> is not copied so be sure
+        /// not to change it until you're done with this field.</para>
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> byte array pointing to binary content (not copied) </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, byte[] value)
+        {
+            var field = new StoredField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given binary value.
+        /// <para>NOTE: the provided <see cref="T:byte[]"/> is not copied so be sure
+        /// not to change it until you're done with this field.</para>
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="byte"/> array pointing to binary content (not copied) </param>
+        /// <param name="offset"> starting position of the byte array </param>
+        /// <param name="length"> valid length of the byte array </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, byte[] value, int offset, int length)
+        {
+            var field = new StoredField(name, value, offset, length);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given binary value.
+        /// <para>NOTE: the provided <see cref="BytesRef"/> is not copied so be sure
+        /// not to change it until you're done with this field.</para>
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="BytesRef"/> pointing to binary content (not copied) </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, BytesRef value)
+        {
+            var field = new StoredField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given <see cref="string"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="string"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="value"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, string value)
+        {
+            var field = new StoredField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given <see cref="int"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="int"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, int value)
+        {
+            var field = new StoredField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given <see cref="float"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="float"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, float value)
+        {
+            var field = new StoredField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given <see cref="long"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="long"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, long value)
+        {
+            var field = new StoredField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a stored-only field with the given <see cref="double"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="double"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> is <c>null</c>. </exception>
+        public static StoredField AddStoredField(this Document document, string name, double value)
+        {
+            var field = new StoredField(name, value);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="StringField"/> (a field that is indexed but not tokenized)
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="string"/> value </param>
+        /// <param name="stored"> <see cref="Field.Store.YES"/> if the content should also be stored </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="value"/> is <c>null</c>. </exception>
+        public static StringField AddStringField(this Document document, string name, string value, Field.Store stored)
+        {
+            var field = new StringField(name, value, stored);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new un-stored <see cref="TextField"/> with <see cref="TextReader"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="reader"> <see cref="TextReader"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="reader"/> is <c>null</c> </exception>
+        public static TextField AddTextField(this Document document, string name, TextReader reader)
+        {
+            var field = new TextField(name, reader);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="TextField"/> with <see cref="string"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="value"> <see cref="string"/> value </param>
+        /// <param name="stored"> <see cref="Field.Store.YES"/> if the content should also be stored </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="value"/> is <c>null</c>. </exception>
+        public static TextField AddTextField(this Document document, string name, string value, Field.Store stored)
+        {
+            var field = new TextField(name, value, stored);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new un-stored <see cref="TextField"/> with <see cref="TokenStream"/> value. </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name"> field name </param>
+        /// <param name="stream"> <see cref="TokenStream"/> value </param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        /// <exception cref="System.ArgumentNullException"> if the field <paramref name="name"/> or <paramref name="stream"/> is <c>null</c>. </exception>
+        public static TextField AddTextField(this Document document, string name, TokenStream stream)
+        {
+            var field = new TextField(name, stream);
+            document.Add(field);
+            return field;
+        }
     }
 }


[02/10] lucenenet git commit: Lucene.Net.Replicator.AspNetCore: Removed CLSCompliant attribute because dependencies are not marked CLS compliant.

Posted by ni...@apache.org.
Lucene.Net.Replicator.AspNetCore: Removed CLSCompliant attribute because dependencies are not marked CLS compliant.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/869d1ddf
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/869d1ddf
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/869d1ddf

Branch: refs/heads/master
Commit: 869d1ddf060882d224c74b1430272fad19e9a86b
Parents: 8081bbc
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Oct 3 21:24:37 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Oct 3 21:24:37 2017 +0700

----------------------------------------------------------------------
 .../Lucene.Net.Replicator.AspNetCore/Properties/AssemblyInfo.cs  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/869d1ddf/src/dotnet/Lucene.Net.Replicator.AspNetCore/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/dotnet/Lucene.Net.Replicator.AspNetCore/Properties/AssemblyInfo.cs b/src/dotnet/Lucene.Net.Replicator.AspNetCore/Properties/AssemblyInfo.cs
index a5e4b82..1158953 100644
--- a/src/dotnet/Lucene.Net.Replicator.AspNetCore/Properties/AssemblyInfo.cs
+++ b/src/dotnet/Lucene.Net.Replicator.AspNetCore/Properties/AssemblyInfo.cs
@@ -30,7 +30,9 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyDefaultAlias("Lucene.Net.Replicator.AspNetCore")]
 [assembly: AssemblyCulture("")]
 
-[assembly: CLSCompliant(true)]
+// LUCENENET: Not marking CLS Compliant because Microsoft.AspNetCore.Http.Abstractions is not CLS compliant
+// See: https://github.com/aspnet/HttpAbstractions/issues/938
+//[assembly: CLSCompliant(true)]
 
 // Setting ComVisible to false makes the types in this assembly not visible
 // to COM components.  If you need to access a type in this assembly from


[07/10] lucenenet git commit: Lucene.Net.ICU: Added extension methods to Document class for adding ICU-related Field types

Posted by ni...@apache.org.
Lucene.Net.ICU: Added extension methods to Document class for adding ICU-related Field types


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/ecf3e4e0
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/ecf3e4e0
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/ecf3e4e0

Branch: refs/heads/master
Commit: ecf3e4e09a82f2457a29ea7579024c85a402e184
Parents: a032177
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Oct 5 03:46:55 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Oct 5 03:49:38 2017 +0700

----------------------------------------------------------------------
 .../Support/Document/DocumentExtensions.cs      | 46 ++++++++++++++++++++
 1 file changed, 46 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/ecf3e4e0/src/dotnet/Lucene.Net.ICU/Support/Document/DocumentExtensions.cs
----------------------------------------------------------------------
diff --git a/src/dotnet/Lucene.Net.ICU/Support/Document/DocumentExtensions.cs b/src/dotnet/Lucene.Net.ICU/Support/Document/DocumentExtensions.cs
new file mode 100644
index 0000000..1ea38e5
--- /dev/null
+++ b/src/dotnet/Lucene.Net.ICU/Support/Document/DocumentExtensions.cs
@@ -0,0 +1,46 @@
+using Icu.Collation;
+using Lucene.Net.Collation;
+
+namespace Lucene.Net.Documents
+{
+    /*
+     * 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.
+     */
+
+    /// <summary>
+    /// LUCENENET specific extensions to the <see cref="Document"/> class.
+    /// </summary>
+    public static class DocumentExtensions
+    {
+        /// <summary>
+        /// Adds a new <see cref="ICUCollationDocValuesField"/>.
+        /// <para/>
+        /// NOTE: you should not create a new one for each document, instead
+        /// just make one and reuse it during your indexing process, setting
+        /// the value via <see cref="ICUCollationDocValuesField.SetStringValue(string)"/>.
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="name">Field name.</param>
+        /// <param name="collator">Collator for generating collation keys.</param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        public static ICUCollationDocValuesField AddICUCollationDocValuesField(this Document document, string name, Collator collator)
+        {
+            var field = new ICUCollationDocValuesField(name, collator);
+            document.Add(field);
+            return field;
+        }
+    }
+}


[10/10] lucenenet git commit: Reviewed and removed various TODOs

Posted by ni...@apache.org.
Reviewed and removed various TODOs


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/d5ea2010
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/d5ea2010
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/d5ea2010

Branch: refs/heads/master
Commit: d5ea2010abe7404a702f7e319d249024a0623d67
Parents: 21522f3
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Oct 5 04:22:35 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Oct 5 04:44:20 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs  | 2 --
 .../Flexible/Core/Nodes/ProximityQueryNode.cs                    | 2 +-
 .../Flexible/Standard/Nodes/NumericQueryNode.cs                  | 2 +-
 src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs                  | 2 +-
 src/Lucene.Net.Tests.Grouping/TestGrouping.cs                    | 4 ++--
 .../Flexible/Core/Builders/TestQueryTreeBuilder.cs               | 1 -
 .../Flexible/Precedence/TestPrecedenceQueryParser.cs             | 2 +-
 7 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d5ea2010/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
index cddbb4c..b8dfe92 100644
--- a/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
+++ b/src/Lucene.Net.Queries/Function/ValueSources/EnumFieldSource.cs
@@ -310,7 +310,6 @@ namespace Lucene.Net.Queries.Function.ValueSources
 
             EnumFieldSource that = (EnumFieldSource)o;
 
-            // LUCENENET TODO: Make an EquatableDictionary so we can use Equatable.Wrap() here ?
             // LUCENENET specific: must use Collections.Equals() to ensure values
             // contained within the dictionaries are compared for equality
             if (!Collections.Equals(enumIntToStringMap, that.enumIntToStringMap))
@@ -333,7 +332,6 @@ namespace Lucene.Net.Queries.Function.ValueSources
         {
             int result = base.GetHashCode();
             result = 31 * result + parser.GetHashCode();
-            // LUCENENET TODO: Make an EquatableDictionary so we can use Equatable.Wrap() here ?
             // LUCENENET specific: must use Collections.GetHashCode() to ensure values
             // contained within the dictionaries are compared for equality
             result = 31 * result + Collections.GetHashCode(enumIntToStringMap);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d5ea2010/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/ProximityQueryNode.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/ProximityQueryNode.cs b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/ProximityQueryNode.cs
index 3781a82..b9ca019 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/ProximityQueryNode.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Core/Nodes/ProximityQueryNode.cs
@@ -198,7 +198,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Nodes
             set { this.field = value; }
         }
 
-        // LUCENENET TODO: This method is not required because Field is already a string property
+        // LUCENENET specific: This method is technically not required because Field is already a string property, not ICharSequence
         /// <summary>
         /// Gets the field as a string. Returns null if the field was not specified in the query string.
         /// </summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d5ea2010/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/NumericQueryNode.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/NumericQueryNode.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/NumericQueryNode.cs
index 50e988f..4bcb813 100644
--- a/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/NumericQueryNode.cs
+++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Nodes/NumericQueryNode.cs
@@ -28,7 +28,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Standard.Nodes
     /// <see cref="object"/> representing a .NET numeric type.
     /// </summary>
     /// <seealso cref="Standard.Config.NumericConfig"/>
-    public class NumericQueryNode : QueryNode, IFieldValuePairQueryNode<object> // LUCENENET TODO: Can we use Decimal??
+    public class NumericQueryNode : QueryNode, IFieldValuePairQueryNode<object>
     {
         private NumberFormat numberFormat;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d5ea2010/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs b/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
index 61a13a3..2686a7a 100644
--- a/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
+++ b/src/Lucene.Net.Suggest/Suggest/Tst/TSTLookup.cs
@@ -66,7 +66,7 @@ namespace Lucene.Net.Search.Suggest.Tst
 #pragma warning restore 612, 618
 
             List<string> tokens = new List<string>();
-            List<object> vals = new List<object>(); // LUCENENET TODO: Should this be long? in Java it was Number, but we can probably do better than object
+            List<object> vals = new List<object>();
             BytesRef spare;
             CharsRef charsSpare = new CharsRef();
             while ((spare = tfit.Next()) != null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d5ea2010/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Grouping/TestGrouping.cs b/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
index 6e26fc1..61c6df9 100644
--- a/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
+++ b/src/Lucene.Net.Tests.Grouping/TestGrouping.cs
@@ -550,7 +550,7 @@ namespace Lucene.Net.Search.Grouping
 
             IComparer<GroupDoc> groupSortComp = GetComparer(groupSort);
 
-            // LUCENENET TODO: The original Java API Arrays.Sort does not currently exist.
+            // LUCENENET specific: The original Java API Arrays.Sort does not currently exist.
             // This call ultimately results in calling TimSort, which is why this line was replaced
             // with ArrayUtil.TimSort(T[], IComparer<T>).
             //
@@ -620,7 +620,7 @@ namespace Lucene.Net.Search.Grouping
                 List<GroupDoc> docs = groups[group];
                 totalGroupedHitCount += docs.size();
 
-                // LUCENENET TODO: The original API Collections.Sort does not currently exist.
+                // LUCENENET specific: The original API Collections.Sort does not currently exist.
                 // This call ultimately results in calling TimSort, which is why this line was replaced
                 // with CollectionUtil.TimSort(IList<T>, IComparer<T>).
                 //

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d5ea2010/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
index 625b84c..76a442f 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Core/Builders/TestQueryTreeBuilder.cs
@@ -29,7 +29,6 @@ namespace Lucene.Net.QueryParsers.Flexible.Core.Builders
         [Test]
         public virtual void TestSetFieldBuilder()
         {
-            // LUCENENET TODO: Make additional non-generic QueryTreeBuilder of type object?
             QueryTreeBuilder<object> qtb = new QueryTreeBuilder<object>();
             qtb.SetBuilder("field", new DummyBuilder());
             Object result = qtb.Build(new FieldQueryNode(new UnescapedCharSequence("field").ToString(), "foo", 0, 0));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/d5ea2010/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs b/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
index 2c4da33..5b50ec5 100644
--- a/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
+++ b/src/Lucene.Net.Tests.QueryParser/Flexible/Precedence/TestPrecedenceQueryParser.cs
@@ -145,7 +145,7 @@ namespace Lucene.Net.QueryParsers.Flexible.Precedence
                 a = new MockAnalyzer(Random(), MockTokenizer.SIMPLE, true);
             PrecedenceQueryParser qp = new PrecedenceQueryParser();
             qp.Analyzer = (a);
-            qp.DefaultOperator = (StandardQueryConfigHandler.Operator.OR); // LUCENENET TODO: Change API back to the way it was..?
+            qp.DefaultOperator = (StandardQueryConfigHandler.Operator.OR);
             return qp;
         }
 


[09/10] lucenenet git commit: BREAKING: Lucene.Net.Facet: De-nested DrillSidewaysResult from DrillSideways class

Posted by ni...@apache.org.
BREAKING: Lucene.Net.Facet: De-nested DrillSidewaysResult from DrillSideways class


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/21522f37
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/21522f37
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/21522f37

Branch: refs/heads/master
Commit: 21522f37acce3620268ffdd6fa1739941d0fde58
Parents: a06752f
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Oct 5 04:08:18 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Oct 5 04:08:18 2017 +0700

----------------------------------------------------------------------
 .../Facet/SimpleFacetsExample.cs                |  2 +-
 src/Lucene.Net.Facet/DrillSideways.cs           | 40 ++++++++++----------
 .../Range/TestRangeFacetCounts.cs               |  2 +-
 src/Lucene.Net.Tests.Facet/TestDrillSideways.cs |  1 -
 4 files changed, 22 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/21522f37/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs b/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs
index 1e5b49b..90eb472 100644
--- a/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs
+++ b/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs
@@ -202,7 +202,7 @@ namespace Lucene.Net.Demo.Facet
                 q.Add("Publish Date", "2010");
 
                 DrillSideways ds = new DrillSideways(searcher, config, taxoReader);
-                DrillSideways.DrillSidewaysResult result = ds.Search(q, 10);
+                DrillSidewaysResult result = ds.Search(q, 10);
 
                 // Retrieve results
                 IList<FacetResult> facets = result.Facets.GetAllDims(10);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/21522f37/src/Lucene.Net.Facet/DrillSideways.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/DrillSideways.cs b/src/Lucene.Net.Facet/DrillSideways.cs
index d60af28..31fbaaa 100644
--- a/src/Lucene.Net.Facet/DrillSideways.cs
+++ b/src/Lucene.Net.Facet/DrillSideways.cs
@@ -265,31 +265,31 @@ namespace Lucene.Net.Facet
         {
             return false;
         }
+    }
 
+    /// <summary>
+    /// Result of a drill sideways search, including the
+    /// <see cref="Facet.Facets"/> and <see cref="TopDocs"/>. 
+    /// </summary>
+    public class DrillSidewaysResult
+    {
         /// <summary>
-        /// Result of a drill sideways search, including the
-        /// <see cref="Facet.Facets"/> and <see cref="TopDocs"/>. 
+        /// Combined drill down &amp; sideways results.
         /// </summary>
-        public class DrillSidewaysResult // LUCENENET TODO: API De-nest this class
-        {
-            /// <summary>
-            /// Combined drill down &amp; sideways results.
-            /// </summary>
-            public Facets Facets { get; private set; }
+        public Facets Facets { get; private set; }
 
-            /// <summary>
-            /// Hits.
-            /// </summary>
-            public TopDocs Hits { get; private set; }
+        /// <summary>
+        /// Hits.
+        /// </summary>
+        public TopDocs Hits { get; private set; }
 
-            /// <summary>
-            /// Sole constructor.
-            /// </summary>
-            public DrillSidewaysResult(Facets facets, TopDocs hits)
-            {
-                this.Facets = facets;
-                this.Hits = hits;
-            }
+        /// <summary>
+        /// Sole constructor.
+        /// </summary>
+        public DrillSidewaysResult(Facets facets, TopDocs hits)
+        {
+            this.Facets = facets;
+            this.Hits = hits;
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/21522f37/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
index 5f70626..5495ecb 100644
--- a/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
+++ b/src/Lucene.Net.Tests.Facet/Range/TestRangeFacetCounts.cs
@@ -37,7 +37,7 @@ namespace Lucene.Net.Facet.Range
     using SingleField = Lucene.Net.Documents.SingleField;
     using Int64Field = Lucene.Net.Documents.Int64Field;
     using NumericDocValuesField = Lucene.Net.Documents.NumericDocValuesField;
-    using DrillSidewaysResult = Lucene.Net.Facet.DrillSideways.DrillSidewaysResult;
+    using DrillSidewaysResult = Lucene.Net.Facet.DrillSidewaysResult;
     using TaxonomyReader = Lucene.Net.Facet.Taxonomy.TaxonomyReader;
     using DirectoryTaxonomyReader = Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyReader;
     using DirectoryTaxonomyWriter = Lucene.Net.Facet.Taxonomy.Directory.DirectoryTaxonomyWriter;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/21522f37/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
index 95f9b01..068f62b 100644
--- a/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
+++ b/src/Lucene.Net.Tests.Facet/TestDrillSideways.cs
@@ -31,7 +31,6 @@ namespace Lucene.Net.Facet
     using Document = Lucene.Net.Documents.Document;
     using Field = Lucene.Net.Documents.Field;
     using StringField = Lucene.Net.Documents.StringField;
-    using DrillSidewaysResult = Lucene.Net.Facet.DrillSideways.DrillSidewaysResult;
     using DefaultSortedSetDocValuesReaderState = Lucene.Net.Facet.SortedSet.DefaultSortedSetDocValuesReaderState;
     using SortedSetDocValuesFacetField = Lucene.Net.Facet.SortedSet.SortedSetDocValuesFacetField;
     using SortedSetDocValuesReaderState = Lucene.Net.Facet.SortedSet.SortedSetDocValuesReaderState;


[06/10] lucenenet git commit: Lucene.Net.Facet: Added extension methods to Document class for adding facet-related Field types

Posted by ni...@apache.org.
Lucene.Net.Facet: Added extension methods to Document class for adding facet-related Field types


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a032177a
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a032177a
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a032177a

Branch: refs/heads/master
Commit: a032177a1a300d01df1fbe28766c56b4aeec21ad
Parents: 62c6407
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Oct 5 00:29:23 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Oct 5 03:49:22 2017 +0700

----------------------------------------------------------------------
 .../Facet/AssociationsFacetsExample.cs          |  13 +--
 .../Support/Document/DocumentExtensions.cs      | 111 +++++++++++++++++++
 2 files changed, 117 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a032177a/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs b/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs
index f3649d0..1641bf1 100644
--- a/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs
+++ b/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs
@@ -76,21 +76,20 @@ namespace Lucene.Net.Demo.Facet
                 Document doc = new Document();
                 // 3 occurrences for tag 'lucene'
 
-                // LUCENENET TODO: Create extension methods for built-in field types ( .AddFacetField("", ""), .AddInt32AssociationsFacetField(), etc ).
-                doc.Add(new Int32AssociationFacetField(3, "tags", "lucene"));
+                doc.AddInt32AssociationFacetField(3, "tags", "lucene");
                 // 87% confidence level of genre 'computing'
-                doc.Add(new SingleAssociationFacetField(0.87f, "genre", "computing"));
+                doc.AddSingleAssociationFacetField(0.87f, "genre", "computing");
                 indexWriter.AddDocument(config.Build(taxoWriter, doc));
 
                 doc = new Document();
                 // 1 occurrence for tag 'lucene'
-                doc.Add(new Int32AssociationFacetField(1, "tags", "lucene"));
+                doc.AddInt32AssociationFacetField(1, "tags", "lucene");
                 // 2 occurrence for tag 'solr'
-                doc.Add(new Int32AssociationFacetField(2, "tags", "solr"));
+                doc.AddInt32AssociationFacetField(2, "tags", "solr");
                 // 75% confidence level of genre 'computing'
-                doc.Add(new SingleAssociationFacetField(0.75f, "genre", "computing"));
+                doc.AddSingleAssociationFacetField(0.75f, "genre", "computing");
                 // 34% confidence level of genre 'software'
-                doc.Add(new SingleAssociationFacetField(0.34f, "genre", "software"));
+                doc.AddSingleAssociationFacetField(0.34f, "genre", "software");
                 indexWriter.AddDocument(config.Build(taxoWriter, doc));
 
             } // Disposes indexWriter and taxoWriter

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a032177a/src/Lucene.Net.Facet/Support/Document/DocumentExtensions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Support/Document/DocumentExtensions.cs b/src/Lucene.Net.Facet/Support/Document/DocumentExtensions.cs
new file mode 100644
index 0000000..3ce202e
--- /dev/null
+++ b/src/Lucene.Net.Facet/Support/Document/DocumentExtensions.cs
@@ -0,0 +1,111 @@
+using Lucene.Net.Facet;
+using Lucene.Net.Facet.SortedSet;
+using Lucene.Net.Facet.Taxonomy;
+using Lucene.Net.Util;
+
+namespace Lucene.Net.Documents
+{
+    /*
+     * 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.
+     */
+
+    /// <summary>
+    /// LUCENENET specific extensions to the <see cref="Document"/> class.
+    /// </summary>
+    public static class DocumentExtensions
+    {
+        /// <summary>
+        /// Adds a new <see cref="SortedSetDocValuesFacetField"/>.
+        /// </summary>
+        /// <remarks>
+        /// Add a <see cref="SortedSetDocValuesFacetField"/> to your <see cref="Documents.Document"/> for every facet
+        /// label to be indexed via <see cref="Index.SortedSetDocValues"/>. 
+        /// </remarks>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="dim">Dimension for this field.</param>
+        /// <param name="label">Label for this field.</param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        public static SortedSetDocValuesFacetField AddSortedSetDocValuesFacetField(this Document document, string dim, string label)
+        {
+            var field = new SortedSetDocValuesFacetField(dim, label);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="AssociationFacetField"/> using <paramref name="dim"/> and <paramref name="path"/> and an
+        /// association.
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="assoc">Associated value.</param>
+        /// <param name="dim">Dimension for this field.</param>
+        /// <param name="path">Facet path for this field.</param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        public static AssociationFacetField AddAssociationFacetField(this Document document, BytesRef assoc, string dim, params string[] path)
+        {
+            var field = new AssociationFacetField(assoc, dim, path);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="Int32AssociationFacetField"/> using <paramref name="dim"/> and <paramref name="path"/> and an
+        /// <see cref="int"/> association.
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="assoc">Associated value.</param>
+        /// <param name="dim">Dimension for this field.</param>
+        /// <param name="path">Facet path for this field.</param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        public static Int32AssociationFacetField AddInt32AssociationFacetField(this Document document, int assoc, string dim, params string[] path)
+        {
+            var field = new Int32AssociationFacetField(assoc, dim, path);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="SingleAssociationFacetField"/> using <paramref name="dim"/> and <paramref name="path"/> and a
+        /// <see cref="float"/> association.
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="assoc">Associated value.</param>
+        /// <param name="dim">Dimension for this field.</param>
+        /// <param name="path">Facet path for this field.</param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        public static SingleAssociationFacetField AddSingleAssociationFacetField(this Document document, float assoc, string dim, params string[] path)
+        {
+            var field = new SingleAssociationFacetField(assoc, dim, path);
+            document.Add(field);
+            return field;
+        }
+
+        /// <summary>
+        /// Adds a new <see cref="FacetField"/> with the specified <paramref name="dim"/> and
+        /// <paramref name="path"/>. 
+        /// </summary>
+        /// <param name="document">This <see cref="Document"/>.</param>
+        /// <param name="dim">Dimension for this field.</param>
+        /// <param name="path">Facet path for this field.</param>
+        /// <returns>The field that was added to this <see cref="Document"/>.</returns>
+        public static FacetField AddFacetField(this Document document, string dim, params string[] path)
+        {
+            var field = new FacetField(dim, path);
+            document.Add(field);
+            return field;
+        }
+    }
+}


[03/10] lucenenet git commit: Lucene.Net.Benchmark.ByTask.Tasks.AnalyzerFactory: Changed setter methods into properties and made PositionIncrementGap and OffsetGap nullable (so they can be used in the initializer).

Posted by ni...@apache.org.
Lucene.Net.Benchmark.ByTask.Tasks.AnalyzerFactory: Changed setter methods into properties and made PositionIncrementGap and OffsetGap nullable (so they can be used in the initializer).


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/5406340d
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/5406340d
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/5406340d

Branch: refs/heads/master
Commit: 5406340ddf02ddce592df7e0dacc52217117f993
Parents: 869d1dd
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Wed Oct 4 23:29:40 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Wed Oct 4 23:29:40 2017 +0700

----------------------------------------------------------------------
 .../ByTask/Tasks/AnalyzerFactoryTask.cs         |  9 +++--
 .../ByTask/Utils/AnalyzerFactory.cs             | 42 +++++++-------------
 2 files changed, 19 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5406340d/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs
index 61d1832..3f0f60d 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs
@@ -356,10 +356,11 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks
                 }
             }
 
-            AnalyzerFactory analyzerFactory = new AnalyzerFactory
-                (charFilterFactories, tokenizerFactory, tokenFilterFactories);
-            analyzerFactory.SetPositionIncrementGap(positionIncrementGap.GetValueOrDefault());
-            analyzerFactory.SetOffsetGap(offsetGap.GetValueOrDefault());
+            AnalyzerFactory analyzerFactory = new AnalyzerFactory(charFilterFactories, tokenizerFactory, tokenFilterFactories)
+            {
+                PositionIncrementGap = positionIncrementGap,
+                OffsetGap = offsetGap
+            };
             RunData.AnalyzerFactories[factoryName] = analyzerFactory;
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/5406340d/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs b/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs
index 63c17cb..28a3ff6 100644
--- a/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/Utils/AnalyzerFactory.cs
@@ -33,9 +33,9 @@ namespace Lucene.Net.Benchmarks.ByTask.Utils
         private IList<CharFilterFactory> charFilterFactories;
         private TokenizerFactory tokenizerFactory;
         private IList<TokenFilterFactory> tokenFilterFactories;
-        private string name = null;
-        private int? positionIncrementGap = null;
-        private int? offsetGap = null;
+        public string Name { get; set; } = null;
+        public int? PositionIncrementGap { get; set; } = null;
+        public int? OffsetGap { get; set; } = null;
 
         public AnalyzerFactory(IList<CharFilterFactory> charFilterFactories,
                                TokenizerFactory tokenizerFactory,
@@ -47,21 +47,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Utils
             this.tokenFilterFactories = tokenFilterFactories;
         }
 
-        // LUCENENET TODO: Properties ?
-        public void SetName(string name)
-        {
-            this.name = name;
-        }
-
-        public void SetPositionIncrementGap(int positionIncrementGap) // LUCENENET TODO: Nullable?
-        {
-            this.positionIncrementGap = positionIncrementGap;
-        }
-
-        public void SetOffsetGap(int offsetGap) // LUCENENET TODO: Nullable?
-        {
-            this.offsetGap = offsetGap;
-        }
+        // LUCENENET specific - made Name, PositionIncrementGap, and OffsetGap setters into properties (above)
 
         public Analyzer Create()
         {
@@ -104,15 +90,15 @@ namespace Lucene.Net.Benchmarks.ByTask.Utils
 
             public override int GetPositionIncrementGap(string fieldName)
             {
-                return outerInstance.positionIncrementGap.HasValue
-                    ? outerInstance.positionIncrementGap.Value
+                return outerInstance.PositionIncrementGap.HasValue
+                    ? outerInstance.PositionIncrementGap.Value
                     : base.GetPositionIncrementGap(fieldName);
             }
 
             public override int GetOffsetGap(string fieldName)
             {
-                return outerInstance.offsetGap.HasValue
-                    ? outerInstance.offsetGap.Value
+                return outerInstance.OffsetGap.HasValue
+                    ? outerInstance.OffsetGap.Value
                     : base.GetOffsetGap(fieldName);
             }
         }
@@ -120,22 +106,22 @@ namespace Lucene.Net.Benchmarks.ByTask.Utils
         public override string ToString()
         {
             StringBuilder sb = new StringBuilder("AnalyzerFactory(");
-            if (null != name)
+            if (null != Name)
             {
                 sb.Append("name:");
-                sb.Append(name);
+                sb.Append(Name);
                 sb.Append(", ");
             }
-            if (null != positionIncrementGap)
+            if (null != PositionIncrementGap)
             {
                 sb.Append("positionIncrementGap:");
-                sb.Append(positionIncrementGap);
+                sb.Append(PositionIncrementGap);
                 sb.Append(", ");
             }
-            if (null != offsetGap)
+            if (null != OffsetGap)
             {
                 sb.Append("offsetGap:");
-                sb.Append(offsetGap);
+                sb.Append(OffsetGap);
                 sb.Append(", ");
             }
             foreach (CharFilterFactory charFilterFactory in charFilterFactories)


[04/10] lucenenet git commit: Lucene.Net.Benchmark.ByTask.PerfRunData: Reviewed and removed TODO

Posted by ni...@apache.org.
Lucene.Net.Benchmark.ByTask.PerfRunData: Reviewed and removed TODO


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/39fdf800
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/39fdf800
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/39fdf800

Branch: refs/heads/master
Commit: 39fdf8009bf37d8b2d8c8942e0aa86e132e54dbf
Parents: 5406340
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Wed Oct 4 23:37:37 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Wed Oct 4 23:37:37 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/39fdf800/src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs b/src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs
index c31bff4..8a25b03 100644
--- a/src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs
+++ b/src/Lucene.Net.Benchmark/ByTask/PerfRunData.cs
@@ -428,7 +428,7 @@ namespace Lucene.Net.Benchmarks.ByTask
         /// <summary>
         /// Gets or sets the culture.
         /// </summary>
-        public virtual CultureInfo Locale // LUCENENET TODO: API Is this really needed since we have on the thread already?
+        public virtual CultureInfo Locale
         {
             get { return locale; }
             set { locale = value; }


[05/10] lucenenet git commit: Lucene.Net.Facet.Taxonomy: Fixed documentation and ToString() method of Field subclasses

Posted by ni...@apache.org.
Lucene.Net.Facet.Taxonomy: Fixed documentation and ToString() method of Field subclasses


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/62c64075
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/62c64075
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/62c64075

Branch: refs/heads/master
Commit: 62c64075ca750d104f675b03560b41125aaf80f3
Parents: 39fdf80
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Thu Oct 5 00:27:23 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Thu Oct 5 00:27:23 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs      | 4 ++--
 src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs | 6 +++---
 src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs   | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/62c64075/src/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs b/src/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
index 5085ea1..0097278 100644
--- a/src/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/AssociationFacetField.cs
@@ -32,8 +32,8 @@ namespace Lucene.Net.Facet.Taxonomy
     /// implementation at search time; see <see cref="Int32AssociationFacetField"/> 
     /// and <see cref="SingleAssociationFacetField"/> to use existing 
     /// <see cref="Facets"/> implementations.
-    /// 
-    ///  @lucene.experimental 
+    /// <para/>
+    /// @lucene.experimental 
     /// </summary>
     public class AssociationFacetField : Field
     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/62c64075/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs b/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
index eb54233..ec2da0f 100644
--- a/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/FloatAssociationFacetField.cs
@@ -29,8 +29,8 @@ namespace Lucene.Net.Facet.Taxonomy
     /// to aggregate <see cref="float"/> values per facet label at search time.
     /// <para/>
     /// NOTE: This was FloatAssociationFacetField in Lucene
-    /// 
-    ///  @lucene.experimental 
+    /// <para/>
+    /// @lucene.experimental 
     /// </summary>
     public class SingleAssociationFacetField : AssociationFacetField
     {
@@ -65,7 +65,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
         public override string ToString()
         {
-            return "FloatAssociationFacetField(dim=" + Dim + " path=" + Arrays.ToString(Path) + 
+            return "SingleAssociationFacetField(dim=" + Dim + " path=" + Arrays.ToString(Path) + 
                 " value=" + BytesRefToSingle(Assoc).ToString("0.0#####", CultureInfo.InvariantCulture) + ")";
         }
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/62c64075/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs b/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
index c657976..9e13e03 100644
--- a/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
+++ b/src/Lucene.Net.Facet/Taxonomy/IntAssociationFacetField.cs
@@ -28,8 +28,8 @@ namespace Lucene.Net.Facet.Taxonomy
     /// to aggregate int values per facet label at search time.
     /// <para/>
     /// NOTE: This was IntAssociationFacetField in Lucene
-    /// 
-    ///  @lucene.experimental 
+    /// <para/>
+    /// @lucene.experimental 
     /// </summary>
     public class Int32AssociationFacetField : AssociationFacetField
     {
@@ -72,7 +72,7 @@ namespace Lucene.Net.Facet.Taxonomy
 
         public override string ToString()
         {
-            return "IntAssociationFacetField(dim=" + Dim + " path=" + Arrays.ToString(Path) + " value=" + BytesRefToInt32(Assoc) + ")";
+            return "Int32AssociationFacetField(dim=" + Dim + " path=" + Arrays.ToString(Path) + " value=" + BytesRefToInt32(Assoc) + ")";
         }
     }
 }
\ No newline at end of file