Log in
Helper

Data

Magento\Search\Helper\Data

What it does

This helper class provides utility methods for search functionality in Magento 2, including query validation, URL generation, and query text processing.

Developers use it to validate search query length constraints, retrieve search-related URLs (results, suggestions, terms), and handle search query text escaping and preparation.

It's commonly used in search forms, controllers, and blocks that need to interact with search parameters and enforce configured query length limits.

Public Methods

  • isMinQueryLength()
  • getEscapedQueryText()
  • getResultUrl()
  • getSuggestUrl()
  • getSearchTermUrl()
  • getMinQueryLength()
  • getMaxQueryLength()
  • addNoteMessage()
  • setNoteMessages()
  • getNoteMessages()
  • checkNotes()
  • getQueryParamName()