12 replies [Last post]
birchy82's picture
Offline
Joined: 05/22/2009
Juice: 22

I have searched all over the place on how to do this. I figured out a way that worked for me and hopefully this will help others.

This is done with all of the latest modules.

1. Create a view, name it whatever you want. Add the display type as a page. Give it the path of 'search/node'. Although I don't think this makes a difference, since you are making your own search form and not using the standard one.
2. Add the following filters. Search: Terms, make that optional, and expose it( This is your search form). Node: Published (good practice). Node: Type, and select the types of nodes you would like to search.
3. Fields: add the product image fields, price, title, etc.
4. Sort Criteria, I sorted it by the date the node was added.
5. Basic settings, you want to put exposed forms in a block so make this yes, then once you save it you will notice you have a block now on your block section of your admin, with only the exposed form you created in it.

Thats it really. So any questions feel free to ask.

Old Man's picture
Offline
Joined: 02/23/2010
Juice: 20
PERFECT!

I tried other solutions, and none worked nearly as well. Thank you for the instructions. A picture of the search results is attached.

Two problems or questions if anyone can help with it.

First question, is how to get views to include all products found searching with "Dream" to be found with "Dreams". In other words, if a user searches for products with the description "Dream" it should also show products with the description "Dreams" or "Dreaming".

Second question, in the product description there are product grouping based on Designer Style. What I mean is, fabrics will be grouped by color and style, such as "Wild Horses." All fabrics within this grouping are style and color coordinated. What I want to be able to do is have this grouping linked as key words for the product search so that someone clicks on the link and it will use those terms for the product search view that I created. Taxonomy doesn't give me the view I am looking for.

Thank you for the help!

AttachmentSize
Product Search View.jpg 103.95 KB
birchy82's picture
Offline
Joined: 05/22/2009
Juice: 22
Re: PERFECT!

I ran into the same problem. I can't figure out how to do that, with mine you can also type in any words that are in the description too into the search and it will show up. But here is what my search page looks like

AttachmentSize
screen-capture-4.png 633.36 KB
jonstewart's picture
Offline
Joined: 03/25/2010
Juice: 10
Variations in words

That's called stemming.
If you search in drupal for stemming (in modules) you'll find the Porter-Stemmer (and some for languages other than English)

However, the remaining question I don't know the answer to is whether the stemming is applied to views searches!

Cheers
Jon

Old Man's picture
Offline
Joined: 02/23/2010
Juice: 20
Well now, where were you a month ago!

Thank you so much for that module info! I just read at least count there are over 5,000 active Drupal modules, and it's so difficult to find what you need. I've posted this info in a couple forums and haven't received a useful reply.

That really helps. Thank you!

jonstewart's picture
Offline
Joined: 03/25/2010
Juice: 10
Oh, I know

Glad it was of help.

I've been at this a while, and it's a bit like WoW: very likely you've not seen everywhere yet! ...or will

Sometimes it's nice to pick a random starting point within modules and just browse for a while (I find myself saying 'That's how you do that' or similar.

Cheers
Jon

stephthegeek's picture
Offline
Theminator
Joined: 10/20/2007
Juice: 575
Re: Oh, I know

PS. this is a fast way to find modules: http://drupalmodules.com/module-finder

Gorgeous original Drupal themes (and Ubercart themes!) ~ Psst: more Ubercart themes on our new site

george@dynapres.nl's picture
Offline
Joined: 01/02/2008
Juice: 202
Order by Search Score

Thanks for the pointer. Using Views makes the searching config for products much more flexible without have to resort to (additional) theming. Note that you can order by "Search Score" as well as by modification or creation date.

---
George on Drupal

Qwert302's picture
Offline
Joined: 08/10/2010
Juice: 11
Re: How to: Custom Catalog Product Search

I am getting a ton of duplicates using this method. Any ideas? Search terms does not have a reduce duplicates option like taxonomy does.

buysnakewine's picture
Offline
Joined: 03/31/2009
Juice: 104
Solution ?

Hi, did you find a solution for the duplicate problem ?

Thanks.

moondrop's picture
Offline
Joined: 03/24/2010
Juice: 253
change search box style??

The views search results works great! Thanks for sharing, but how do we change the style of the actual search box. I'm using acquia prosper theme and i love the look of their search box (hope to be able to make it look similar).

Also, if a user searches for something that doesn't have any results, it just displays a blank page...how do we fix that? any solutions?

thanks,

chrishutcheson's picture
Offline
Joined: 01/05/2011
Juice: 16
Not working for me

I've tried the setup, installed the stemmer module, and am not getting any different results from the regular search - other than a better layout in Views.

The site is http://thesurgicalroom.ca

Here's an example of the problem we're having:

- search for "helicote" works
- Search for "heli" does not produce any results
- search for "helict" does

All modules, etc. are current. I've rebuilt the index and cron is running. I have now downloaded the uc_productsearch module and it appears to work, but I'd like to resolve this problem with views, just so I know what I'm missing/should be doing if this comes up again in the future.

daamy's picture
Offline
Joined: 02/07/2011
Juice: 24
Thank you for the post. I

Thank you for the post.
I didn't know about the exposed forms before.
It is great.