Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How REA Group Uses Elasticsearch to Power Real Estate Searches

Elastic Co
December 08, 2015

How REA Group Uses Elasticsearch to Power Real Estate Searches

REA Group’s realestate.com.au has been slowly migrating its search function to Elasticsearch. Its millions of listings, plus millions of sales histories and thousands of realtors and agencies, mean thousands of updates at once and more than 100 queries per second.

David Kemp | Elastic{ON} Tour Sydney | December 8, 2015

Elastic Co

December 08, 2015
Tweet

More Decks by Elastic Co

Other Decks in Technology

Transcript

  1. 2

  2. The new system (application specific ES clusters) 9 Elasticsearch For

    Rent Search API RDB Agent Feeder Elasticsearch Sold Listings Search API Sold Listings Feeder Elasticsearch Find An Agent API Rental Listings Feeder
  3. Cluster across AWS Availability Zones 12 Availability Zone A Node

    Elasticsearch cluster Node Node Node Node Availability Zone B AWS Load Balancer Feeder API API AWS Load Balancer
  4. Active/Active across two AWS Regions 13 Frankfurt Sydney AWS Load

    Balancer Node Elasticsearch cluster Node Node Node Node Node Elasticsearch cluster Node Node Node Node AWS Load Balancer Route-53 DNS European Clients Australian Clients DNS resolution based on latency API API API API
  5. Active/Active across two AWS Regions 14 Frankfurt Sydney AWS Load

    Balancer Node Elasticsearch cluster Node Node Node Node Node Elasticsearch cluster Node Node Node Node AWS Load Balancer Route-53 DNS European Clients Australian Clients DNS resolution based on latency API API API API
  6. Active/Active across two AWS Regions 15 Frankfurt   Sydney  

    AWS  Load   Balancer   Node   Elas8csearch   cluster   Node   Node   Node   Node   Node   Elas8csearch   cluster   Node   Node   Node   Node   AWS  Load   Balancer   Route-­‐53   DNS   European   Clients   Australian   Clients   DNS  resolu8on   based  on  latency   API   API   API   API  
  7. Disposable indexes 18 Search   API   Index  1.0  

    Feeder  1.0   Alias  1   Index  1.1   Feeder  1.1  
  8. Disposable indexes 19 Search   API   Index  1.0  

    Feeder  1.0   Alias  1   Index  1.1   Feeder  1.1  
  9. Disposable indexes 22 Search   API   Index  1.1  

    Feeder  1.1   Alias  1   Index  2.0   Feeder  2.0   Alias  2  
  10. Disposable indexes 23 Index  1.1   Feeder  1.1   Alias

     1   Index  2.0   Feeder  2.0   Alias  2   Search   API   Search   API  
  11. Multiple fixed duration upgrades per listing 28 Upgrade   Start:

     03/04/15   End:    17/04/15   Lis8ng  
  12. Map upgrades as “nested” objects 29 "lis8ngUpgrades":  {    

         "type":  "nested",          "rank":  {"type":  "integer"},          "startDate":  {"type":  "date"},          "endDate":  {"type":  "date"}   }    
  13. Rank by upgrade 30  "query":  {        

         …              "nested":  {                            …                          "func)on_score":  {                                          …                                              "range":  {  "lis8ngUpgrades.startDate":  {  "lt":  "now"}},                                                "range":  {  "lis8ngUpgrades.endDate":  {"gte":  "now"}}                                                  …                                              "field_value_factor":  {  "field":  "lis8ngUpgrades.rank"}  
  14. Suburb autosuggest •  Will “b” match “B” and “rd” match

    “road”? •  Will “Bunswik” match “Brunswick”? •  Will “Brunswick East” match “East Brunswick”? •  Will “Bruns” match “East Brunswick”? •  Exact matches should outrank fuzzy matches. •  Highlighting? E.g. “Bru” => “East <em>Bru</em>nswick”. •  Has to be fast. 33
  15. The many ways of implementing autosuggest •  Elasticsearch’s completion suggesters

    •  Prefix query •  Match phrase prefix •  Edge n-grams 34