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

#   Help for search by keywords

##

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

Less More

- Posts: 78
- Thank you received: 6
-
-

2 years 4 months ago [\#362041](#362041) by [nico1979](/forum/user/31330-nico1979 "View nico1979's Profile")  *[Help for search by keywords](/forum/45-filters-search/908384-help-for-search-by-keywords#362041 "Hi, I'm trying to make a search field (text filed) that have the following behaviors. i.e. In a book shop there is a book with title &quot;The Lord of the Rings&quot; If I search for &quot;Lord Rings&quot;, at first will be displayed all books with both words (i.e. &quot;The Lord of the Rings - The two towers&quot; &quot;The Lord of the Rings - the fellowship of the ring&quot; etc.) in the title, than all books that contain any word (&quot;lord&quot; and &quot;rings&quot;). How is it possible? Thank you")* was created by *[nico1979](/forum/user/31330-nico1979 "View nico1979's Profile")*

Hi,
I'm trying to make a search field (text filed) that have the following behaviors.
i.e.
In a book shop there is a book with title "The Lord of the Rings"
If I search for "Lord Rings", at first will be displayed all books with both words (i.e. "The Lord of the Rings - The two towers" "The Lord of the Rings - the fellowship of the ring" etc.) in the title, than all books that contain any word ("lord" and "rings").
How is it possible?
Thank you
[ ![Schermata2024-07-12alle09.47.17.png](/forum/attachment/59483) ](/forum/attachment/59483 "...le09.47.17.png")

- [ ![Schermata2024-07-12alle09.47.17.png](/forum/attachment/59483) ](/forum/attachment/59483 "...le09.47.17.png") [ ](/forum/attachment/59483?download=1 "...le09.47.17.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzkwODM4NC1oZWxwLWZvci1zZWFyY2gtYnkta2V5d29yZHM/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

2 years 4 months ago [\#362044](#362044) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Help for search by keywords](/forum/45-filters-search/908384-help-for-search-by-keywords#362044 "Hi, I'm trying to make a search field (text filed) that have the following behaviors. i.e. In a book shop there is a book with title &quot;The Lord of the Rings&quot; If I search for &quot;Lord Rings&quot;, at first will be displayed all books with both words (i.e. &quot;The Lord of the Rings - The two towers&quot; &quot;The Lord of the Rings - the fellowship of the ring&quot; etc.) in the title, than all books that contain any word (&quot;lord&quot; and &quot;rings&quot;). How is it possible? Thank you")*

Hi,

It's not possible to combine both search processing modes. It's either both words, or any words. To be able to search with both modes to provide the products like you want, it would basically require running twice the products listing's main MySQL query and combine the results. This would require complex modifications to achieve, and slow the page processing, and cause issues with the pagination system.
I don't see an easy way to do that.
I think the simplest would be to directly modify the file components/com_hikashop/views/product/view.html.php in order to dynamically change the products listing loading query in the listing function to use a UNION of twice the same query, changing only the filters on the columns of the filter when the "every words" mode is selected.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ1LWZpbHRlcnMtc2VhcmNoLzkwODM4NC1oZWxwLWZvci1zZWFyY2gtYnkta2V5d29yZHM/dG1wbD1tYXJrZG93bg==) 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.053 seconds

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