Google Custom Search?
Permalink
I have a client that requires the following features that the built-in search for C5 apparently doesn't provide. They are:
1. Ability to search for key terms in PDF docs.
2. Indexed searches including, at a minimum, the following file types: .htm, .pdf, .txt,.rtf, .doc (all versions of Word docs)
3. Results with search terms or phrases in context.
Has anyone implemented something that extends the current search to include all of the above?
I was also thinking of just using Google Custom search. I couldn't find anyone discussing it's use on the forum in C5. Has anyone used it with any issues?
I'd be very interested in any advice on providing the above features to the client.
Thanks,
Doug
1. Ability to search for key terms in PDF docs.
2. Indexed searches including, at a minimum, the following file types: .htm, .pdf, .txt,.rtf, .doc (all versions of Word docs)
3. Results with search terms or phrases in context.
Has anyone implemented something that extends the current search to include all of the above?
I was also thinking of just using Google Custom search. I couldn't find anyone discussing it's use on the forum in C5. Has anyone used it with any issues?
I'd be very interested in any advice on providing the above features to the client.
Thanks,
Doug
I'm actually looking at switching to a custom search as well. Mnkras has a great example of one here:http://mnkras.com/search1/. I have one set up as well, but am still trying to figure out if it can be made to search based on c5 attributes and possibly use them when outputting results (ie, have pages with the page_type attribute as 'movie' display a little movie icon). Setting up and using a google custom search is wonderfully easy though, and it certainly seems more powerful than the default c5 search. The API is here:http://code.google.com/apis/customsearch/...
Alrighty
All you need to do, is get the code from google and paste it in an html box, little screencast :P
http://screencast.com/t/ZDU1NWM1Nz...
the funny thing is i put that thing up like yesterday :P
All you need to do, is get the code from google and paste it in an html box, little screencast :P
http://screencast.com/t/ZDU1NWM1Nz...
the funny thing is i put that thing up like yesterday :P
isaach: just to throw out an alternative, you might want to check out mato's search tools package:
http://www.concrete5.org/marketplace/addons/search-tools/...
http://www.concrete5.org/marketplace/addons/search-tools/...
i think the main problem right now, is that the search is kinda... iffy i guess the word is
Yes, I certainly agree with Mnkras on this one. The things that are making us consider switching to google are issues like these:
http://www.concrete5.org/community/forums/customizing_c5/searching-... (the docs say you can search by attributes, but I'm not sure if you actually can)
http://www.concrete5.org/community/forums/usage/search-for-plural/... (searching for 'foo' will not return pages with 'foos' on them)
From my understanding (I could be reading the description wrong), the add-on doesn't actually give these features. And even if it did, I don't think I could convince my supervisor to pay for features that are already supposed to be supported.
http://www.concrete5.org/community/forums/customizing_c5/searching-... (the docs say you can search by attributes, but I'm not sure if you actually can)
http://www.concrete5.org/community/forums/usage/search-for-plural/... (searching for 'foo' will not return pages with 'foos' on them)
From my understanding (I could be reading the description wrong), the add-on doesn't actually give these features. And even if it did, I don't think I could convince my supervisor to pay for features that are already supposed to be supported.
well, search definitely is a tricky problem (part of the reason why there was such a battle over search on the web back in the day). but just because someone else was having issues coding up searching by attributes that means that blocks in the marketplace must also be buggy? that's weird logic.
here's an example of mato's search in action. seems like the attribute search works well:
http://www.thekingdomoftonga.com/where-to-stay/...
...after thinking about this some more, I do hear what you're saying though. searching could be polished quite a bit more, and searching by attribute could be made quite a bit easier at the code level.
here's an example of mato's search in action. seems like the attribute search works well:
http://www.thekingdomoftonga.com/where-to-stay/...
...after thinking about this some more, I do hear what you're saying though. searching could be polished quite a bit more, and searching by attribute could be made quite a bit easier at the code level.
That's a really terrific site, and the search worked really well I thought.
mato, what are you using to display all the details of the hotels (etc) on the search results page?
Doug
mato, what are you using to display all the details of the hotels (etc) on the search results page?
Doug
Hi Guys, Tony just refered me to this thread (thanks Tony!).
The details of the hotels in the search results page and pretty much all the rest of the custom pages in the site are displayed using my own "page block" block (it's not in the marketplace, but you can get it for free from my website). You need to be a php coder to use it, but it abstracts many of the cumersome api functions needed to display custom fields.
After working on the Tonga site, I decided to package all the code and release it as my Search Tools package, since I found working with attributes very frustrating. There's something in the API that makes it just too over-complicated.
I'm now working on the second stage of that project and still finding it hard after all my previous experience and the huge improvements made in 5.4.
For example I wanted to test if a textarea attribute is plain text or rich text, and wrap it inside a nl2br if it's just plain. No easy way! (Still couldn't find it, but my client can't afford paying for my time looking for the solution, so hard-coded for now).
Regarding the discussion abuout searching attribute values, if you tick them as "Include in keyword search" then both c5's default search and my own Search Tools should be able to find them. They use different queries to perform the search so the results will be different. If anyone wants to have a play to make sure it works as expected then send me a PM and I'll be glad to arrange something.
The details of the hotels in the search results page and pretty much all the rest of the custom pages in the site are displayed using my own "page block" block (it's not in the marketplace, but you can get it for free from my website). You need to be a php coder to use it, but it abstracts many of the cumersome api functions needed to display custom fields.
After working on the Tonga site, I decided to package all the code and release it as my Search Tools package, since I found working with attributes very frustrating. There's something in the API that makes it just too over-complicated.
I'm now working on the second stage of that project and still finding it hard after all my previous experience and the huge improvements made in 5.4.
For example I wanted to test if a textarea attribute is plain text or rich text, and wrap it inside a nl2br if it's just plain. No easy way! (Still couldn't find it, but my client can't afford paying for my time looking for the solution, so hard-coded for now).
Regarding the discussion abuout searching attribute values, if you tick them as "Include in keyword search" then both c5's default search and my own Search Tools should be able to find them. They use different queries to perform the search so the results will be different. If anyone wants to have a play to make sure it works as expected then send me a PM and I'll be glad to arrange something.
Hi Tony,
Sorry, certainly didn't mean to step on any toes with this one. Search is certainly a tricky problem, and it's even trickier in a post-Google internet, when people expect the kind of performance that Google uses massive resources to achieve. I also didn't mean to imply that there were any problems with Mato's search - I had a look at it before and it seemed to do what it said it would perfectly. It's a nice block, but unfortunately it's just not quite the functionality I'm looking for.
Mato's search allows you to filter by attributes, but from what I gathered (and from the Tonga website), it does not specifically address searching what is in those attributes. If, for example, you select grade as 'Best', you get 15 results. However, if you simply search for the word 'Best' you get no results.
I was also having that trouble searching on attributes - that first forum conversation that I referenced is mine. As I explained there, I was under the impression that concrete5 was able to do this, but haven't been able to make it work (more details are in that post). There was another conversation about this on the forum about a year ago, but it didn't seem to get resolved.
I really hope this clears things up, and once again, I'm sorry if I came across wrong. Unfortunately my PHP isn't great - I've just been learning it for this project. That being said, I really love what you guys are building here and would love to help out if I can.
Cheers,
Isaac
Sorry, certainly didn't mean to step on any toes with this one. Search is certainly a tricky problem, and it's even trickier in a post-Google internet, when people expect the kind of performance that Google uses massive resources to achieve. I also didn't mean to imply that there were any problems with Mato's search - I had a look at it before and it seemed to do what it said it would perfectly. It's a nice block, but unfortunately it's just not quite the functionality I'm looking for.
Mato's search allows you to filter by attributes, but from what I gathered (and from the Tonga website), it does not specifically address searching what is in those attributes. If, for example, you select grade as 'Best', you get 15 results. However, if you simply search for the word 'Best' you get no results.
I was also having that trouble searching on attributes - that first forum conversation that I referenced is mine. As I explained there, I was under the impression that concrete5 was able to do this, but haven't been able to make it work (more details are in that post). There was another conversation about this on the forum about a year ago, but it didn't seem to get resolved.
I really hope this clears things up, and once again, I'm sorry if I came across wrong. Unfortunately my PHP isn't great - I've just been learning it for this project. That being said, I really love what you guys are building here and would love to help out if I can.
Cheers,
Isaac
nah, I didn't take your comments as anything harsh. And yeah, google's great at what it does, but it doesn't work well with multi-dimensional / relational database style searching.
Regarding the keyword searching within attributes, that's really easy. Just go to that attribute's configuration page in the dashboard, and enable the keyword searching for that attribute. It's just a checkbox. My Real Estate search package works the same way, so people can search for keywords within the address attribute:
http://inneroptics.net/concrete5/real-estate/...
Regarding the keyword searching within attributes, that's really easy. Just go to that attribute's configuration page in the dashboard, and enable the keyword searching for that attribute. It's just a checkbox. My Real Estate search package works the same way, so people can search for keywords within the address attribute:
http://inneroptics.net/concrete5/real-estate/...
Hmmm... I tried that, but alas had no luck. I've thrown up what I've tried on that post (http://www.concrete5.org/community/forums/customizing_c5/searching-attributes/ ). Like you say, it seems like it should be simple, so I haven't thought of a huge number of things to try. If you have time, I would really appreciate it if you could have a look and share any thoughts. I wonder what we're doing differently...
As for Google custom search, I've just started looking into setting up the header.php to use attributes to set up a PageMap (http://code.google.com/intl/en/apis/customsearch/docs/snippets.html#structured_data ). I'll let you all know how that goes.
Isaac
As for Google custom search, I've just started looking into setting up the header.php to use attributes to set up a PageMap (http://code.google.com/intl/en/apis/customsearch/docs/snippets.html#structured_data ). I'll let you all know how that goes.
Isaac
Woo! It's as easy as I would have hoped to use c5 attributes to create meta keywords and a PageMap. I think this means a Google custom search will solve all of my searching woes :D
That being said, I could see this is a start to a post in the Block Requests about making the core concrete5 search better.