class Qiita::Elasticsearch::HierarchalToken

Public Instance Methods

to_hash() click to toggle source

@return [Hash]

# File lib/qiita/elasticsearch/hierarchal_token.rb, line 7
def to_hash
  {
    "bool" => {
      "should" => [
        {
          "prefix" => {
            @field_name => proper_cased_term + "/",
          },
        },
        {
          "term" => {
            @field_name => proper_cased_term,
          },
        },
      ],
    },
  }
end