$30 off During Our Annual Pro Sale. View Details »

Deep Dive into Faceting

Boaz Leskes
September 20, 2012

Deep Dive into Faceting

Presentation given by me on the first ElasticSearch NL meetup - 20/9/2012

Boaz Leskes

September 20, 2012
Tweet

More Decks by Boaz Leskes

Other Decks in Technology

Transcript

  1. ElasticSearch NL
    20/9/2012

    View Slide

  2. Tonight
    • Pizza & Beer

    • Deep dive into faceting ( me :) )

    • ElasticSearch.com introduction ( Uri/Shay )

    • More drinks..

    View Slide

  3. Deep Dive into
    Faceting
    Boaz Leskes

    CTO Buzzcapture

    @bleskes

    View Slide

  4. ?

    View Slide

  5. q = fox
    5 times a
    The lazy dog jumps over a quick brown fox

    View Slide

  6. The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The lazy dog jumps

    over the brown fox
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    q = fox

    View Slide

  7. The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The lazy dog jumps

    over the brown fox
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    5 a
    2 a
    3 a 10 a
    "facets": {

    "o_count": {

    "lettercount": {

    "letter": "o",

    "field": "doc"

    }

    }

    }
    "facets": {

    "o_count": {

    "type ": "lettercount"

    "count": 12

    }

    }

    View Slide

  8. Intermezzo
    A plugin to register your facet

    View Slide

  9. The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The lazy dog jumps

    over the brown fox
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    q = fox

    View Slide

  10. Facet Processor

    parse
    Facet Collector
    doc ids
    per shard
    Field Cache
    doc ids doc values
    Facet
    creates

    View Slide

  11. brown
    dog
    fox
    quick
    2 5 10 12
    5 6 12 13
    2
    5
    6
    10
    12
    13
    brown
    dog
    fox
    quick

    View Slide

  12. The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The lazy dog jumps

    over the brown fox
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    The quick brown fox

    jumps over the lazy dog
    5 a
    2 a
    3 a 10 a

    View Slide

  13. Facet Processor

    reduce
    internal stream
    Facet
    Facet
    Facet Facet

    View Slide

  14. James 3
    Charlie 2
    Adam 2
    Eve 1
    Brown 2
    Remco 2
    Adam 2
    Eve 1
    David 3
    James 2
    Jan 2
    Eve 1
    James 3
    Charlie 2
    Adam 2
    Brown 2
    Remco 2
    Adam 2
    David 3
    James 2
    Jan 2
    James 5
    Adam 4
    Remco 2

    View Slide

  15. Facet Processor

    parse
    Facet Collector
    Facet
    Facet Processor

    reduce
    internal stream
    output
    multi threaded
    single thread

    View Slide

  16. Faceted Date Histogram

    View Slide

  17. Existing Machinery

    View Slide

  18. Facet Processor

    parse
    Facet Collector
    Facet
    Facet Processor

    reduce
    internal stream
    output
    multi threaded
    single thread

    View Slide

  19. Facet Processor

    parse
    Date Facet Collector
    Value Facet
    Value Facet Reduce
    Value Facet Collector
    Value Facet Reduce
    Value Processor
    Value Facet Collector
    Value Facet
    10 sept. 17 sept.

    View Slide

  20. Thanks!
    Code is available on https://github.com/bleskes

    View Slide