Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-12697 Add pure DocValues support to FieldValueFeature #123
SOLR-12697 Add pure DocValues support to FieldValueFeature #123
Changes from 9 commits
2ee8779
bdce029
e6601ee
d6e1477
5bc995c
4559415
ec4cbfb
e6f20f1
f16ce3d
e5954eb
da6a635
b105627
e07c432
443a396
2dbd94e
9b77154
c1f3a8e
3c38e91
53cd2fb
e854f50
b9d3cd0
da57e9c
abb3632
a789b12
c42be54
83bc1ee
385d8b2
4348d04
ad489d0
2c3a368
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1/2 So I was trying to learn and understand better w.r.t. why the
intBitsToFloat
andlongBitsToDouble
are the conversions to use here and that led to https://github.com/apache/lucene-solr/blob/releases/lucene-solr/8.8.2/solr/core/src/java/org/apache/solr/search/SolrDocumentFetcher.java#L603-L644 and the realisation thatDATE
is anumberType
possibility!Would you have any thoughts on using a
switch
statement here with FLOAT/DOUBLE/INT/LONG all valid and to throw an exception for anything else ...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat strangely so perhaps the use of
DATE
fields "just works" for both the existing stored and the new docValues implementations. I've added aTestFieldValueFeature.testThatDateValuesAreCorrectlyParsed
test to demonstrate that and so then no need to change the implementation here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm... the date being a numeric type really is quite unintuitive.
I am not really fond of copying the switch-logic that you referenced, but sadly the method is private. :/
I will go and make a tea and then look into that.
Thank you for adding the test for the date field. The new clarity on what value is returned for the date type is very good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh... Thanks github for not refreshing the page... 🙄
After looking into that I saw the same behavior as you did and was just about to comment that. :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise, I would have preferred for there to be some existing reusable method and was surprised that there isn't one (or not an obviously findable one). The
SolrDocumentFetcher
one has thesortableNumeric
flag (which we don't need here) and some special logic forLatLonPointSpatialField
andAbstractEnumField
scenarios (also not applicable here) ... otherwise it would have been a clear "okay, let's factor out a method here and put it somewhere that both SolrDocumentFeature and FieldValueFeature can use it" kind of scenario. Oh well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
observation: via the
docValues="${solr.tests.numeric.dv}"
in the<fieldType name="int" ...
andpopularity
being used in theTestFieldValueFeature
we have some existing test coverage for doc values.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a commit with additional
TestFieldValueFeature
coverage, for the numeric fields only so far i.e.dvStrNumPopularity
anddvStrBoolPopularity
not yet.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
observation:
copyField
here works for thedv*Popularity
fields but thedv(Int|Long|Float|Double)Field
fields cannot use it since the defaulting logic and the popularity/10 logic is happening there.