object SearchScore
A modifier of the relevance score.
You may use the $meta: "searchScore" expression, e.g., via Projections.metaSearchScore,
to extract the relevance score assigned to each found document.
- Annotations
- @Beta()
- Since
4.7
- See also
- Alphabetic
- By Inheritance
- SearchScore
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def boost(path: FieldSearchPath): PathBoostSearchScore
Returns a
SearchScorethat instructs to multiply the score by the value of the specified field.Returns a
SearchScorethat instructs to multiply the score by the value of the specified field.- path
The numeric field whose value to multiply the score by.
- returns
The requested
SearchScore.
- def boost(value: Float): ValueBoostSearchScore
Returns a
SearchScorethat instructs to multiply the score by the specifiedvalue.Returns a
SearchScorethat instructs to multiply the score by the specifiedvalue.- value
The positive value to multiply the score by.
- returns
The requested
SearchScore.
- See also
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def constant(value: Float): ConstantSearchScore
Returns a
SearchScorethat instructs to replace the score with the specifiedvalue.Returns a
SearchScorethat instructs to replace the score with the specifiedvalue.- value
The positive value to replace the score with.
- returns
The requested
SearchScore.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def function(expression: SearchScoreExpression): FunctionSearchScore
Returns a
SearchScorethat instructs to compute the score using the specifiedexpression.Returns a
SearchScorethat instructs to compute the score using the specifiedexpression.- expression
The expression to use when calculating the score.
- returns
The requested
SearchScore.
- See also
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def of(score: Bson): SearchScore
Creates a
SearchScorefrom aBsonin situations when there is no builder method that better satisfies your needs.Creates a
SearchScorefrom aBsonin situations when there is no builder method that better satisfies your needs. This method cannot be used to validate the syntax.Example
The following code creates two functionally equivalentSearchScores, though they may not be equal.val score1: SearchScore = SearchScore.boost( SearchPath.fieldPath("fieldName")) val score2: SearchScore = SearchScore.of(Document("boost" -> Document("path" -> SearchPath.fieldPath("fieldName").toValue)))
- score
A
Bsonrepresenting the requiredSearchScore.- returns
The requested
SearchScore.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
This is the documentation for the MongoDB Scala driver.
Driver structure
The mongodb scala driver.
To get started you need a MongoClient instance, either from a connection string or via a org.mongodb.scala.MongoClientSettings.
Notable packages include: