Need some help with Metafields in Search and a Theme Code insertion

Topic summary

A user seeks help implementing metafield search functionality in Shopify’s default search field, specifically for the Momentum theme v3.1.1. They found sample code but don’t know where to insert it.

Initial Solution (Dawn Theme):

  • EBOOST provides detailed instructions for Dawn theme users
  • Code snippets target two files: main-search.liquid and predictive-search.liquid
  • Screenshots show exact placement locations

Key Limitations Identified:

  • The basic code only works with free Shopify themes
  • Paid/custom themes (Momentum, BeYours, Canopy) require theme-specific modifications
  • Code only searches first 20 products in collection
  • Only works with single text type metafields in custom namespace
  • Multiple metafield types require an app solution

Advanced Implementation:

  • ri31 provides more sophisticated code for Horizon theme
  • Solution prevents duplicate results by tracking native search handles
  • Includes case-insensitive matching and concatenation of multiple metafields
  • Emphasizes this is a conceptual framework, not copy-paste solution

Status: Discussion remains open with no universal solution. Users with paid themes need either custom coding knowledge or developer assistance to adapt the code for their specific theme structure.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hey!

Does this only work with your specific theme? It did not work for me. I am not really good with coding, so I do not understand whether I need to adapt the code snippet to include the name of the exact metafield and if so, how?

Any help is appreciated.