object SearchScoreExpression
- Annotations
- @Beta()
- Since
4.7
- See also
- Alphabetic
- By Inheritance
- SearchScoreExpression
- 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
- def addExpression(expressions: Iterable[_ <: SearchScoreExpression]): AddSearchScoreExpression
Returns a
SearchScoreExpression
that evaluates into the sum of the values of the specifiedexpressions
.Returns a
SearchScoreExpression
that evaluates into the sum of the values of the specifiedexpressions
.- expressions
The expressions whose values to add. Must contain at least two expressions.
- returns
The requested
SearchScoreExpression
.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def constantExpression(value: Float): ConstantSearchScoreExpression
Returns a
SearchScoreExpression
that evaluates into the specifiedvalue
.Returns a
SearchScoreExpression
that evaluates into the specifiedvalue
.- value
The value to use as the result of the expression. Unlike SearchScore.constant, does not have constraints.
- returns
The requested
SearchScoreExpression
.
- See also
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def gaussExpression(origin: Double, path: PathSearchScoreExpression, scale: Double): GaussSearchScoreExpression
Returns a
SearchScoreExpression
that represents a Gaussian function whose output is within the interval [0, 1].Returns a
SearchScoreExpression
that represents a Gaussian function whose output is within the interval [0, 1]. Roughly speaking, the further the value of thepath
expression is from theorigin
, the smaller the output of the function.The
scale
anddecay
are parameters of the Gaussian function, they define the rate at which the function decays. The input of the Gaussian function is the output of another function: max(0, abs(pathValue
-origin
) -offset
), wherepathValue
is the value of thepath
expression.- origin
The point of origin, see
GaussSearchScoreExpression.offset
. The value of the Gaussian function is 1 if the value of thepath
expression isorigin
.- path
The expression whose value is used to calculate the input of the Gaussian function.
- scale
The non-zero distance from the points
origin
±offset
at which the output of the Gaussian function must decay by the factor ofdecay
.- returns
The requested
SearchScoreExpression
.
- 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
- def log1pExpression(expression: SearchScoreExpression): Log1pSearchScoreExpression
Returns a
SearchScoreExpression
that evaluates into log10(expressionValue
+ 1), whereexpressionValue
is the value of theexpression
.Returns a
SearchScoreExpression
that evaluates into log10(expressionValue
+ 1), whereexpressionValue
is the value of theexpression
.- expression
The expression whose value is used to calculate the input of the log10 function.
- returns
The requested
SearchScoreExpression
.
- def logExpression(expression: SearchScoreExpression): LogSearchScoreExpression
Returns a
SearchScoreExpression
that evaluates into log10(expressionValue
), whereexpressionValue
is the value of theexpression
.Returns a
SearchScoreExpression
that evaluates into log10(expressionValue
), whereexpressionValue
is the value of theexpression
.- expression
The expression whose value is the input of the log10 function.
- returns
The requested
SearchScoreExpression
.
- def multiplyExpression(expressions: Iterable[_ <: SearchScoreExpression]): MultiplySearchScoreExpression
Returns a
SearchScoreExpression
that evaluates into the product of the values of the specifiedexpressions
.Returns a
SearchScoreExpression
that evaluates into the product of the values of the specifiedexpressions
.- expressions
The expressions whose values to multiply. Must contain at least two expressions.
- returns
The requested
SearchScoreExpression
.
- 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(expression: Bson): SearchScoreExpression
Creates a
SearchScoreExpression
from aBson
in situations when there is no builder method that better satisfies your needs.Creates a
SearchScoreExpression
from aBson
in 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 equivalentSearchScoreExpression
s, though they may not be equal.val expression1: SearchScoreExpression = SearchScoreExpression.pathExpression( SearchPath.fieldPath("fieldName")) .undefined(-1.5f) val expression2: SearchScoreExpression = SearchScoreExpression.of(Document("path" -> Document("value" -> SearchPath.fieldPath("fieldName").toValue, "undefined" -> -1.5)))
- expression
A
Bson
representing the requiredSearchScoreExpression
.- returns
The requested
SearchScoreExpression
.
- def pathExpression(path: FieldSearchPath): PathSearchScoreExpression
Returns a
SearchScoreExpression
that evaluates into the value of the specified field.Returns a
SearchScoreExpression
that evaluates into the value of the specified field.- path
The numeric field whose value to use as the result of the expression.
- returns
The requested
SearchScoreExpression
.
- See also
SearchScore.boost(FieldSearchPath)
- def relevanceExpression(): RelevanceSearchScoreExpression
Returns a
SearchScoreExpression
that evaluates into the relevance score of a document.Returns a
SearchScoreExpression
that evaluates into the relevance score of a document.- returns
The requested
SearchScoreExpression
.
- 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: