You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make adding fields more discoverable via Intellisense, we have already created extension methods for "normal" field types here. However, we still need extension methods for facet field types defined within Lucene.Net.Facet to make the API consistent.
Proposed API
namespaceLucene.Net.Documents.Extensions{publicstaticclassDocumentExtensions// Check to ensure the name doesn't collide with that in the Lucene.Net assembly, rename to DocumentFacetExtensions if necessary{publicstaticFacetFieldAddFacetField(thisdocument,stringdim,paramsstring[]path);publicstaticSortedSetDocValuesFacetFieldAddSortedSetDocValuesFacetField(thisdocument,stringdim,stringlabel);publicstaticAssociationFacetFieldAddAssociationFacetField(thisdocument,BytesRefassoc,stringdim,paramsstring[]path);publicstaticInt32AssociationFacetFieldAddInt32AssociationFacetField(thisdocument,intassoc,stringdim,paramsstring[]path);publicstaticSingleAssociationFacetFieldAddSingleAssociationFacetField(thisdocument,floatassoc,stringdim,paramsstring[]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).
The text was updated successfully, but these errors were encountered:
…xtensions namespace. Added tests for DocumentExtensions in Lucene.Net.Tests._J-S, Lucene.Net.Tests.ICU and Lucene.Net.Tests.Facet. Added guard clauses and updated documentation of Document extension methods and some related fields. Closesapache#407.
…xtensions namespace. Added tests for DocumentExtensions in Lucene.Net.Tests._J-S, Lucene.Net.Tests.ICU and Lucene.Net.Tests.Facet. Added guard clauses and updated documentation of Document extension methods and some related fields. Closesapache#407.
It turns out these extension methods already existed, but they were in in the Lucene.Net.Documents namespace so I missed them in Intellisense. So, #468 moves them to the correct namespace Lucene.Net.Documents.Extensions and adds tests to close this issue.
…xtensions namespace. Added tests for DocumentExtensions in Lucene.Net.Tests._J-S, Lucene.Net.Tests.ICU and Lucene.Net.Tests.Facet. Added guard clauses and updated documentation of Document extension methods and some related fields. Closes#407.
Just bumped into this breaking change but it makes perfect sense these were moved into an Lucene.Net.Documents.Extension.DocumentExtensions class. And thankfully in Visual Studio, ctl + . makes it so easy to find the new namespace that needs added to a project to access these extension methods.
To make adding fields more discoverable via Intellisense, we have already created extension methods for "normal" field types here. However, we still need extension methods for facet field types defined within
Lucene.Net.Facet
to make the API consistent.Proposed API
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).The text was updated successfully, but these errors were encountered: