Noosfero/noosfero

View on GitHub
plugins/elasticsearch/lib/nested_helper/profile.rb

Summary

Maintainability
A
0 mins
Test Coverage
module NestedProfile
  def self.hash
    {
      id: { type: :integer },
      visible: { type: :boolean },
      public_profile: { type: :boolean }
    }
  end

  def self.filter
    {
      query: {
        nested: {
          path: "profile",
          query: {
            bool: {
              must: [
                { term: { "profile.visible" => true } },
                { term: { "profile.public_profile" => true } }
              ],
            }
          }
        }
      }
    }
  end
end