Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-15440: FieldValueFeature now uses DocValues when docValues=true and stored=true are combined. #1883

Merged
merged 10 commits into from
Sep 15, 2023

Conversation

cpoerschke
Copy link
Contributor

@cpoerschke
Copy link
Contributor Author

This builds on the #123 changes, so tagging both @tomglk and @alessandrobenedetti as potential reviewers, thank you!

@tomglk
Copy link
Contributor

tomglk commented Sep 7, 2023

Hi @cpoerschke ,

thank you for continuing the work here!

The use of useDocValuesForStored to switch between the behaviours looks good to me, it seems concise.
As for my understanding you plan to remove the LegacyFieldValueFeature and useDocValuesForStored in 9.X or 10, correct?

Looking at the code, I think that people would have to copy quite a bit of code if they want to still use the legacy behaviour if useDocValuesForStored is gone. But I think that's fine.
As long as all the FieldValueFeatures are separated from each other and we do not have the prefetching, the DocValues approach is most efficient, I think.

I refactored the tests a bit, to make it easier to see what test_storedDvIsTrendy_FieldValueFeatureScorer_className_differs wants to test and added some helper functions for testThatCorrectFieldValueFeatureIsUsedForDocValueTypes to (subjectively) improve readability.

What do you think about those changes?

Other than that all good for me. :)

@cpoerschke
Copy link
Contributor Author

Hi @tomgl - thank you very much for your inputs!

As for my understanding you plan to remove the LegacyFieldValueFeature and useDocValuesForStored in 9.X or 10, correct?

Yes, the plan is to remove LegacyFieldValueFeature in a future version and the plan was to remove useDocValuesForStored too, however ...

Looking at the code, I think that people would have to copy quite a bit of code if they want to still use the legacy behaviour if useDocValuesForStored is gone. ...

You raise a good point w.r.t. useDocValuesForStored removal being restrictive and actually retaining it adds near-zero code complexity and would facilitate anyone's custom retention of the legacy behaviour. And perhaps even a protected flag is clearer than a variant FieldValueFeature constructor? So 31eff54 is to retain the flag then.

I refactored the tests a bit, to make it easier to see what test_storedDvIsTrendy_FieldValueFeatureScorer_className_differs wants to test and added some helper functions for testThatCorrectFieldValueFeatureIsUsedForDocValueTypes to (subjectively) improve readability.

Thanks for that! Have added it to the branch and built on it with the 1a5b7b7 commit - WDYT?

@cpoerschke
Copy link
Contributor Author

https://lists.apache.org/thread/ybmp5xz3c9549opqgktdb4cxlpmdmwy4 (I think) is the dev list thread w.r.t. Crave.io CI patch application.

@tomglk
Copy link
Contributor

tomglk commented Sep 9, 2023

I agree to your reasoning and like your changes in 31eff54 !

Moving the setup of doc 21 into the helper function makes total sense. :)

The assert for the used scorer is a bit hidden now. I fear that for others it would not be obvious at first glance what the tests want to test.
I moved it out of the helper function in ffea1a8.
Does that make sense to you?

@cpoerschke
Copy link
Contributor Author

The assert for the used scorer is a bit hidden now. I fear that for others it would not be obvious at first glance what the tests want to test. ...

Yes, I agree that the assert in the helper method reduces test comprehension, and also the extra expectedUsedScorerClass parameter seemed a bit tedious.

cf1ed8f builds on your change i.e. the assert is moved but the ObservingFieldValueFeature.usedScorerClass reading is retained near the ObservingFieldValueFeature.usedScorerClass = null clearing - WDYT?

@tomglk
Copy link
Contributor

tomglk commented Sep 11, 2023

Oh yes, keeping the reading near the clearing is a good call. Nice!

I like it and do not see any more todos. :)

Resolved Conflicts:
	solr/CHANGES.txt
	solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
@cpoerschke
Copy link
Contributor Author

https://lists.apache.org/thread/ybmp5xz3c9549opqgktdb4cxlpmdmwy4 (I think) is the dev list thread w.r.t. Crave.io CI patch application.

./gradlew -p solr/modules/ltr test passes locally.

@cpoerschke cpoerschke merged commit a52c849 into apache:main Sep 15, 2023
@cpoerschke cpoerschke deleted the SOLR-15440 branch September 15, 2023 11:32
asfgit pushed a commit that referenced this pull request Sep 15, 2023
…and stored=true are combined. (#1883)

Co-authored-by: tomglk <>
(cherry picked from commit a52c849)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants