-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Make date parsing more flexible for linedocsfile (europarl, enwiki) #13075
Conversation
This makes date parsing accept both europarl and enwiki. The tests still assume the docs come from europarl though and fail on the large enwiki.random.lines.txt:
|
…another plain term query right below it (body:the) so I don't think it hurts much. apache#13073
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.
Looks fine. Why did you create a Function<String,LocalDateTime>
for parsing instead of a simple static method? I think you did this to hide the formatter instances?
...rd-codecs/src/test/org/apache/lucene/backward_index/TestIndexSortBackwardsCompatibility.java
Outdated
Show resolved
Hide resolved
P.S.: Maybe add a quick test for the parsing logic to check that both formats are accepted. |
Yes, correct. |
Maybe it'd be better to move this logic into LineFileDocs so that the date field's value is normalized somehow? Then we can add TestLineFileDocs and test it there. Adding a test method to TestIndexSortBackwardsCompatibility will multiply it over all the parameters, which doesn't make sense. |
… case to TestLineFileDocs
I've moved that utility function to LineFileDocs and added a basic test case to TestLineFileDocs (good idea). I feel tempted to normalize the date field's value in LineFileDocs but this may break other stuff so better to leave it for a follow-up issue. |
I'll merge this in so that we can avoid jenkins failures. If there has to be a follow-up, I'll open another issue. |
LGTM thanks |
Fixes #13073.