Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update solr-solrj, solr-test-framework to 9.3.0 #148

Merged
merged 4 commits into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ resolvers ++= Seq(
"Restlet Repositories" at "https://maven.restlet.org"
)

val solrVersion = "9.2.1"
val solrVersion = "9.3.0"
val slf4jVersion = "2.0.9"

libraryDependencies ++= Seq(
Expand Down
5 changes: 3 additions & 2 deletions src/main/scala/io/ino/solrs/AsyncSolrClient.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import org.apache.solr.common.SolrDocumentList
import org.apache.solr.common.SolrException
import org.apache.solr.common.SolrException.ErrorCode.BAD_REQUEST
import org.apache.solr.common.SolrInputDocument
import org.apache.solr.common.StringUtils
import org.apache.solr.common.params.CommonParams
import org.apache.solr.common.params.ModifiableSolrParams
import org.apache.solr.common.params.SolrParams
Expand Down Expand Up @@ -551,11 +550,13 @@ class AsyncSolrClient[F[_]] protected (private[solrs] val loadBalancer: LoadBala
private def doGetByIds(collection: Option[String], ids: Iterable[String], params: Option[SolrParams]): Future[SolrDocumentList] = {
if (ids == null || ids.isEmpty) throw new IllegalArgumentException("Must provide an identifier of a document to retrieve.")
val reqParams = queryParams(collection, params)
if (StringUtils.isEmpty(reqParams.get(CommonParams.QT))) reqParams.set(CommonParams.QT, "/get")
if (isEmpty(reqParams.get(CommonParams.QT))) reqParams.set(CommonParams.QT, "/get")
reqParams.set("ids", ids.toArray: _*)
loadBalanceRequest(RequestContext(new QueryRequest(reqParams))).map(_._1).map(_.getResults)
}

private def isEmpty(s: String): Boolean = s == null || s.isEmpty

private def loadBalanceRequest[T <: SolrResponse : SolrResponseFactory](requestContext: RequestContext[T]): Future[(T, SolrServer)] = {
loadBalancer.solrServer(requestContext.r, requestContext.preferred) match {
case Success(solrServer) =>
Expand Down