Search code examples
phpdrupaldrupal-7drupal-modulesubercart

How to make %LIKE% search in Drupal 7


I got Drupal 7 and ubercart installed. I'm using standart shaerch engine. How can i search in my store using queries like this:

SELECT * FROM table WHERE product_desc LIKE %search_word%

What files i need to change to search with part-words?


Solution

  • The core search module only does exact match search. You could try the Porter-Stemmer module to get the "LIKE" search if your site is English language only.

    A more flexible approach would be to use the Views module and create a search form that is for your products. Performance would be better and you could easily extend the functionality in the future.