►
From YouTube: Deep Dive on Elasticsearch-rails Integration
Description
Subtitle is provided for clarity.
This presentation will briefly introduce the elasticsearch-rails gem, then walk through how GitLab uses it in a slightly different manner.
---------------
Read more about our product vision: http://bit.ly/2IyXDOX
Learn about FOSS & GitLab: http://bit.ly/2KegFjx
Get in touch with Sales: http://bit.ly/2IygR7z
A
A
Today's
topic
is
about
elasticsearch
for
those
of
you
who
don't
know
how
elasticsearch
is
it
basically
offers
a
global
vortex
search.
You
can
do
a
global
search
on
the
top
right
corner.
The
following
search
field.
A
There's
no
demo
for
today,
because
all
the
changes
I'm
discussing
are,
they
can
changes
and
they
wouldn't
affect
our
users.
So
most
of
the
slide
will
be
about
ruby
codes
except
the
very
very
end.
So
it's
so
more
focused
more
for
the
rails
developers.
A
A
A
A
A
A
A
A
A
A
Since
we
included
localback
module
earlier,
the
model
module
will
add
three
copics
to
our
model,
one
for
create
one
for
update
and
one
for
destroy,
since
we
are
in
creating
an
object
today.
So
this
the
first
line
will
be
triggered.
It
will
call
elasticsearch
proxies
index
index
document
method.
A
A
By
this
time,
by
this
point,
the
operation
is
down,
so
the
data
is
indexed.
A
Elasticsearch
proxies
are
consistent
of
many
modules.
This
means
we
can
cherry
pick
only
the
things
we
need.
A
A
And
each
of
the
proxy
has
access
to
a
client.
The
client
is
the
object
we
use
to
communicate
with
the
server.
It's
basically
a
faraday
client
hour
a
day,
client,
and
it
knows
the
information
such
as
the
server
url
and
the
port
right
before
all
of
the
proxy
share
the
same
client,
but
this
can
be
changed
as
well.
A
A
A
A
A
A
A
And
we
can
also
have
different
versions
of
the
proxy
2.,
so
here
we
can
have
version
12.1,
sniper,
class,
proxy
and
version
13.0
sniping
class
proxy.
We
can
also
keep
things
dry
by
extracting
common
logic
here.
The
common
search
logic
is
extracted
as
application
class
proxy,
and
you
can
see
the
inheritance
hierarchy
from
snippet
to
application
class
proxy,
then
to
class
message
proxy.
A
How
do
we
choose?
Which
version
to
route
to
the
answer
will
be?
This
is
a
base
case
by
case,
for
example,
if
we
have
two
indices
version,
one
and
version
2.
A
A
A
And
for
methods
such
as
removing
indexes,
we
also
have
a
list
here
called
methods
for
one
right
target
so
for
import,
create
index
or
delete
index.
Those
methods
are
those
methods
shouldn't
be
forwarded
to
older
versions.
You
should
be
deciding
which
version
those
commands
are
wrongs
on,
so
they
are
in
the
separate
method.
A
A
A
For
each
of
the
method,
in
methods
for
all
right
targets,
we
will
call
forward
to
all
right
targets.
This
is
the
point
one
I've
put
on
the
top
right
corner
so
for
all
right
targets,
sorry
for
methods
which
should
go
to
all
the
brochures.
We
would
forward
calls
to
all
versions
by
calling
the
forward
to
all
right
targets,
and
if
we
look
in
silo
forward
to
all
right
targets
method,
you
will
see
that
we
define
a
method
for
each
of
the
methods
we
pass
in.
A
A
A
A
A
A
A
A
A
This
is
because,
halfway
through,
we
switch
our
focus
to
to
enable
global
search
on
gleb.com,
but
I
still
think
there
are
some
benefits.
For
example,
we
get,
we
move
all
the
search
related
code
into
their
own
classes,
so
our
model
is
cleaner
and
smaller,
and
now
the
testing
can
be
done
on
the
proxy
objects.