-
Notifications
You must be signed in to change notification settings - Fork 3
Scoped Search Views
Pavel Kiselev edited this page Mar 21, 2017
·
4 revisions
-
Create search view table in database
- Dates must be of
json_timestamptype; - You can convert data from
timestamptojson_timestampusingto_json_timestamp(field)orto_char(field, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')functions; - Table must have scope field of
ltreetype;
- Dates must be of
-
Create triggers for
create,update,deleteoperations, that will copy data from tables (which are used to store data) into search view table- One of the most convenient ways to check and debug triggers is using of
explain analyze verbosemodifier for sql queries;
- One of the most convenient ways to check and debug triggers is using of
-
Create index mapping in GreenRiver
- Be careful, ElasticSearch index cannot have fields with same name but different types in mappings;
-
Wire index with Kafka topic
- This is achieved by modifing 2 files:
-
application.confin GreenRiver by adding serach view table name tokafka.scoped.indicesproperty; -
consumers.Workersobject: mapping of kafka topic to search view class must be added totopicTransformersmethod;
-
- This is achieved by modifing 2 files:
-
Configure scope application th the requests in nginx
- The template for nginx configuration can be found in
ansible/roles/dev/balancer/templates/nginx.conf.j2file. - You have to add
search_view_name = 1toscoped_viewsarray ininit_by_luafunction.
- The template for nginx configuration can be found in
- Rebuild GreenRiver docker container
- Change nginx configuration file
- Stop bottledwater service and services that are connected to the source database
- Migrate databases
- Start bottlewater service and services that are connected to the source database
- Deploy new image of greenriver to Mesos cluster