diff --git a/app/collins/models/AssetFinder.scala b/app/collins/models/AssetFinder.scala index 345894d07..60d1bd937 100644 --- a/app/collins/models/AssetFinder.scala +++ b/app/collins/models/AssetFinder.scala @@ -54,7 +54,7 @@ case class AssetFinder( updatedAfter.map(t => "updatedAfter" -> Formatter.dateFormat(t)) :: updatedBefore.map(t => "updatedBefore" -> Formatter.dateFormat(t)) :: state.map(s => "state" -> s.name) :: - query.map(q => "query" -> q.traverseQueryString) :: + query.map { q => "query" -> "UHOH!!!!" } :: //FIXME: need toCQL traversal Nil) items.flatten } diff --git a/app/collins/models/RemoteAssetFinder.scala b/app/collins/models/RemoteAssetFinder.scala index b98df3826..be1e697d8 100644 --- a/app/collins/models/RemoteAssetFinder.scala +++ b/app/collins/models/RemoteAssetFinder.scala @@ -26,7 +26,6 @@ import collins.solr.SolrOrOp import collins.solr.StringValueFormat import collins.util.AttributeResolver.ResultTuple import collins.util.RemoteCollinsHost -import collins.util.config.MultiCollinsConfig /** * Just a combination of everything needed to do a search. Probably should @@ -277,11 +276,10 @@ object RemoteAssetFinder { /** */ def apply(clients: Seq[RemoteAssetClient], pageParams: PageParams, searchParams: AssetSearchParameters): (Seq[AssetView], Long) = { - val key = searchParams.paginationKey.getOrElse("") + clients.map { _.tag }.mkString("_") + val key = searchParams.paginationKey + clients.map { _.tag }.mkString("_") val stream = Cache.getAs[RemoteAssetStream](key).getOrElse(new RemoteAssetStream(clients, searchParams)) val results = stream.slice(pageParams.page * pageParams.size, (pageParams.page + 1) * (pageParams.size)) - val timeout = MultiCollinsConfig.queryCacheTimeout - Cache.set(key, stream, timeout) + Cache.set(key, stream, 30) (results, stream.aggregateTotal) } diff --git a/app/collins/solr/CollinsQueryLanguage.scala b/app/collins/solr/CollinsQueryLanguage.scala index d38864025..67f30c80d 100644 --- a/app/collins/solr/CollinsQueryLanguage.scala +++ b/app/collins/solr/CollinsQueryLanguage.scala @@ -27,7 +27,7 @@ case class CQLQuery(select: SolrDocType, where: SolrExpression) { * itself into a Solr Query */ sealed trait SolrQueryComponent { - def traverseQueryString(): String = traverseQueryString(true) + protected[solr] def traverseQueryString(): String = traverseQueryString(true) protected[solr] def traverseQueryString(toplevel: Boolean): String } diff --git a/app/collins/util/config/MultiCollinsConfig.scala b/app/collins/util/config/MultiCollinsConfig.scala index c04163ac2..1da319cf5 100644 --- a/app/collins/util/config/MultiCollinsConfig.scala +++ b/app/collins/util/config/MultiCollinsConfig.scala @@ -18,7 +18,6 @@ object MultiCollinsConfig extends Configurable { } def locationAttribute = getString("locationAttribute", "LOCATION") def thisInstance = getString("thisInstance") - def queryCacheTimeout = getInt("queryCacheTimeout", 30) override def validateConfig() { if (enabled) { diff --git a/conf/reference/multicollins_reference.conf b/conf/reference/multicollins_reference.conf index f9be8a49d..40e50bb95 100644 --- a/conf/reference/multicollins_reference.conf +++ b/conf/reference/multicollins_reference.conf @@ -3,5 +3,4 @@ multicollins { instanceAssetType = DATA_CENTER locationAttribute = LOCATION thisInstance = NONE - queryCacheTimeout = 30 } diff --git a/test/collins/models/AssetSearchParametersSpec.scala b/test/collins/models/AssetSearchParametersSpec.scala index 0da3d4fcd..74015fce0 100644 --- a/test/collins/models/AssetSearchParametersSpec.scala +++ b/test/collins/models/AssetSearchParametersSpec.scala @@ -3,9 +3,6 @@ package collins.models import org.specs2._ import specification._ -import collins.solr.SolrKeyVal -import collins.solr.SolrStringValue - class AssetSearchParametersSpec extends mutable.Specification { val EMPTY_RESULT_TUPLE = (Nil, Nil, Nil) @@ -96,10 +93,6 @@ class AssetSearchParametersSpec extends mutable.Specification { ).toSeq.findOne("attribute") must_== Some("ip_address;1.3.5.7") } - "include CQL query" in { - AssetSearchParameters(EMPTY_RESULT_TUPLE, AssetFinder.empty.copy(query = Some(SolrKeyVal("foo", SolrStringValue("bar")))), None).toSeq.findOne("query") must_== Some("foo:\"bar\"") - } - } "properly url-encode values" in {