I have one get service where I am using entity-find on an entity and getting the result. This entity find has one date filter applied like the below:
Now, I want to convert this entity find service to OpenSearch. I am able to write the search service but I am facing an issue in applying the above same <date-filter/> in Search API. Can somebody please guide me in resolving this issue? I am not sure how I can apply this same filter in an open search service. For OpenSearch, I am calling this Moqui inbuilt service:
We are mixing some topics so I will attempt to clarify.
There are two different approaches to find data, 1) entity find and 2) opensearch
Using entity find we can use date-filter to automatically filter out records that are no longer active and only return the active record. Examples where this is used are PartyRelationship and WorkEffortParty.
When using open search the behavior seems to be different. Specifically, if a record is no longer active (has a thru date in the past), then it is removed from the document when the record is reindexed.
This approach is fine and will work for our use case, but it seems as though reindexing is not automatically triggered.
We are specifically working with tasks and using the MantleTask index. When we remove someone from a task (thruDate on WorkEffortParty record) the “parties” section in the json still contains the party that was removed.
So the most basic question is this: How is reindexing triggered when a database record changes?
By “remove” I simply mean that we are taking someone off of a task by putting an end date on the WorkEffortParty record.
We figured out what we needed to do to emulate the functionality of entity-find and date-filter using an opensearch query. We added from and thru date fields to the parties section of MantleTask data document definition so they are available to include in the query.