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_text 'Eyjafjallajökull'
      fields [:title, :abstract, :content]
    end
  end
end

Find documents similar to the specified documents


search do
  query do
    more_like_this do
      ids    [1, 2, 3]
      fields [:title, :abstract]
    end
  end
end

See Also:

Method Summary

Methods included from BaseComponent

included, #initialize