MojoJolo / textteaser

TextTeaser is an automatic summarization algorithm.
MIT License
1.97k stars 250 forks source link

how to convert query into Mysql if we use Mysql ? #20

Closed RahulKulhari closed 10 years ago

RahulKulhari commented 10 years ago

I want to convert this query def getBlogScore(word: String, blog: String): Long = Keyword.where(_.word eqs word).and(_.blog eqs blog) .fetch.map(_.score._1) .reduceLeftOption(_ + _).getOrElse(0)

into Mysql ?

How to do this?

RahulKulhari commented 10 years ago

SELECT SUM(score) FROM keyword WHERE blog = 'blog' AND word = 'word'