Skip to content

Commit

Permalink
Bug fix. Remove duplicate photo shoot suggestions when multiple image…
Browse files Browse the repository at this point in the history
…s have the same photo shoot. Default behaviour changed since Elastic 1.

elastic/elasticsearch#22912
  • Loading branch information
Tony McCrae committed Jan 15, 2019
1 parent c4442f8 commit 0aeaffc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class ElasticSearch(val config: MediaApiConfig, mediaApiMetrics: MediaApiMetrics
}

override def completionSuggestion(name: String, q: String, size: Int)(implicit ex: ExecutionContext): Future[CompletionSuggestionResults] = {
val completionSuggestion = ElasticDsl.completionSuggestion(name).on(name).text(q)
val completionSuggestion = ElasticDsl.completionSuggestion(name).on(name).text(q).skipDuplicates(true)
executeAndLog(ElasticDsl.search(imagesAlias) suggestions completionSuggestion, "completion suggestion query").
toMetric(mediaApiMetrics.searchQueries, List(mediaApiMetrics.searchTypeDimension("suggestion-completion")))(_.result.took).map { r =>
val x = r.result.suggestions.get(name).map { suggestions =>
Expand Down

0 comments on commit 0aeaffc

Please sign in to comment.