Module: Europeana::Blacklight::Document::MoreLikeThis

Included in:
Europeana::Blacklight::Document
Defined in:
app/models/europeana/blacklight/document/more_like_this.rb

Overview

Methods for obtaining “more like this” documents

Instance Method Summary collapse

Instance Method Details

#more_like_this_query(param = nil) ⇒ String

Parameters:

  • param (String) (defaults to: nil)

    Name of API parameter to restrict query to

Returns:

  • (String)


9
10
11
12
13
14
# File 'app/models/europeana/blacklight/document/more_like_this.rb', line 9

def more_like_this_query(param = nil)
  queries = more_like_this_field_queries(param)
  return nil unless queries.size > 0
  field_queries = queries.join(' OR ')
  "(#{field_queries}) NOT europeana_id:\"#{self.id}\""
end