-
-
Save firatkarakusoglu/613a7c1dc9cecb090e26 to your computer and use it in GitHub Desktop.
Connection config for indexing a database to Solr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <dataConfig> | |
| <dataSource type="JdbcDataSource" | |
| driver="com.mysql.jdbc.Driver" | |
| url="jdbc:mysql://localhost:3306/employees" | |
| user="user" | |
| password="password" /> | |
| <document> | |
| <entity name="id" query="select emp_no as 'id', first_name, last_name from employees limit 1000;" /> | |
| </document> | |
| </dataConfig> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select e.emp_no, e.birth_date, | |
| ( | |
| select t.title | |
| order by t.`from_date` desc | |
| limit 1 | |
| ) as 'title_s', e.first_name, e.last_name, e.gender as 'gender_s', d.`dept_name` as 'dept_s' | |
| from employees e | |
| join dept_emp de on de.`emp_no` = e.`emp_no` | |
| join departments d on d.`dept_no` = de.`dept_no` | |
| join titles t on t.`emp_no` = e.`emp_no` | |
| group by `emp_no` | |
| limit 1000; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment