1.83 KB

Searchbird 2.0

This is a fork from All credits to it's author.

I just added proper maven and eclipse support, from both scrooge and scala.

A distributed inverted-index implementation for querying documents by terms. Inspired by Searchbird from Twitter's Scala School with the following changes:

  • Replaced deprecated ostrich dependency with twitter-server
  • Uses the new client/server APIs for finagle


  1. Compile

    sbt compile && sbt assembly
  2. Start some shards

    sbt "run -admin.port=:8990 -shard=0" &
    sbt "run -admin.port=:8991 -shard=1" &
    sbt "run -admin.port=:8992 -shard=2" &
  3. Add some data:

    ./console localhost 9000
    > client.put("fromShardA", "a value from SHARD_A")
    > client.put("hello", "world")
    ./console localhost 9001
    > client.put("fromShardB", "a value from SHARD_B")
    > client.put("hello", "world again")
  4. Run the master and submit queries:

    sbt run &
    ./console localhost 9999
    finagle-client> client.get("hello")
    res0: String = world
    finagle-client> client.get("fromShardA")
    res1: String = a value from SHARD_A
    finagle-client> client.get("fromShardB")
    res2: String = a value from SHARD_B
    finagle-client> client.get("fromShardC")
    com.feynmanliang.searchbird.thrift.SearchbirdException: No such key
    res4: Seq[String] = List()
    res5: Seq[String] = ArrayBuffer(hello)
    res6: Seq[String] = ArrayBuffer(hello)
    res7: Seq[String] = ArrayBuffer(fromShardA, fromShardB)