Browse files

Start adding support to query builder for custom score script

  • Loading branch information...
1 parent b2d11b0 commit b388db1f867cb8ec15c9f191873f7fe02e7f7dde @holdenk holdenk committed May 22, 2012
View
173 src/main/scala/com/foursquare/slashem/QueryBuilder.scala
@@ -31,10 +31,16 @@ abstract sealed class StrictQualityFilter extends QualityFilter
trait FacetCount
abstract sealed class MinimumFacetCount extends FacetCount
abstract sealed class NoMinimumFacetCount extends FacetCount
+//We need to make sure that we can generate the correct score script
+//for ES
+trait ScoreType
+abstract sealed class NoScoreModifiers extends ScoreType
+abstract sealed class ScoreScript extends ScoreType
+abstract sealed class NativeScoreScript extends ScoreType
case class FacetSettings(facetFieldList: List[Field], facetMinCount: Option[Int], facetLimit: Option[Int])
-case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, MinFacetCount <: FacetCount, FacetLimit](
+case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, MinFacetCount <: FacetCount, FacetLimit, ST <: ScoreType](
meta: M with SlashemSchema[M],
clauses: AbstractClause, // Like AndCondition in MongoHelpers
filters: List[AbstractClause],
@@ -50,6 +56,7 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
queryType: Option[String],
fieldsToFetch: List[String],
facetSettings: FacetSettings,
+ customScoreScript: Option[String],
hls: Option[String],
hlFragSize: Option[Int],
creator: Option[(Pair[Map[String,Any],
@@ -62,14 +69,14 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
val DefaultStart = 0
import Helpers._
- def and(c: M => AbstractClause): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def and(c: M => AbstractClause): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
clauses match{
case AndClause(elements) => this.copy(meta=meta,clauses=AndClause(c(meta)::elements))
case _ => this.copy(meta=meta,clauses=AndClause(List(c(meta),clauses)))
}
}
- def or(c: M => AbstractClause): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def or(c: M => AbstractClause): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
clauses match{
case OrClause(elements) => this.copy(meta=meta,clauses=OrClause(c(meta)::elements))
case _ => this.copy(meta=meta,clauses=OrClause(List(c(meta),clauses)))
@@ -81,18 +88,18 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
*have a separate cache. Filter queries are great for queries that are repeated often which
*you want to constrain your result set by.
* @param f The query to filter on */
- def filter[F](f: M => Clause[F]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def filter[F](f: M => Clause[F]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(filters=f(meta)::filters)
}
- def orFilter[F](f: M => Clause[F]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def orFilter[F](f: M => Clause[F]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
filters match {
case Nil => this.copy(filters=f(meta)::filters)
case x::xs => this.copy(filters=OrClause(List(f(meta),x))::xs)
}
}
/** Add a comment */
- def addComment(s: String): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def addComment(s: String): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
comment match {
case None => this.copy(comment=Some(s))
case Some(a) => this.copy(comment=Some(s + a))
@@ -103,7 +110,7 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
/** A boostQuery affects the scoring of the results.
@param f The boost query
*/
- def boostQuery[F](f: M => Clause[F]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def boostQuery[F](f: M => Clause[F]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(boostQueries=f(meta) :: boostQueries)
}
@@ -131,7 +138,7 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
/** Select into a case class */
- def selectCase [F1, CC](f: M => SlashemField[F1, M], create: Option[F1] => CC)(implicit ev: (Y,H) =:= (NoSelect,NoHighlighting)): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, CC](f: M => SlashemField[F1, M], create: Option[F1] => CC)(implicit ev: (Y,H) =:= (NoSelect,NoHighlighting)): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Name: String = f(meta).name
val f1Field: SlashemField[F1, M] = f(meta)
val transformer = Some(((doc: Pair[Map[String,Any],Option[Map[String,ArrayList[String]]]]) => {
@@ -140,10 +147,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
QueryBuilder(meta, clauses, filters, boostQueries, queryFields,
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType, (f1Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, CC](f: M => SlashemField[F1, M], create: (Option[F1], List[String]) => CC)(implicit ev: (Y,H) =:= (NoSelect,YesHighlighting)): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, CC](f: M => SlashemField[F1, M], create: (Option[F1], List[String]) => CC)(implicit ev: (Y,H) =:= (NoSelect,YesHighlighting)): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Name: String = f(meta).name
val f1Field: SlashemField[F1, M] = f(meta)
val transformer = Some(((doc: Pair[Map[String,Any],Option[Map[String,ArrayList[String]]]]) => {
@@ -153,44 +160,44 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
QueryBuilder(meta, clauses, filters, boostQueries, queryFields,
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType, (f1Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Where you want to start fetching results back from
* @param s Where you want to start fetching results from. */
- def start(s: Long): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def start(s: Long): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(start=Some(s))
}
/** Limit the query to only fetch back l results.
* Can only be applied to a query without an existing limit
* @param l The limit */
- def limit(l: Int)(implicit ev: Lim =:= Unlimited): QueryBuilder[M, Ord, Limited, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def limit(l: Int)(implicit ev: Lim =:= Unlimited): QueryBuilder[M, Ord, Limited, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(limit=Some(l))
}
/** Turn on highlighting. Must be done prior to select case
*/
def highlighting()(implicit ev: (Y,H) =:= (NoSelect,NoHighlighting)):
- QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinFacetCount, FacetLimit] = {
+ QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(hls=Some("on"))
}
def highlighting(fragSize: Int)(implicit ev: (Y,H) =:= (NoSelect,NoHighlighting)):
- QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinFacetCount, FacetLimit] = {
+ QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(hls=Some("on"), hlFragSize = Some(fragSize))
}
/** Add a field based facet */
- def facetField[F](f: M => SlashemField[F,M]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def facetField[F](f: M => SlashemField[F,M]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(facetSettings=facetSettings.copy(facetFieldList=Field(f(meta).name)::facetSettings.facetFieldList))
}
/** Set a minimum facet match count
* Not supported with elastic search
*/
def minimumFacetCount(mfc: Int)(implicit ev: (MinFacetCount) =:= (NoMinimumFacetCount)):
- QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinimumFacetCount, FacetLimit] = {
+ QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinimumFacetCount, FacetLimit, ST] = {
this.copy(facetSettings=facetSettings.copy(facetMinCount=Some(mfc)))
}
@@ -200,20 +207,20 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
* In Solr defaults to 100
*/
def facetLimit(limit: Int)(implicit ev: FacetLimit =:= Unlimited):
- QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinFacetCount, Limited] = {
+ QueryBuilder[M, Ord, Lim, MM, Y, YesHighlighting, Q, MinFacetCount, Limited, ST] = {
this.copy(facetSettings=facetSettings.copy(facetLimit=Some(limit)))
}
/** Turn on quality filtering.
*/
- def qualityFilter(f: Double,m: Int)(implicit ev: Q =:= NoQualityFilter): QueryBuilder[M, Ord, Lim, MM, Y, H, StrictQualityFilter, MinFacetCount, FacetLimit] = {
+ def qualityFilter(f: Double,m: Int)(implicit ev: Q =:= NoQualityFilter): QueryBuilder[M, Ord, Lim, MM, Y, H, StrictQualityFilter, MinFacetCount, FacetLimit, ST] = {
this.copy(fallOf=Some(f),min=Some(m))
}
/** In edismax the score is max({scores})+tieBreak*\sum{scores}) */
- def tieBreaker(t: Double): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def tieBreaker(t: Double): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(tieBreaker=Some(t))
}
@@ -222,33 +229,33 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
/** Order the results by a specific field in ascending order.
* Can only be applied to an unordered query.
* @param f Field to order by */
- def orderAsc[F](f: M => SlashemField[F, M])(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def orderAsc[F](f: M => SlashemField[F, M])(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
QueryBuilder(meta, clauses, filters, boostQueries, queryFields, phraseBoostFields,
boostFields, start, limit, tieBreaker,
sort=Some(Field(f(meta).name), "asc"), minimumMatch, queryType, fieldsToFetch,
- facetSettings, hls, hlFragSize, creator, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, creator, comment, fallOf, min)
}
/** Order the results by a specific field in descending order.
* Can only be applied to an unordered query.
* @param f Field to order by */
- def orderDesc[F](f: M => SlashemField[F, M])(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def orderDesc[F](f: M => SlashemField[F, M])(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
QueryBuilder(meta, clauses, filters, boostQueries, queryFields, phraseBoostFields, boostFields,
start, limit, tieBreaker, sort=Some(Field(f(meta).name), "desc"),
- minimumMatch, queryType, fieldsToFetch, facetSettings, hls, hlFragSize, creator, comment, fallOf, min)
+ minimumMatch, queryType, fieldsToFetch, facetSettings, customScoreScript, hls, hlFragSize, creator, comment, fallOf, min)
}
/** Handle a more complex field sort */
- def complexOrderAsc(f: M => ScoreBoost)(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def complexOrderAsc(f: M => ScoreBoost)(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
QueryBuilder(meta, clauses, filters, boostQueries, queryFields, phraseBoostFields, boostFields,
start, limit, tieBreaker, sort=Some(f(meta), "asc"),
- minimumMatch, queryType, fieldsToFetch, facetSettings, hls, hlFragSize, creator, comment, fallOf, min)
+ minimumMatch, queryType, fieldsToFetch, facetSettings, customScoreScript, hls, hlFragSize, creator, comment, fallOf, min)
}
/** Handle a more complex field sort */
- def complexOrderDesc(f: M => ScoreBoost)(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def complexOrderDesc(f: M => ScoreBoost)(implicit ev: Ord =:= Unordered): QueryBuilder[M, Ordered, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
QueryBuilder(meta, clauses, filters, boostQueries, queryFields, phraseBoostFields, boostFields,
start, limit, tieBreaker, sort=Some(f(meta), "desc"),
- minimumMatch, queryType, fieldsToFetch, facetSettings, hls, hlFragSize, creator, comment, fallOf, min)
+ minimumMatch, queryType, fieldsToFetch, facetSettings, customScoreScript, hls, hlFragSize, creator, comment, fallOf, min)
}
@@ -258,7 +265,7 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
* terms to match.
* You can only use one of minimumMatchAbsolute or minimumMatchPercent.
* @param percent The minimum percent of tokens to match */
- def minimumMatchPercent(percent: Int)(implicit ev: MM =:= defaultMM): QueryBuilder[M, Ord, Lim, customMM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def minimumMatchPercent(percent: Int)(implicit ev: MM =:= defaultMM): QueryBuilder[M, Ord, Lim, customMM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(minimumMatch=Some(percent.toString+"%"))
}
@@ -267,14 +274,14 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
* to match. Note: You must chose one or the other.
* @param count The minimum number of tokens to match
*/
- def minimumMatchAbsolute(count: Int)(implicit ev: MM =:= defaultMM): QueryBuilder[M, Ord, Lim, customMM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def minimumMatchAbsolute(count: Int)(implicit ev: MM =:= defaultMM): QueryBuilder[M, Ord, Lim, customMM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(minimumMatch=Some(count.toString))
}
/** Set the query type. This corresponds to the "defType" field.
* Some sample values include "edismax" , "dismax" or just empty to use
* the default query type
* @param qt The query type */
- def useQueryType(qt: String): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] ={
+ def useQueryType(qt: String): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] ={
this.copy(queryType=Some(qt))
}
@@ -284,14 +291,14 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
* query parser)
* @param f The field to query
* @param boost The (optional) amount to boost the query weight for the provided field */
- def queryField[F](f: M => SlashemField[F,M], boost: Double = 1): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] ={
+ def queryField[F](f: M => SlashemField[F,M], boost: Double = 1): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] ={
this.copy(queryFields=WeightedField(f(meta).queryName,boost)::queryFields)
}
/** Same as queryField but takes a list of fields.
* @param fs A list of fields to query
* @param boost The (optional) amount to boost the query weight for the provided field */
- def queryFields(fs: List[M => SlashemField[_,M]], boost: Double = 1): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] ={
+ def queryFields(fs: List[M => SlashemField[_,M]], boost: Double = 1): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] ={
this.copy(queryFields=fs.map(f => WeightedField(f(meta).queryName,boost))++queryFields)
}
@@ -309,34 +316,34 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
* @param pf Enable/disable full phrase boosting
* @param pf2 Enable/disable 2-word shingle phrase boosting
* @param pf3 Enable/disable 3-word shingle phrase boosting */
- def phraseBoost[F](f: M => SlashemField[F,M], boost: Double = 1, pf: Boolean = true, pf2: Boolean = true, pf3: Boolean = true): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] ={
+ def phraseBoost[F](f: M => SlashemField[F,M], boost: Double = 1, pf: Boolean = true, pf2: Boolean = true, pf3: Boolean = true): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] ={
this.copy(phraseBoostFields=PhraseWeightedField(f(meta).name,boost,pf,pf2,pf3)::phraseBoostFields)
}
/** Specify a field to be retrieved. If you want to get back all fields you
* can use a field of name "*"
* @param f Field to be retrieved */
- def fetchField[F](f: M => SlashemField[F,M]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def fetchField[F](f: M => SlashemField[F,M]): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(fieldsToFetch=f(meta).name::fieldsToFetch)
}
/** Same as fetchField but takes multiple fields
* @param fs List of fields to be retrieved */
- def fetchFields(fs: (M => SlashemField[_,M])*): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def fetchFields(fs: (M => SlashemField[_,M])*): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(fieldsToFetch=fs.map(f=> f(meta).name).toList++fieldsToFetch)
}
/** Boost a specific field/query. WARNING: NOT TYPE SAFE NO VALIDATION ETC. */
- def boostField(s: String): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def boostField(s: String): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(boostFields=WeightedField(s,1)::boostFields)
}
/** Boost a field (type safe version) */
- def boostField[F](f: M => SlashemField[F,M], boost: Double = 1): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def boostField[F](f: M => SlashemField[F,M], boost: Double = 1): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(boostFields=WeightedField(f(meta).name,boost)::boostFields)
}
/** Handle a more complex field boost */
- def scoreBoostField(f: M => ScoreBoost): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit] = {
+ def scoreBoostField(f: M => ScoreBoost): QueryBuilder[M, Ord, Lim, MM, Y, H, Q, MinFacetCount, FacetLimit, ST] = {
this.copy(boostFields=f(meta)::boostFields)
}
@@ -398,7 +405,7 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
//Auto generated code, is there a better way to do this?
/** Select into a case class */
- def selectCase [F1, F2, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M], create: (Option[F1], List[String] ,Option[F2], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M], create: (Option[F1], List[String] ,Option[F2], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -415,10 +422,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M], create: (Option[F1], Option[F2]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M], create: (Option[F1], Option[F2]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -433,10 +440,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -458,10 +465,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M], create: (Option[F1], Option[F2], Option[F3]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M], create: (Option[F1], Option[F2], Option[F3]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -480,10 +487,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String] ,Option[F4], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String] ,Option[F4], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -510,10 +517,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M], create: (Option[F1], Option[F2], Option[F3], Option[F4]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M], create: (Option[F1], Option[F2], Option[F3], Option[F4]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -536,10 +543,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String] ,Option[F4], List[String] ,Option[F5], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String] ,Option[F4], List[String] ,Option[F5], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -571,10 +578,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -601,10 +608,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String] ,Option[F4], List[String] ,Option[F5], List[String] ,Option[F6], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M], create: (Option[F1], List[String] ,Option[F2], List[String] ,Option[F3], List[String] ,Option[F4], List[String] ,Option[F5], List[String] ,Option[F6], List[String]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -641,10 +648,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -675,10 +682,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -713,10 +720,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
phraseBoostFields, boostFields, start, limit, tieBreaker,
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -756,10 +763,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -803,10 +810,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -854,10 +861,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -909,10 +916,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -968,10 +975,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::f12Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -1031,10 +1038,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::f12Name::f13Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -1098,10 +1105,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::f12Name::f13Name::f14Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -1169,10 +1176,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
sort, minimumMatch, queryType,
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::f12Name::f13Name::f14Name::f15Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M],f16: M => SlashemField[F16, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15], Option[F16]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M],f16: M => SlashemField[F16, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15], Option[F16]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -1245,10 +1252,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::f12Name::f13Name::f14Name::f15Name::f16Name::
fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M],f16: M => SlashemField[F16, M],f17: M => SlashemField[F17, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15], Option[F16], Option[F17]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M],f16: M => SlashemField[F16, M],f17: M => SlashemField[F17, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15], Option[F16], Option[F17]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -1325,10 +1332,10 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::f12Name::f13Name::f14Name::f15Name::f16Name::
f17Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
/** Select into a case class */
- def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M],f16: M => SlashemField[F16, M],f17: M => SlashemField[F17, M],f18: M => SlashemField[F18, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15], Option[F16], Option[F17], Option[F18]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit] = {
+ def selectCase [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, CC](f1: M => SlashemField[F1, M],f2: M => SlashemField[F2, M],f3: M => SlashemField[F3, M],f4: M => SlashemField[F4, M],f5: M => SlashemField[F5, M],f6: M => SlashemField[F6, M],f7: M => SlashemField[F7, M],f8: M => SlashemField[F8, M],f9: M => SlashemField[F9, M],f10: M => SlashemField[F10, M],f11: M => SlashemField[F11, M],f12: M => SlashemField[F12, M],f13: M => SlashemField[F13, M],f14: M => SlashemField[F14, M],f15: M => SlashemField[F15, M],f16: M => SlashemField[F16, M],f17: M => SlashemField[F17, M],f18: M => SlashemField[F18, M], create: (Option[F1], Option[F2], Option[F3], Option[F4], Option[F5], Option[F6], Option[F7], Option[F8], Option[F9], Option[F10], Option[F11], Option[F12], Option[F13], Option[F14], Option[F15], Option[F16], Option[F17], Option[F18]) => CC)(implicit ev: Y =:= NoSelect): QueryBuilder[M, Ord, Lim, MM, CC, H, Q, MinFacetCount, FacetLimit, ST] = {
val f1Field : SlashemField[F1, M] = f1(meta)
val f1Name : String = f1Field.queryName
@@ -1409,7 +1416,7 @@ case class QueryBuilder[M <: Record[M], Ord, Lim, MM <: MinimumMatchType, Y, H <
(f1Name::f2Name::f3Name::f4Name::f5Name::f6Name::f7Name::f8Name::
f9Name::f10Name::f11Name::f12Name::f13Name::f14Name::f15Name::f16Name::
f17Name::f18Name::fieldsToFetch).distinct,
- facetSettings, hls, hlFragSize, transformer, comment, fallOf, min)
+ facetSettings, customScoreScript, hls, hlFragSize, transformer, comment, fallOf, min)
}
}
object Helpers {
View
29 src/main/scala/com/foursquare/slashem/Schema.scala
@@ -460,29 +460,30 @@ trait SlashemSchema[M <: Record[M]] extends Record[M] {
}
- def where[F](c: M => Clause[F]): QueryBuilder[M, Unordered, Unlimited, defaultMM, NoSelect, NoHighlighting, NoQualityFilter, NoMinimumFacetCount, Unlimited] = {
+ def where[F](c: M => Clause[F]): QueryBuilder[M, Unordered, Unlimited, defaultMM, NoSelect, NoHighlighting, NoQualityFilter, NoMinimumFacetCount, Unlimited, NoScoreModifiers] = {
QueryBuilder(self, c(self), filters=Nil, boostQueries=Nil, queryFields=Nil,
phraseBoostFields=Nil, boostFields=Nil, start=None, limit=None,
tieBreaker=None, sort=None, minimumMatch=None ,queryType=None,
fieldsToFetch=Nil, facetSettings=FacetSettings(facetFieldList=Nil,
facetMinCount=None,
facetLimit=None),
- hls=None, hlFragSize=None, creator=None, comment=None, fallOf=None, min=None)
+ customScoreScript=None, hls=None, hlFragSize=None, creator=None,
+ comment=None, fallOf=None, min=None)
}
- def query[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](timeout: Duration, qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim]): SearchResults[M, Y]
- def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim]): Future[SearchResults[M, Y]]
+ def query[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](timeout: Duration, qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST]): SearchResults[M, Y]
+ def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST]): Future[SearchResults[M, Y]]
}
trait ElasticSchema[M <: Record[M]] extends SlashemSchema[M] {
self: M with SlashemSchema[M] =>
def meta: ElasticMeta[M]
- def query[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](timeout: Duration, qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim]):
+ def query[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](timeout: Duration, qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST]):
SearchResults[M, Y] = {
queryFuture(qb, Some(timeout))(timeout)
}
- def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim]):
+ def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST]):
Future[SearchResults[M, Y]] = {
elasticQueryFuture(qb, buildElasticQuery(qb), None)
}
@@ -491,12 +492,12 @@ trait ElasticSchema[M <: Record[M]] extends SlashemSchema[M] {
* @qb: The query builder representing the query to be executed
* @timeoutOpt: An option type that requests a server side timeout for the query
*/
- def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim], timeoutOpt: Option[Duration]):
+ def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST], timeoutOpt: Option[Duration]):
Future[SearchResults[M, Y]] = {
elasticQueryFuture(qb, buildElasticQuery(qb), timeoutOpt)
}
- def elasticQueryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim], query: ElasticQueryBuilder, timeoutOpt: Option[Duration]): Future[SearchResults[M, Y]] = {
+ def elasticQueryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST], query: ElasticQueryBuilder, timeoutOpt: Option[Duration]): Future[SearchResults[M, Y]] = {
val esfp = meta.executorServiceFuturePool
val searchResultsFuture = esfp {
@@ -613,7 +614,7 @@ trait ElasticSchema[M <: Record[M]] extends SlashemSchema[M] {
Response(this, creator, hitCount, start, docs,
fallOff=fallOff, min=min, fieldFacet))
}
- def buildElasticQuery[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim]): ElasticQueryBuilder = {
+ def buildElasticQuery[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST]): ElasticQueryBuilder = {
val baseQuery: ElasticQueryBuilder= qb.clauses.elasticExtend(qb.queryFields,
qb.phraseBoostFields,
qb.minimumMatch)
@@ -676,16 +677,16 @@ trait SolrSchema[M <: Record[M]] extends SlashemSchema[M] {
def meta: SolrMeta[M]
// 'Where' is the entry method for a SolrRogue query.
- def queryParams[Ord, Lim, MM <: MinimumMatchType, Select, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Select, H, Q, FC, FLim]): Seq[(String, String)] = queryParamsWithBounds(qb,qb.start, qb.limit)
+ def queryParams[Ord, Lim, MM <: MinimumMatchType, Select, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Select, H, Q, FC, FLim, ST]): Seq[(String, String)] = queryParamsWithBounds(qb,qb.start, qb.limit)
- def queryParamsWithBounds[Ord, Lim, MM <: MinimumMatchType, Select, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Select, H, Q, FC, FLim], qstart: Option[Long], qrows: Option[Long]): Seq[(String,String)] = {
+ def queryParamsWithBounds[Ord, Lim, MM <: MinimumMatchType, Select, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Select, H, Q, FC, FLim, ST], qstart: Option[Long], qrows: Option[Long]): Seq[(String,String)] = {
val bounds = List(("start" -> (qstart.getOrElse {qb.DefaultStart}).toString),
("rows" -> (qrows.getOrElse {qb.DefaultLimit}).toString))
bounds ++ queryParamsNoBounds(qb)
}
//This is the part which generates most of the solr request
- def queryParamsNoBounds[Ord, Lim, MM <: MinimumMatchType, Select, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Select, H, Q, FC, FLim]): Seq[(String,String)] = {
+ def queryParamsNoBounds[Ord, Lim, MM <: MinimumMatchType, Select, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Select, H, Q, FC, FLim, ST]): Seq[(String,String)] = {
//The actual query
val p = List(("q" -> qb.clauses.extend))
@@ -761,12 +762,12 @@ trait SolrSchema[M <: Record[M]] extends SlashemSchema[M] {
}
- def query[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](timeout: Duration, qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim]):
+ def query[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](timeout: Duration, qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST]):
SearchResults[M, Y] = {
queryFuture(qb)(timeout)
}
- def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim]):
+ def queryFuture[Ord, Lim, MM <: MinimumMatchType, Y, H <: Highlighting, Q <: QualityFilter, FC <: FacetCount, FLim, ST <: ScoreType](qb: QueryBuilder[M, Ord, Lim, MM, Y, H, Q, FC, FLim, ST]):
Future[SearchResults[M, Y]] = {
solrQueryFuture(qb.creator, queryParams(qb), qb.fieldsToFetch, qb.fallOf, qb.min)
}

0 comments on commit b388db1

Please sign in to comment.