-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fixing fulltext search wit h_lastUpdated filter #6411
base: master
Are you sure you want to change the base?
Conversation
* Contained bug * more tests * changelog, tests, implementation * code review * backwards logic
Formatting check succeeded! |
...rc/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/6404-fulltext-search-with-lastupdate.yaml
Show resolved
Hide resolved
hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_6_0/upgrade.md
Outdated
Show resolved
Hide resolved
...ir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchSearchBuilder.java
Show resolved
Hide resolved
...ir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchSearchBuilder.java
Show resolved
Hide resolved
...ir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/ExtendedHSearchSearchBuilder.java
Show resolved
Hide resolved
hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSearchDaoR4Test.java
Outdated
Show resolved
Hide resolved
hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirSearchDaoR4Test.java
Outdated
Show resolved
Hide resolved
# Fulltext Search with _lastUpdated Filter | ||
|
||
Fulltext searches have been updated to support `_lastUpdated` search parameter. A reindexing of Search Parameters | ||
is required to migrate old data to support the `_lastUpdated` search parameter. |
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.
This should be expanded to clarify under what exact conditions it would be necessary to do this, since requiring a reindex of all of your data is a huge ask.. Presumably this only matters if XXX is set to YYY and you are intending to perform a search containing ZZZ
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.
It's kinda required if you're using lucene/fulltext search at all.
Currently, any searches with _lastIndex
will not use lucene (if that's the only parameter).
If _lastIndex
is provided with any other parameter, it will not work.
This includes in our $mdm-clear
job (which was the original bug reported)
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.
Doesn't this require explicitly configuring AdvancedHSearchIndexing
(which is disabled by default) in order for it to try using lucene to satisfy that query? If it's going to lucene even with that setting disabled, we should fix that bug too.
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.
Yes, this is only required if they are already using lucene. Which is why i included the migration note.
If they aren't using lucene/fulltext search, then obviously they won't have to migrate data to fill lucene data in. It doesn't exist.
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.
No but does this happen to anyone who has lucene enabled, or do they specifically need to have the AdvancedHSearchIndexing feature enabled (again, a feature which is disabled by default)? Please test this if you aren't sure. That flag is the thing that determines whether we use lucene for parameters other than _text
and _content
. Most people will have it disabled, and if we're using lucene to handle _lastUpdated
even with that flag disabled, then that in itself is probably a bug.
Please remember, you are asking people with potentially a lot of data to perform what would be an expensive and lengthy reindex. You need to be very specific about what circumstances would lead to someone needing to do this.
if (myFulltextSearchSvc != null && !myFulltextSearchSvc.isDisabled()) { | ||
if (myFulltextSearchSvc != null && !myFulltextSearchSvc.isDisabled() && changed.isChanged()) { | ||
// set the lastUpdated dates so we can use them to search in lucene | ||
theResource.getMeta().setLastUpdated(theTransactionDetails.getTransactionDate()); |
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.
This is a super weird thing to be doing here. Why is it necessary to modify the resource passed in? We index the entity, not the FHIR resource model class.
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.
The fields to index are determined by what's in the resource (not the entity) since the resource contains the changed fields.
ExtendedHSearchIndexExtractor
is where we create the ExtendedHSearchIndexData
and SearchParamTextPropertyBinder
is what consumes it to wrie the indexes
…or $validate-code operation. (#6438) * Move the validation providers to the test utilities package such that they can be reused. * Update IValidationSupport.CodeValidationIssue structure such that it meets the FHIR specification. Update RemoteTerminologyServiceValidationSupport and VersionSpecificWorkerContextWrapper translation for issues. * New tests for issue translation. Move test class to a different package so that we can add another test class. * Some simplification in the issue API to simplify building of issues. * Fix compilation errors. * Update providers to allow multiple responses and add support for the fetchCodeSystem call through method find. * Setup the first test for resource validation with remote terminology providers. * Fix NullPointerException * avoid calling validateCode for CodeSystem where system is null * Keep old public API methods (and class name) in IValidationSupport and mark them as deprecated to avoid breaking dependencies. * Revert local change to debug for duplicate errors. * Add more test cases for resource validation. Throw exception to signal missing test setup to make it obvious. * Simplify test setup. * Add some more javadoc * Add javadoc for the new test class * Add more tests * Address code review comments in IValidationSupport. * Add changelog
Change Map to Multimap to support multiple and clauses.
…RAGE_PRECHECK_FOR_CACHED_SEARCH (#6436) * fix interceptor hooks from requestDetails not getting called for STORAGE_PRECHECK_FOR_CACHED_SEARCH * added unit tests and updated changelog * added one more test case
Lightweight implementation of the adapter pattern.
<!-- <logger name="tracer" level="TRACE" additivity="false">--> | ||
<!-- <appender-ref ref="STDOUT" />--> | ||
<!-- </logger>--> | ||
<logger name="org.hibernate.search.elasticsearch.request" additivity="false" level="trace"> |
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.
This should be switched back off before merging.
@@ -31,15 +31,15 @@ | |||
<logger name="ca.uhn.fhir.jpa.bulk" level="info"/> | |||
|
|||
<!-- more debugging --> | |||
<!-- | |||
<!-- <!–--> |
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.
This should be switched back off before merging
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## rel_7_6 #6411 +/- ##
==========================================
Coverage ? 83.54%
Complexity ? 27781
==========================================
Files ? 1741
Lines ? 107563
Branches ? 13507
==========================================
Hits ? 89859
Misses ? 11917
Partials ? 5787 ☔ View full report in Codecov by Sentry. |
closes #6404