You can create a custom search index instead of getting files like in the example, you would use a DataQuery to get your results from your custom tables, then just set the fields you want to display in the search results, and which values would be searchable.