fix search stalemate & mate

pull/83/head
Thibault Duplessis 2012-09-08 12:37:35 +02:00
parent ef46d939d6
commit 5c1077ee3c
4 changed files with 7 additions and 5 deletions

View File

@ -29,6 +29,8 @@ object Query {
val notFinished: DBObject = DBObject("status" -> Status.Started.id)
val frozen: DBObject = "status" $gte Status.Mate.id
val popular: DBObject = "bm" $gt 0
def clock(c: Boolean): DBObject = "clock.l" $exists c

View File

@ -52,7 +52,7 @@ final class Indexer(
}
private def indexQuery(query: DBObject): IO[Int] = io {
val cursor = gameRepo find (GameQuery.finished ++ query) sort GameQuery.sortCreated //limit 3000
val cursor = gameRepo find (GameQuery.frozen ++ query) sort GameQuery.sortCreated //limit 3000
var nb = 0
for (games cursor grouped 5000) {
//println("Indexing from %d to %d".format(nb, nb + games.size))

View File

@ -158,7 +158,10 @@ moreCss = moreCss) {
@game.widgets(pager.currentPageResults)
</div>
} else {
<div class="search_status">No game found</div>
<div class="search_status">
No game found -
<a class="permalink" href="@routes.Search.form()">Permalink</a>
</div>
}
}.getOrElse {
<div class="search_status">Search ready</div>

3
todo
View File

@ -40,11 +40,8 @@ add more system messages to the game chat http://en.lichess.org/forum/lichess-fe
chess960 second rematch random position http://en.lichess.org/forum/lichess-feedback/return-game-chess-960#1
count ai games in nb wins/losses http://en.lichess.org/@/ivym http://en.lichess.org/forum/lichess-feedback/how-do-the-game-totals-work#1
-> user_stats collection for all nb* fields
search date filter bug
stalemate filter bug
index game positions
integrate with google+
elo stats
permalink without results
merge timeout and outoftime
feedback changes to do http://en.lichess.org/forum/lichess-feedback/new-feature-landing-advanced-search#3