Author Topic: Search for an entire word instead part of it  (Read 203 times)

eclipsada

  • Beginner
  • *
  • Posts: 22
Search for an entire word instead part of it
« on: December 14, 2017, 18:01:46 pm »
Hi,
Is there a way to make the search module to search only for a whole word instead of part of it?

Eg. If I search for...

..."Libra" (Libra dog food)
Results: fish food - "contém uma formula equiLIBRAda" ("contains a balanced formula")

"Sumo"
Results: Water feeder - "baixo conSUMO" (low energy consumption)

I get back many results that have nothing to do with the searched term.
It's annoying and confusing for customers.

Thank you.

eclipsada

  • Beginner
  • *
  • Posts: 22
Re: Search for an entire word instead part of it
« Reply #1 on: December 29, 2017, 19:10:56 pm »
No clues on this yet? :(

balai

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 1311
Re: Search for an entire word instead part of it
« Reply #2 on: December 29, 2017, 19:44:10 pm »
You have to change the search query in administrator/components/com_virtuemart/models/product.php
check inside the sortSearchListQuery function.

Btw. If you want to use a 3rd  party search which works in more sophisticated way and solves also this, try Custom Filters
https://breakdesigns.net/extensions/custom-filters