in app/helpers/SearchTermHelper.scala [13:32]
def projectIdQuery(forProject:String, onlyRushes:Boolean):Option[ContentSearchBuilder] = {
def testValidator(validator:Regex, remaining:Array[Regex]):Option[ContentSearchBuilder] = {
forProject match {
case validator()=>
val baseSearch = ContentSearchBuilder("")
.withTerm("GNM_PROJECT_ID", "\"" + forProject + "\"", SearchCombiner.AND)
val typeSearch = if(onlyRushes) baseSearch.withTerm("GNM_TYPE", "rushes", SearchCombiner.AND) else baseSearch
Some(typeSearch)
case _=>
if(remaining.nonEmpty) {
testValidator(remaining.head, remaining.tail)
} else {
None
}
}
}
testValidator(projectIdValidators.head, projectIdValidators.tail)
}