You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "potenzal (via GitHub)" <gi...@apache.org> on 2023/04/20 14:19:15 UTC
[GitHub] [solr] potenzal opened a new pull request, #1578: SOLR-16756: SchemaCodecFactory, add test coverage for getKnnVectorsFormatForField
potenzal opened a new pull request, #1578:
URL: https://github.com/apache/solr/pull/1578
https://issues.apache.org/jira/browse/SOLR-16756
<!--
_(If you are a project committer then you may remove some/all of the following template.)_
Before creating a pull request, please file an issue in the ASF Jira system for Solr:
* https://issues.apache.org/jira/projects/SOLR
For something minor (i.e. that wouldn't be worth putting in release notes), you can skip JIRA.
To create a Jira issue, you will need to create an account there first.
The title of the PR should reference the Jira issue number in the form:
* SOLR-####: <short description of problem or changes>
SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
# Description
The getKnnVectorsFormatForField() override in SchemaCodecFactory doesn't seem to be covered by any of the existing tests.
Adding basic test points could be useful to detect future regressions, similar to the recent https://issues.apache.org/jira/browse/SOLR-16588
# Solution
Added testKnnVectorsFormat() and testUnsupportedKnnVectorsFormat() to the existing TestCodecSupport
# Tests
The tests provide a basic coverage of both branches. I believe that testKnnVectorsFormat would have detected SOLR-16588
# Checklist
Please review the following and check all that apply:
- [X] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
- [X] I have created a Jira issue and added the issue ID to my pull request title.
- [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
- [X] I have developed this patch against the `main` branch.
- [X] I have run `./gradlew check`.
- [X] I have added tests for my changes.
- [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] potenzal commented on a diff in pull request #1578: SOLR-16756: SchemaCodecFactory, add test coverage for getKnnVectorsFormatForField
Posted by "potenzal (via GitHub)" <gi...@apache.org>.
potenzal commented on code in PR #1578:
URL: https://github.com/apache/solr/pull/1578#discussion_r1257323413
##########
solr/core/src/test/org/apache/solr/core/TestCodecSupport.java:
##########
@@ -265,4 +266,27 @@ public void testCompressionModeDefault() throws IOException {
coreContainer.unload(newCoreName);
}
}
+
+ public void testKnnVectorsFormat() {
+ Codec codec = h.getCore().getCodec();
+ Map<String, SchemaField> fields = h.getCore().getLatestSchema().getFields();
+ SchemaField schemaField = fields.get("vector");
+
+ PerFieldKnnVectorsFormat format = (PerFieldKnnVectorsFormat) codec.knnVectorsFormat();
+ assertEquals(
+ "Lucene95HnswVectorsFormat",
Review Comment:
Makes sense, thanks!
I have just replaced class.getName() with class.getSimpleName() to get rid of the full package info.
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
Re: [PR] SOLR-16756: SchemaCodecFactory, add test coverage for getKnnVectorsFormatForField [solr]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #1578:
URL: https://github.com/apache/solr/pull/1578#issuecomment-1947529662
This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the dev@solr.apache.org mailing list. Thank you for your contribution!
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] cpoerschke commented on a diff in pull request #1578: SOLR-16756: SchemaCodecFactory, add test coverage for getKnnVectorsFormatForField
Posted by "cpoerschke (via GitHub)" <gi...@apache.org>.
cpoerschke commented on code in PR #1578:
URL: https://github.com/apache/solr/pull/1578#discussion_r1255666294
##########
solr/core/src/test/org/apache/solr/core/TestCodecSupport.java:
##########
@@ -265,4 +266,27 @@ public void testCompressionModeDefault() throws IOException {
coreContainer.unload(newCoreName);
}
}
+
+ public void testKnnVectorsFormat() {
+ Codec codec = h.getCore().getCodec();
+ Map<String, SchemaField> fields = h.getCore().getLatestSchema().getFields();
+ SchemaField schemaField = fields.get("vector");
+
+ PerFieldKnnVectorsFormat format = (PerFieldKnnVectorsFormat) codec.knnVectorsFormat();
+ assertEquals(
+ "Lucene95HnswVectorsFormat",
Review Comment:
minor: perhaps something like this could result in a compile-time rather than test-run breakage when `Lucene95HnswVectorsFormat` becomes `Lucene98HnswVectorsFormat` or so in a future Lucene version upgrade?
```suggestion
Lucene95HnswVectorsFormat.class.getName(),
```
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org
[GitHub] [solr] potenzal commented on pull request #1578: SOLR-16756: SchemaCodecFactory, add test coverage for getKnnVectorsFormatForField
Posted by "potenzal (via GitHub)" <gi...@apache.org>.
potenzal commented on PR #1578:
URL: https://github.com/apache/solr/pull/1578#issuecomment-1542219038
@alessandrobenedetti since you were involved in the fix to SOLR-16588, I was wondering what you thoughts are on adding this simple regression test, any flags/suggestions to improve it?
--
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: issues-unsubscribe@solr.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org