Module: Workarea::Search::Storefront::Product::Text
- Included in:
- Workarea::Search::Storefront::Product
- Defined in:
- app/models/workarea/search/storefront/product/text.rb
Instance Method Summary collapse
- #catalog_content ⇒ Object
-
#category_names ⇒ String
A list of category names to which this product belongs, allows finding products by category names in search.
-
#details ⇒ String
Text from the product’s details hash and it’s variants’ details hash.
-
#details_content ⇒ String
A textual version of the product’s filters hash that will be stored and analyzed in the search index.
-
#facets_content ⇒ String
A textual version of the product’s filters hash that will be stored and analyzed in the search index.
-
#suggestion_content ⇒ String
Content to put in the index for making search query suggestions.
- #variant_details_text ⇒ Object
Instance Method Details
#catalog_content ⇒ Object
6 7 8 9 10 |
# File 'app/models/workarea/search/storefront/product/text.rb', line 6 def catalog_content [model.browser_title, model., model.description] .reject(&:blank?) .join(' ') end |
#category_names ⇒ String
A list of category names to which this product belongs, allows finding products by category names in search.
17 18 19 |
# File 'app/models/workarea/search/storefront/product/text.rb', line 17 def category_names categorization.to_models.map(&:name).join(', ') end |
#details ⇒ String
Text from the product’s details hash and it’s variants’ details hash. Allows finding a product by one of these values.
44 45 46 |
# File 'app/models/workarea/search/storefront/product/text.rb', line 44 def details "#{HashText.new(model.details).text} #{variant_details_text}" end |
#details_content ⇒ String
A textual version of the product’s filters hash that will be stored and analyzed in the search index.
35 36 37 |
# File 'app/models/workarea/search/storefront/product/text.rb', line 35 def details_content "#{HashText.new(model.details).text} #{variant_details_text}" end |
#facets_content ⇒ String
A textual version of the product’s filters hash that will be stored and analyzed in the search index.
26 27 28 |
# File 'app/models/workarea/search/storefront/product/text.rb', line 26 def facets_content HashText.new(model.filters).text end |
#suggestion_content ⇒ String
Content to put in the index for making search query suggestions. Includes all content for the product.
53 54 55 56 57 58 59 60 |
# File 'app/models/workarea/search/storefront/product/text.rb', line 53 def suggestion_content [ model.name, category_names, facets_content, details_content ].join(' ') end |