searching for the grail

76
Searching For The Grail Noam Tenne

Upload: noamt

Post on 08-Jun-2015

1.034 views

Category:

Technology


0 download

DESCRIPTION

Search facilities have become such a basic commodity in applications that it's almost taken for granted. But bundled with a framework such as Grails, you the developer are faced with some limitations and extra concerns: how well is this library developed and backed? does the library fit the framework's paradigm and how good is the support for the tool within the framework itself? This talk will provided an overview and comparison in search for a piece of the holy grail - a good search facility.

TRANSCRIPT

Page 1: Searching for the grail

Searching For The Grail

Noam Tenne

Page 2: Searching for the grail

$ whoami

Noam Tenne

Page 3: Searching for the grail

Senior DeveloperSenior Developer

Page 4: Searching for the grail

blog.10ne.org

@NoamTenne

github.com/noamt

Page 5: Searching for the grail

http

://w

ww

.flic

kr.c

om/p

hoto

s/au

ssie

gall/

Where do we standWhere do we stand

Page 6: Searching for the grail

Different data

Page 7: Searching for the grail

Different shapes

Page 8: Searching for the grail

Sph

inx

Tech

nolo

gies

Inc.

Page 9: Searching for the grail

Sphinx

Domain

Page 10: Searching for the grail

Sphinx

Domain

Model has been modified

Page 11: Searching for the grail

Sphinx

Domain

Update the index

Custom

Integration

Page 12: Searching for the grail

Sphinx

Domain

Update the index

Custom

Integration

Page 13: Searching for the grail

Sphinx

Domain

Sphinx offline for re-index

Custom

Integration

Page 14: Searching for the grail

Expected interaction

Page 15: Searching for the grail

Engine

Create or update the mappings on startup

Mappings

Application

Page 16: Searching for the grail

Engine

Act on persistence events

Application

Domain

Page 17: Searching for the grail

Engine

Act on persistence events

Update

Documents

Application

Domain

Page 18: Searching for the grail

What do we choose?What do we choose?

http

://w

ww

.flic

kr.c

om

/ph

oto

s/89

869

792@

N00

/

Page 19: Searching for the grail

Searchable PluginSearchable Plugin

Page 20: Searching for the grail

Uses the Compass project

To become “El

asticsearch”

http://compass-project.org

Page 21: Searching for the grail

Quick and easy setup

Page 22: Searching for the grail

Embedded in your application

Easier maintenance!Great for testing!

Is this

a goo

d thin

g?

Page 23: Searching for the grail

Compass

ApplicationPlugin

Page 24: Searching for the grail

Incremental index

Page 25: Searching for the grail

static searchable = true

Mark a Domain as searchable:

Page 26: Searching for the grail

    static searchable = {        except = ['field1']        field2 boost: 2.0    }

Mark a Domain as searchable while customizing the mapping:

Page 27: Searching for the grail

Map domains with annotations

Page 28: Searching for the grail
Page 29: Searching for the grail

 def result =                              Domain.search('query')

Search using the domain static API:

Page 30: Searching for the grail

 def result =                         searchableService.search('query')

Search using the introduced service:

Page 31: Searching for the grail

What's the threshold?

Page 32: Searching for the grail

Compass

Application

Page 33: Searching for the grail

Compass

Application

Page 34: Searching for the grail

Compass

Application

Page 35: Searching for the grail

Horizontal growth is stifled

Page 36: Searching for the grail

Compass

App1

DB

Page 37: Searching for the grail

Compass

App1

DB

Compass

App2

Page 38: Searching for the grail

Compass

App1

DB

Compass

App2

Compass

App3

Page 39: Searching for the grail

Room

to

Grow

http

://w

ww

.flic

kr.c

om/p

hoto

s/el

will

o/

Page 40: Searching for the grail

Solr PluginSolr Plugin

Page 41: Searching for the grail

Backed by The Apache Software Foundation

ww

w.a

pach

e.or

ght

tp://

luce

ne.a

pach

e.or

g/so

lr

Page 42: Searching for the grail

Incremental index&

Facilities of modern engines

Page 43: Searching for the grail

Utilizes an external instance

Page 44: Searching for the grail

Compass

ApplicationPlugin

Page 45: Searching for the grail

Solr

Application

Plugin

Page 46: Searching for the grail

Embedding is possible but requires tweaks

Page 47: Searching for the grail

Setup is fairly simpleRequires some fumbling

Page 48: Searching for the grail

Solr comes as a bundled installation with the plugin

Page 49: Searching for the grail

Application

Page 50: Searching for the grail

Solr

ApplicationPlugin

Page 51: Searching for the grail

ApplicationPlugin

Solr

Page 52: Searching for the grail

grails start­solr&

grails stop­solr

Page 53: Searching for the grail

static enableSolrSearch = true

Mark a Domain as searchable:

Page 54: Searching for the grail

static solrAutoIndex = true

Auto-index domain:

Page 55: Searching for the grail

 def result =                          Domain.searchSolr('query')

Search using the domain static API:

Page 56: Searching for the grail

 def result =                               solrService.search('query')

Search using the domain static API:

Page 57: Searching for the grail

...But wait a minute

Page 58: Searching for the grail

-GASP-

Page 59: Searching for the grail

Can you afford to maintain it?Can you afford to maintain it?

http

://w

ww

.flic

kr.c

om

/pho

tos/

loui

sa_

catlo

ver/

Page 60: Searching for the grail

I'm not dead yet!

Page 61: Searching for the grail

Using Solr?Using Grails?Contribute!

(yay)

Page 62: Searching for the grail

Elasticsearch PluginElasticsearch Plugin

Page 63: Searching for the grail

Elasticsearch

http

://w

ww

.ela

stic

sear

ch.o

rg

Page 64: Searching for the grail

All the benefits of the aforementioned(Incremental, external, actively developed)

Page 65: Searching for the grail

Setting up for embedded or external is a breeze

Page 66: Searching for the grail

elasticSearch {    client.mode = 'local'}

Embedded:

Page 67: Searching for the grail

elasticSearch {    client.mode = 'transport'}

External (single node):

Page 68: Searching for the grail

static searchable = true

Mark a Domain as searchable:

static searchable = {…                

}                    

Looks familiar?

Page 69: Searching for the grail

Query closures

Page 70: Searching for the grail

From the trenches

http://www.flickr.com/photos/finsam/

Page 71: Searching for the grail

Not released often

Page 72: Searching for the grail

Plan ahead. mappings are commitments

Page 73: Searching for the grail

Keep configurations in line

Page 74: Searching for the grail
Page 75: Searching for the grail

Call to armsHibernate

GORM

github.com/noamt/elasticsearch­gorm­plugin

Page 76: Searching for the grail

Thanks!

Any queries? (HAHAHA!)