49
Searching with Solr When, Why and How? By Paul Matthews

Search with Solr

Embed Size (px)

DESCRIPTION

With Google constantly pushing the customer expectations of searching, is it time to move away from our database full-text search in pursuit of a more targeted platform? Can implementing Solr offer more than an answer to a search? Implementing a search platform isn’t always suitable for all applications, but in this talk we’ll look at identifying the right search solution, choosing the best way to integrate it into our application and exploring all the benefits a search server can offer.

Citation preview

Page 1: Search with Solr

Searching with SolrWhen, Why and How?By Paul Matthews

Page 2: Search with Solr

2

86p

@paulmatthews86

86p.paul-matthews.co.uk

[email protected] techportal.ibuildings.com Projects:

Travel companies Media corporations

Page 3: Search with Solr

3

Searching…

What?

When?

Why?

How?

Page 4: Search with Solr

4

Searching…

What?

When?

Why?

How?

Page 5: Search with Solr

5

What is search?

Text navigation

Customers describing

Sorting

Examples Quick search Category listings

Page 6: Search with Solr

6

The power of search

Page 7: Search with Solr

7

Database Like

Page 8: Search with Solr

8

Database Like

Very little effort

A very basic search

Poor at: > 1 word

Page 9: Search with Solr

9

Database Full-Text

Page 10: Search with Solr

10

Database Full-Text

Some power

Convenient

Feature poor

Often very slow

Page 11: Search with Solr

11

Basic Search Systems

Page 12: Search with Solr

12

Basic Search Systems

Rapid search

Simple to setup

Feature poor

Accuracy

Require more application code

Page 13: Search with Solr

13

Solr Search

Page 14: Search with Solr

14

Solr Search

Very powerful

Feature rich

Relatively simple

Lots of plugins (community)

Overkill?

Java

Page 15: Search with Solr

15

Things you need to know

Page 16: Search with Solr

16

Searching…

What?

When?

Why?

How?

Page 17: Search with Solr

17

Applicable to me?

Who is Solr designed for? Traffic Features

When is a good time to implement it? Creation Post-live Open Source projects

Page 18: Search with Solr

18

Business indicators

Money / Time / Effort spent Bugs Tuning Features

Customers

Page 19: Search with Solr

19

Development indicators

Data

MySQL Full Text

Degradation

Page 20: Search with Solr

20

Searching…

What?

When?

Why?

How?

Page 21: Search with Solr

21

Is Solr right for me?

Know your enemy

With great functionality comes great responsibility

Page 22: Search with Solr

22

Data sources

Database Easy

API Features

CSV & XML

Solr Cell - Rich Documents PDF MS Office

Page 23: Search with Solr

23

Indexing

Parsing

Half now, half later

Page 24: Search with Solr

24

Analyzer

Process documents

The query gets analyzed too

Page 25: Search with Solr

25

Tokenizer

Page 26: Search with Solr

26

TokenizerFilter

Synonym

Page 27: Search with Solr

27

Stemming

Matching similar words

Reduce to Stem

SearchingSearchSearchesSearchedSearchers

Search

Page 28: Search with Solr

28

Hit Highlighting

“Hit” ==> “This is a <em>Hit</em> test.”

Page 29: Search with Solr

29

Spell Check

Spelchk Did you mean …?

“flickr”

Page 30: Search with Solr

30

Page 31: Search with Solr

31

By the power of Queries!

Phrase “Search for a phrase”

Wildcards Look*familiar?

Fuzzy fuzzy~

Proximity “two words”~12

Range name:{Paul TO Jeff}

Page 32: Search with Solr

32

name:paul AND location:uk

A single field

Multiple Fields

Page 33: Search with Solr

33

Faceting (21)

Pre-fetching (11)

Results (37)

Page 34: Search with Solr

34

Ranked Search

Ordered

Any field

Page 35: Search with Solr

35

Simultaneous update & search

Hold on a minute!

Actually, I don’t have to…

Page 36: Search with Solr

36

Searching…

What?

When?

Why?

How?

Page 37: Search with Solr

37

Flow

Page 38: Search with Solr

38

Container

Choose container

Make accessible

http://<host>:<port>/solr/admin

Page 39: Search with Solr

39

Solr Config

Cores ~ Database Schema

schema.xml ~ Schema definition

Page 40: Search with Solr

40

Fields

Define the data indexed Stored

Important to model accurately

Tweak to achieve functionality

Conscious of space and index

Page 41: Search with Solr

41

Index

Create documents to Schema Spec

Page 42: Search with Solr

42

Search

Quick Search

Default Search

Advanced Search

Page 43: Search with Solr

43

Quick Search

Partial words

Search all fields?

Required response data

Page 44: Search with Solr

44

Default Search

Consider useful Analyzers

Potentially match on more fields

Enrich or refine results with personal data

More in depth results

Page 45: Search with Solr

45

Advanced Search

Offer user control

Consider search storage Data size vs Additional queries

To return more / less results “Search entire document” “Filter by Colour”

Page 46: Search with Solr

46

Searching…

What?

When?

Why?

How?

Page 47: Search with Solr

47

Questions?

Page 48: Search with Solr

48

We’re Hiring

NL Vlissingen Utrecht

UK London Sheffield Liverpool

Speak to me at the end… [email protected]

Page 49: Search with Solr

49

Thank you

Resources Links: http://www.delicious.com/paulm86/solr

This talk: http://joind.in/3221

Contact Me: @paulmatthews86 http://about.me/paul.matthews