Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 32fb62a4ba
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (23 sloc) 0.621 kb
/*
* Applies some simple optimizations
*/
package com.foursquare.slashem
import com.foursquare.slashem.Ast._
object Optimizer {
def optimizeFilters(filters: List[AbstractClause]): List[AbstractClause] = {
filters.filter(f => {
f match {
//Remove all empty search clauses
case Clause("*",Splat(),true) => false
case Clause("_all",Splat(),true) => false
case _ => true
}
})
}
def optimizeQuery(clause: AbstractClause): AbstractClause = {
clause
}
def optimizeBoosts(boostQueries: List[AbstractClause]): List[AbstractClause] = {
boostQueries
}
}
Jump to Line
Something went wrong with that request. Please try again.