Tracking any change to any of the multiple tables used in the join to create the index


(Raj Rajeshwar Singh Rathore) #1

Continuing the discussion from JDBC and tracking_column(s) questions:

I want to update the index whenever any of any of the tables used in the join to create the index is updated in MySQL. I'm using jdbc input plugin. So, if I concat all the related modified_time, how can I compare those with the sql_last_value as that will be a string of dates?

Tagging - @Christian_Dahlqvist


(Christian Dahlqvist) #2

I think this is mainly a SQL question, so am not sure I am qualified to answer. Could you perhaps create a view and have a column in the view that is the MAX of all modified dates included in the join? If that doesn't work, you could compare against multiple fields in the query.


(Raj Rajeshwar Singh Rathore) #3

I used the GREATEST() function in my MySQL join query over all the modified_time fields so now if I change any data in any of the tables participating in join then that data gets indexed in the ElasticSearch.
PS: I'm having triggers on all of my tables for creation & modification time :slight_smile:

Thanks @Christian_Dahlqvist


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.