* Change models and related files * Update controllers and specs * More renaming * Seek and destroy, I mean search and replace * Round up the stragglers * Ground control to Major Travis... * More fixes * PR feedback * Various fixes * Rename view * Fix list query builder * Unify request specs * Fix some API spec errors * Fix remaining API specs * Make spec conform to API * Fix leftover problems * Fix JS tests * Fix column name in select * Fix API specs * Fix search specs * Paging Mr. Travis
29 lines
813 B
Ruby
29 lines
813 B
Ruby
module Search
|
|
class Listing < Base
|
|
# We used to use both "classified listing" and "listing" throughout the app.
|
|
# We standardized on the latter in most places, but kept the index name here.
|
|
INDEX_NAME = "classified_listings_#{Rails.env}".freeze
|
|
INDEX_ALIAS = "classified_listings_#{Rails.env}_alias".freeze
|
|
MAPPINGS = JSON.parse(File.read("config/elasticsearch/mappings/listings.json"), symbolize_names: true).freeze
|
|
DEFAULT_PAGE = 0
|
|
DEFAULT_PER_PAGE = 75
|
|
|
|
class << self
|
|
private
|
|
|
|
def index_settings
|
|
if Rails.env.production?
|
|
{
|
|
number_of_shards: 2,
|
|
number_of_replicas: 1
|
|
}
|
|
else
|
|
{
|
|
number_of_shards: 1,
|
|
number_of_replicas: 0
|
|
}
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|