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

Cloud Search with Active Asari

Lance Gleason
February 28, 2014

Cloud Search with Active Asari

A gem to make searching Amazon cloud search a bit more like sunspot. https://github.com/playon/active-asari

Presented by Lance Gleason of Polyglot Programming Inc http://www.polyglotprogramminginc.com

Lance Gleason

February 28, 2014
Tweet

More Decks by Lance Gleason

Other Decks in Programming

Transcript

  1. Introductions

    View full-size slide

  2. Twitter @lgleasain

    Github lgleasain

    !
    www.lancegleason.com

    www.polyglotprogrammincinc.com

    [email protected]

    !

    View full-size slide

  3. http://www.polyglotprogramminginc.com/purr-
    programming-2-0/

    View full-size slide

  4. www.purrprogramming.com

    View full-size slide

  5. Active Record

    View full-size slide

  6. User.where :name => ‘beavis’

    View full-size slide

  7. User.where
    ‘name like ?’, ‘bea’

    View full-size slide

  8. Person

    action: ‘eat’
    Eating

    View full-size slide

  9. •Postgres
    Stemming

    View full-size slide

  10. •Postgres
    •Mongodb
    Stemming

    View full-size slide

  11. •Postgres
    •Mongodb
    •Riak
    Stemming

    View full-size slide

  12. •Inconsistent

    View full-size slide

  13. •Inconsistent
    •Slow

    View full-size slide

  14. •Faceted Search
    Strengths

    View full-size slide

  15. •Faceted Search
    •Multilingual Support
    Strengths

    View full-size slide

  16. •Faceted Search
    •Multilingual Support
    •Field Weighting
    Strengths

    View full-size slide

  17. •Faceted Search
    •Multilingual Support
    •Field Weighting
    •Auto Suggest
    Strengths

    View full-size slide

  18. •Faceted Search
    •Multilingual Support
    •Field Weighting
    •Auto Suggest
    •Geospacial Search
    Strengths

    View full-size slide

  19. •Faceted Search
    •Multilingual Support
    •Field Weighting
    •Auto Suggest
    •Geospacial Search
    •Find Similar
    Strengths

    View full-size slide

  20. •Did you mean
    Strengths

    View full-size slide

  21. •Did you mean
    •Rich Document Support
    Strengths

    View full-size slide

  22. •Did you mean
    •Rich Document Support
    •Stemming
    Strengths

    View full-size slide

  23. •Did you mean
    •Rich Document Support
    •Stemming
    •Testability
    Strengths

    View full-size slide

  24. Weaknesses

    •Scaling

    View full-size slide

  25. Weaknesses

    •Scaling
    •Index distribution and partitions

    View full-size slide

  26. Weaknesses

    •Scaling
    •Index distribution and partitions
    •Index replication

    View full-size slide

  27. Weaknesses

    •Scaling
    •Index distribution and partitions
    •Index replication
    •High Availability

    View full-size slide

  28. Weaknesses

    •Scaling
    •Index distribution and partitions
    •Index replication
    •High Availability
    •Cost at scale

    View full-size slide

  29. Asari

    Active Asari

    View full-size slide

  30. •Faceted Search
    Strengths

    View full-size slide

  31. •Faceted Search
    •Field Weighting
    Strengths

    View full-size slide

  32. •Faceted Search
    •Field Weighting
    •Rich Document Support
    Strengths

    View full-size slide

  33. •Faceted Search
    •Field Weighting
    •Rich Document Support
    •Stemming
    Strengths

    View full-size slide

  34. •Index distribution and partitions
    Strengths

    View full-size slide

  35. •Index distribution and partitions
    •Index replication
    Strengths

    View full-size slide

  36. •Index distribution and partitions
    •Index replication
    •High Availability
    Strengths

    View full-size slide

  37. •Index distribution and partitions
    •Index replication
    •High Availability
    •Cost at scale
    Strengths

    View full-size slide

  38. •Index distribution and partitions
    •Index replication
    •High Availability
    •Cost at scale
    •Scaling
    Strengths

    View full-size slide

  39. Weaknesses

    •Multilingual Support

    View full-size slide

  40. Weaknesses

    •Multilingual Support
    •Auto Suggest

    View full-size slide

  41. Weaknesses

    •Multilingual Support
    •Auto Suggest
    •Find Similar

    View full-size slide

  42. Weaknesses

    •Multilingual Support
    •Auto Suggest
    •Find Similar
    •Did you mean

    View full-size slide

  43. Weaknesses

    •Multilingual Support
    •Auto Suggest
    •Find Similar
    •Did you mean
    •Proprietary

    View full-size slide

  44. Domain

    Index Fields

    View full-size slide

  45. Domain

    Index Fields

    •uint - 32 bit unsigned integer

    View full-size slide

  46. Domain

    Index Fields

    •uint - 32 bit unsigned integer
    •literal

    View full-size slide

  47. Domain

    Index Fields

    •uint - 32 bit unsigned integer
    •literal
    •text

    View full-size slide

  48. Search Facet Result
    Uint R R R
    Literal O O O
    Text R O O

    View full-size slide

  49. Access Policies are IP
    based like S3

    View full-size slide

  50. Adding Indexes

    View full-size slide

  51. Adding Indexes

    View full-size slide

  52. Things You Have To
    Manage

    View full-size slide

  53. Things You Have To
    Manage
    •Domain Names

    View full-size slide

  54. Things You Have To
    Manage
    •Domain Names
    •Domain Id’s for each domain

    View full-size slide

  55. Things You Have To
    Manage
    •Domain Names
    •Domain Id’s for each domain
    •Boiler plate code for searches

    View full-size slide

  56. Things You Have To
    Manage
    •Domain Names
    •Domain Id’s for each domain
    •Boiler plate code for searches
    •Calls to update indexes

    View full-size slide

  57. Things You Have To
    Manage
    •Domain Names
    •Domain Id’s for each domain
    •Boiler plate code for searches
    •Calls to update indexes
    •Access Permissions.

    View full-size slide

  58. Things You Have To
    Manage
    •Domain Names
    •Domain Id’s for each domain
    •Boiler plate code for searches
    •Calls to update indexes
    •Access Permissions.
    •Etc….

    View full-size slide

  59. An Easier Way

    View full-size slide

  60. An Easier Way

    View full-size slide

  61. An Easier Way

    View full-size slide

  62. active_asari.yml

    View full-size slide

  63. active_asari.yml

    View full-size slide

  64. active_asari_config.yml

    View full-size slide

  65. active_asari_config.yml

    View full-size slide

  66. active_asari = ActiveAsari::Migrations.new

    active_asari.migrate_all

    View full-size slide

  67. Migrations can take up to 30
    minutes

    View full-size slide

  68. In Your Model

    View full-size slide

  69. In Your Model

    View full-size slide

  70. All Transactions Are
    Synced with Cloud Search

    View full-size slide

  71. {‘666’ => ActiveAsari::ResultObject}
    Result

    View full-size slide

  72. {‘666’ => ActiveAsari::ResultObject}
    Result

    View full-size slide

  73. {‘666’ => ActiveAsari::ResultObject}
    All result fields have methods off of the object
    Result

    View full-size slide

  74. All Asari Methods are Available

    View full-size slide

  75. Roadmap
    • Possibly merge Asari and Active Asari

    View full-size slide

  76. Roadmap
    • Possibly merge Asari and Active Asari
    • Add Rake tasks for migrations

    View full-size slide

  77. Roadmap
    • Possibly merge Asari and Active Asari
    • Add Rake tasks for migrations
    • ?

    View full-size slide

  78. Twitter @lgleasain

    Github lgleasain

    !
    www.lancegleason.com

    www.polyglotprogrammincinc.com

    [email protected]

    !

    View full-size slide