Wouldn't the tool we are commenting on solve your problem nicely or what are you missing? Have you checked out the sqlite database where they are all stored? Does the iMessage search not work for this use case?
I've been tinkering with this recently and there are conversations where the last content in the sqlite database is a month and a half old. Oddly in some cases there used to be newer content in there that had since disappeared.
If you are talking about data missing from the `text` column, for some reason it disappears after you read a message. The content is stored in a binary blob in a different column, which I parse like this: https://github.com/ReagentX/imessage-exporter/blob/c73bc4d66...