Class: Elasticsearch::DSL::Search::Queries::MoreLikeThis

Inherits:
Object
  • Object
show all
Includes:
BaseComponent
Defined in:
lib/elasticsearch/dsl/search/queries/more_like_this.rb

Overview

A query which returns documents which are similar to the specified text or documents

Examples:

Find documents similar to the provided text


search do
  query do
    more_like_this do
      like   ['Eyjafjallajökull']
      fields [:title, :abstract, :content]
    end
  end
end

Find documents similar to the specified documents


search do
  query do
    more_like_this do
      like   [{_id: 1}, {_id: 2}, {_id: 3}]
      fields [:title, :abstract]
    end
  end
end

See Also:

Method Summary

Methods included from BaseComponent

included, #initialize