[Skip to main content](#vessel-content)

#   Filters - how to filter on a phrase?

##

- **[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")**
- [![rodfarrell's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/5859-rodfarrell "View rodfarrell's Profile") Topic Author
- [ Offline](/forum/user/5859-rodfarrell)

Less More

- Posts: 259
- Thank you received: 22
-
-

13 years 8 months ago [\#93039](#93039) by [rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")  *[Filters - how to filter on a phrase?](/forum/4-how-to/78966-filters-how-to-filter-on-a-phrase#93039 "I'm trying to create a &quot;search&quot; module based of a product filter. Where I am getting stuck is the vaguenes of the text filter which when entering a phrase like &quot;maths games&quot; returns all products...")* was created by *[rodfarrell](/forum/user/5859-rodfarrell "View rodfarrell's Profile")*

I'm trying to create a "search" module based of a product filter. Where I am getting stuck is the vaguenes of the text filter which when entering a phrase like "maths games" returns all products containing the word Maths plus all products containing the word Games. I want to return exact matches only ie. products with "Maths" &amp; "Games".

What is the best way to do this?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4OTY2LWZpbHRlcnMtaG93LXRvLWZpbHRlci1vbi1hLXBocmFzZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

13 years 8 months ago [\#93158](#93158) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Filters - how to filter on a phrase?](/forum/4-how-to/78966-filters-how-to-filter-on-a-phrase#93158 "I'm trying to create a &quot;search&quot; module based of a product filter. Where I am getting stuck is the vaguenes of the text filter which when entering a phrase like &quot;maths games&quot; returns all products...")*

That will require a hack of the filtering system as there is no option for that.

You need to change the line:
$terms = explode(' ',$infoGet[0]);

to:
$terms = array($infoGet[0]);

in the file administrator/components/com_hikashop/classes/filter.php so that the filtering system only match with the exact term entered.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4OTY2LWZpbHRlcnMtaG93LXRvLWZpbHRlci1vbi1hLXBocmFzZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Eliot](/forum/user/1824-eliot "View Eliot's Profile")**
- [![Eliot's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1824.png)](/forum/user/1824-eliot "View Eliot's Profile")
- [ Offline](/forum/user/1824-eliot)

Less More

- Posts: 2334
- Thank you received: 403
-
-

13 years 5 months ago [\#107630](#107630) by [Eliot](/forum/user/1824-eliot "View Eliot's Profile")  Replied by *[Eliot](/forum/user/1824-eliot "View Eliot's Profile")* on topic *[Filters - how to filter on a phrase?](/forum/4-how-to/78966-filters-how-to-filter-on-a-phrase#107630 "I'm trying to create a &quot;search&quot; module based of a product filter. Where I am getting stuck is the vaguenes of the text filter which when entering a phrase like &quot;maths games&quot; returns all products...")*

We just included a feature to handle this possibility.
It will be available in the next version.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc4OTY2LWZpbHRlcnMtaG93LXRvLWZpbHRlci1vbi1hLXBocmFzZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.047 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
