class SolrClient extends AnyRef
This is the simple Apache Solr client for Scala.
- Alphabetic
- By Inheritance
- SolrClient
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new SolrClient(url: String)(implicit factory: (String) ⇒ org.apache.solr.client.solrj.SolrClient = ..., parser: ExpressionParser = new DefaultExpressionParser())
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
add(docs: Any*): BatchRegister
Execute batch updating.
Execute batch updating.
Note: To register documents actual, you have to call commit after added them.
import jp.sf.amateras.solr.scala._ val client = new SolrClient("http://localhost:8983/solr") client.add(Map("id"->"001", "manu" -> "Lenovo", "name" -> "ThinkPad X201s")) .add(Map("id"->"002", "manu" -> "Lenovo", "name" -> "ThinkPad X202")) .add(Map("id"->"003", "manu" -> "Lenovo", "name" -> "ThinkPad X100e")) .commit
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
commit(): Unit
Commit the current session.
-
def
deleteById(id: String): Unit
Delete the document which has a given id.
Delete the document which has a given id.
- id
the identifier of the document to delete
-
def
deleteByQuery(query: String, params: Map[String, Any] = Map()): Unit
Delete documents by the given query.
Delete documents by the given query.
- query
the solr query to select documents which would be deleted
- params
the parameter map which would be given to the query
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
query(query: String): QueryBuilder
Search documents using the given query.
Search documents using the given query.
import jp.sf.amateras.solr.scala._ val client = new SolrClient("http://localhost:8983/solr") val result: List[Map[String, Any]] = client.query("*:*") .fields("id", "manu", "name") .sortBy("id", Order.asc) .getResultAsMap()
-
def
register(docs: Any*): Unit
Add documents and commit them immediately.
Add documents and commit them immediately.
- docs
documents to register
-
def
rollback(): Unit
Rolled back the current session.
-
def
shutdown(): Unit
Shutdown this solr client to release allocated resources.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withTransaction[T](operations: ⇒ T): T
Execute given operation in the transaction.
Execute given operation in the transaction.
The transaction is committed if operation was successful. But the transaction is rolled back if an error occurred.