ilariapet opened a new pull request, #1487:
URL: https://github.com/apache/solr/pull/1487

   https://issues.apache.org/jira/browse/SOLR-15493
   https://issues.apache.org/jira/browse/SOLR-15494
   <!--
   _(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
   
   When a wrong/non-existent feature store name is passed to the query for 
feature extraction, an empty list is returned;
   it also happens when inspecting the contents of a non-existent feature 
store. It would be helpful if a message was returned indicating that the 
feature store I am calling is not present.
   Also, this non-existent (and empty) feature store is inappropriately added 
to the feature store list and only disappears after the collection is reloaded.
   This contribution wants to add the ability to throw an exception when a 
non-existent feature store name is passed and thus wants to prevent it from 
being inappropriately added to the feature store list.
   
   # Solution
   
   A check for a non-existent feature store was added in the doGet method of 
the _ManagedFeatureStore.java_ class, throwing a Solr exception.
   
   Also, a getter method of the "stores" variable was added in the 
_ManagedFeatureStore.java_ class and used to throw the exception during the 
feature extraction (logging phase) if the passed feature store is missing from 
the store list.
   In this phase, there is the need to differentiate between the two cases 
where no feature store name is passed (i.e., it is null):
   If a reranking query (qr) is not passed, it means the model name is not 
passed either, so the only feature store that could be used is the default 
feature store (which should not be empty, otherwise an error is thrown).
   On the other hand, if a reranking query is passed, it means that a model 
name has been specified, so a temporarily empty feature store is created to 
later add features in the implTransform() method, using the methods of the 
FeatureLogger class.
   
   # Tests
   
   Here are the tests that have been added to test the new capability.
   
   To verify that an Exception is thrown when a non-existent feature store is 
passed to the query (with fl parameter) 3 tests have been added in 
_solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFeatureLogging.java_:
   
   - _featureExtraction_NonExistentFeatureStore_shouldThrowException_
   - _featureExtraction_NonExistentFeatureStoreReRanking_shouldThrowException_
   - _featureExtraction_NoFeatureAndModelStore_shouldThrowException_
   
   To verify that an Exception is thrown when trying to get a missing feature 
store and that this feature store is not inappropriately added to the feature 
store list, some tests in 
solr/modules/ltr/src/test/org/apache/solr/ltr/store/rest/TestModelManagerPersistence.java
 have been modified.
   # 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.
   - [X] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to