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

fixing fulltext search wit h_lastUpdated filter #6411

Open
wants to merge 9 commits into
base: rel_7_6
Choose a base branch
from

Conversation

TipzCM
Copy link
Collaborator

@TipzCM TipzCM commented Oct 28, 2024

closes #6404

Copy link

github-actions bot commented Oct 28, 2024

Formatting check succeeded!

@TipzCM TipzCM enabled auto-merge (squash) October 30, 2024 17:12
# 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.
Copy link
Collaborator

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

Copy link
Collaborator Author

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)

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());
Copy link
Collaborator

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.

Copy link
Collaborator Author

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

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.

3 participants