Joren
Joren

Reputation: 3297

Magento Custom Search Extension (external source) - sorting by relevance

I am currently building a fuzzy search extension for magento that gets its results from an external server.

The problem I am having is that after combining the external search results with the results from the Magento database select, I can't find a solution to sort/order the products in the collection object based on relevance values from an xml file. If anyone could help me with this I would be very pleased =)

Upvotes: 0

Views: 869

Answers (1)

FlorinelChis
FlorinelChis

Reputation: 1478

I am currently building a fuzzy search extension for magento that gets its results from an external server.

You can look a bit more into this, because Magento search using Solr or Elasticsearch does the same thing...

How Magento search works:

  • user inputs a search query
  • magento looks if there is a stored search result for that query (database tables: catalogsearch_query and catalogsearch_result)
  • if nothing is found, it performs the search query based on configuration (like, fulltext, solr, whatever is set for this)
  • stores the result ids and sort order in the proper tables (hint: catalogsearch_result); here you can find the relevance field
  • gets the saved results and displays them in the search result page

Your question shows no research whatsoever regarding the Magento standard search extension.

Upvotes: 3

Related Questions