NightOwl888 opened a new issue #407: URL: https://github.com/apache/lucenenet/issues/407
To make adding fields more discoverable via Intellisense, we have already created extension methods for "normal" field types [here](https://github.com/apache/lucenenet/tree/ae13dc4dfe0b8a2d305b9f8f860ac0849a16ac80/src/Lucene.Net/Support/Document/Extensions). However, we still need extension methods for facet field types defined within `Lucene.Net.Facet` to make the API consistent. ## Proposed API ```c# namespace Lucene.Net.Documents.Extensions { public static class DocumentExtensions // Check to ensure the name doesn't collide with that in the Lucene.Net assembly, rename to DocumentFacetExtensions if necessary { public static FacetField AddFacetField(this document, string dim, params string[] path); public static SortedSetDocValuesFacetField AddSortedSetDocValuesFacetField(this document, string dim, string label); public static Int32AssociationFacetField AddInt32AssociationFacetField(this document, int assoc, string dim, params string[] path); public static SingleAssociationFacetField AddSingleAssociationFacetField(this document, float assoc, string dim, params string[] path); } } ``` ## Unit Tests In addition, there are currently no tests for these extension methods, as the tests are using the existing Java API syntax. We should set up some basic unit tests to ensure the correct field type is added to a `Document` with the correct values and returned from the extension method correctly (both for the original extension methods and for the new facet extension methods). ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
