NightOwl888 commented on code in PR #1058:
URL: https://github.com/apache/lucenenet/pull/1058#discussion_r1997476884
##########
src/Lucene.Net.Spatial/Prefix/PrefixTreeStrategy.cs:
##########
@@ -157,17 +158,28 @@ public virtual Field[] CreateIndexableFields(IShape?
shape, double distErr)
IndexOptions = IndexOptions.DOCS_ONLY
}.Freeze();
- /// <summary>Outputs the tokenString of a cell, and if its a leaf,
outputs it again with the leaf byte.</summary>
+ /// <summary>
+ /// Outputs the tokenString of a cell, and if its a leaf, outputs it
again with the leaf byte.
+ /// </summary>
+ /// <remarks>
+ /// LUCENENET specific - This class originally took an enumerator,
which meant that it could not
+ /// be reused (since most IEnumerator implementations can only be
iterated once and throw on
Review Comment:
On another pass of this, I noticed that the `CellTokenStream` is internal.
So, the question here is whether or not the `Field[]` returned from
`CreateIndexableFields` is reusable. It is passed a `JCG.List<T>` from
`SpatialPrefixTree.GetCells()`, which supports `Reset()`. The only way to
change that is to create a custom subclass of `SpatialPrefixTree` to override
it. It seems like a minor thing to restrict this to only implementations of
`IEnumerable<T>` that support `Reset()` here, given that the user would have to
go out of their way to change it to something that does not.
What's the downside? The user passes an `IList<T>` that doesn't support
`Reset()` and it fails upon reuse. But in Lucene it would have failed upon
reuse, anyway.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]