Сразу после создания новой записи, новая запись не появляется в списке API, хотя она индексируется.Новая запись появляется при повторном нажатии на индекс API.Использование эластичного поиска, реализованного через searchkick.Кто-нибудь сталкивался с этой проблемой?
Started POST "/api/v1/pm/projects/4/meetings" for 127.0.0.1 at 2018-10-12 13:15:45 +0530
Processing by Api::V1::Pm::MeetingsController#create as JSON
Parameters: {"meeting"=>{"name"=>"prj 4 meeting 78", "date"=>"12/10/2018", "start_time"=>"01:30 PM", "end_time"=>"02:00 PM", "url"=>"https://asdf.com", "agenda"=>"prj 4 meeting 78 agenda", "notes"=>"", "members"=>["abc@gmail.com"]}, "project_id"=>"4"}
AuthenticationToken Load (0.2ms) SELECT "authentication_tokens".* FROM "authentication_tokens" WHERE "authentication_tokens"."body" = $1 LIMIT $2 [["body", "Eu5fwDmEkLDootjzE3kcUrGi"], ["LIMIT", 1]]
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 AND "users"."is_approved" = $2 AND "users"."is_archived" = $3 LIMIT $4 [["id", 1], ["is_approved", "t"], ["is_archived", "f"], ["LIMIT", 1]]
Partner Load (0.2ms) SELECT "partners".* FROM "partners" WHERE "partners"."code" = $1 LIMIT $2 [["code", "e-ai"], ["LIMIT", 1]]
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
(0.2ms) BEGIN
SQL (1.7ms) INSERT INTO "meetings" ("name", "date", "start_time", "end_time", "url", "agenda", "notes", "members", "project_id", "user_id", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" [["name", "prj 4 meeting 78"], ["date", "2018-10-12"], ["start_time", "13:30:00"], ["end_time", "14:00:00"], ["url", "https://asdf.com"], ["agenda", "prj 4 meeting 78 agenda"], ["notes", ""], ["members", "{abc@gmail.com}"], ["project_id", 4], ["user_id", 1], ["created_at", "2018-10-12 07:45:45.133414"], ["updated_at", "2018-10-12 07:45:45.133414"]]
(10.7ms) COMMIT
***Meeting Store (77.8ms) {"id":78}***
[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (1.81ms)
Completed 200 OK in 116ms (Views: 3.5ms | Searchkick: 77.8ms | ActiveRecord: 13.9ms)
Started GET "/api/v1/pm/projects/4/meetings" for 127.0.0.1 at 2018-10-12 13:15:45 +0530
Processing by Api::V1::Pm::MeetingsController#index as JSON
Parameters: {"project_id"=>"4", "meeting"=>{}}
AuthenticationToken Load (0.3ms) SELECT "authentication_tokens".* FROM "authentication_tokens" WHERE "authentication_tokens"."body" = $1 LIMIT $2 [["body", "Eu5fwDmEkLDootjzE3kcUrGi"], ["LIMIT", 1]]
User Load (1.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 AND "users"."is_approved" = $2 AND "users"."is_archived" = $3 LIMIT $4 [["id", 1], ["is_approved", "t"], ["is_archived", "f"], ["LIMIT", 1]]
Partner Load (1.0ms) SELECT "partners".* FROM "partners" WHERE "partners"."code" = $1 LIMIT $2 [["code", "e-ai"], ["LIMIT", 1]]
Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = $1 LIMIT $2 [["id", 4], ["LIMIT", 1]]
Meeting Search (16.8ms) curl http://localhost:9200/meetings_development/_search?pretty -H 'Content-Type: application/json' -d '{"query":{"bool":{"must":{"match_all":{}},"filter":[{"term":{"project_id":4}}]}},"sort":{"cancelled_at":{"order":"asc","unmapped_type":"boolean"},"updated_at":{"order":"desc","unmapped_type":"long"}},"timeout":"11s","_source":false,"size":25,"from":0}'
Meeting Load (1.8ms) SELECT "meetings".* FROM "meetings" WHERE "meetings"."id" IN (77, 75, 76, 74, 73, 72, 71, 70)
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1
[active_model_serializers] Rendered ActiveModel::Serializer::Null with Hash (13.02ms)
Completed 200 OK in 52ms (Views: 14.4ms | Searchkick: 16.8ms | ActiveRecord: 5.5ms)
Как вы видите в журналах, встреча с идентификатором 78 индексируется, но не отображается в индексе API.