Welcome to Alledia, the #1 Joomla Training Company

Would you like to learn Joomla? We're here to help you: Sign Up Today

  • Professionally-produced training videos and tutorials.
  • Guaranteed same-day answers to all your Joomla questions.
  • No Joomla experience needed. We've taught 1000s of Joomla students.

Home / Joomla Tips & Tricks / Make Your Joomla Search More Useful 
Feb
22
2007

Make Your Joomla Search More Useful

Written by Steve Burge   
Avatar

The other day I'd been doing some testing on the search features for client's site and I came up with some interesting results. This website, based around sports, was pulling up results headed "Mambo", "PHP.net", "MySQL.com".

I checked on Alledia.com and the same thing was happening:

search.png

I'd forgotten something really simple ... by default Joomla comes with the "Search Newsfeeds", "Search Weblinks" and "Search Contacts" mambots published. If you never get around to deleting all the newsfeeds and weblinks, they'll then turn up in the search results.

So, I unpublished those mambots, and also those the called "Search Sections" and "Search Categories". I figure that people are looking for individual content items rather than general folders on a subject.

A small change, but hopefully it will speed up the search results and also make them more useful.

Free Weekly Joomla Tutorials

Your Comments (50)

Zorro
Klaus Nitsche
February 22, 2007

Thanks for the tip!

Another useful thing is to change the default setting from "any words" to "all words" - nobody searching for "joomla templates" would want results for "joomla" OR for "templates", right?

Unfortunately, this has to be done by hacking the core code in components/com_search/search.html.php.

steve
Steve Burge
February 22, 2007

Hey Zorro - that sounds like a useful hack.

By any chance, could you post the code change or a link to it?

Zorro
Klaus Nitsche
February 26, 2007

Hi Steve,

sure, no problem.

In /components/com_search/search.html.php:

Find line 126, replace 'any' with 'all'.
Find line 215, replace 'any' with 'all'.

Also, in /components/com_search/search.php:

Find line 102, replace 'any' with 'all'.

That should do it. These line numbers are for Joomla 1.0.12.

Not pretty, hacking the core code, but someone's gotta do it. smilies/grin.gif

steve
Steve Burge
February 26, 2007

Thanks Zorro - thats a nice useability hack for the module

I know a lot of people get frustrated by too many search results and they're often not willing to spend the time clicking on "Advanced Search" and entering thier query there.

0
Anthony .K
March 17, 2007

hi can u guys tells me about how to make advanced search in my website , coz i cant find a module that include an advanced search in it.

Thankx

steve
Steve Burge
March 18, 2007

Hi Anthony

What extra features are you looking for in an "Advanced" Search?

0
Anthony .K
March 20, 2007

Hey Steve

Im looking for a "advanced" search that have extra features / requirement for now is only to add one condition :

search in or or or

(please refer to my webssite : www.debii.curtin.edu.au)

without this condition, the search function will grab information from
all of above. So the first thing is i should try to figure out set this
condition filter to limit the search result.


Thank you

steve
Steve Burge
March 20, 2007

Hi Anthony

Sad to say, I don't there is a more sophisticated search component available for Joomla currently.

The extensions site has a list of search products but not seem to provide the functionality you're looking for:
http://extensions.joomla.org/component/option,com_mtree/task,listcats/cat_id,1839/Itemid,35/

0
Anthony .K
March 20, 2007

hi Steve
thx for your advice , im already look on those site , and yes it doesn't have search module that im looking for , but if u would like to know what im looking for , please visit this site : http://forge.joomla.org/sf/search/do/search

this kind of search that im looking for , if u have any idea pls let me know , coz i really need this kind of module

thanks for your time Steve i appreciate that

0
ouija
March 28, 2007

is there any way to get the search to exclude certain content and/or catagories/sections?

The reason being is i have a section that basically has random facts that are displayed on my main page, and are not accessable through any menus and I don't want users being able to pull them up using the search as the do now... is there any way to exclude/include specific content catagories/sections from the search?

also, does anyone know what the parameter "Set Itemid" in the search module does? I thought this was my solution, but not sure how to use it and cannot find anything in regards to what that function is for...

Just curious

steve
Steve Burge
March 29, 2007

Hi Oujia

Unfortunately nothing is available currently to allow searching via category or section. Doing this would need to be a custom development job.

The Itemid controls what templates and modules appear on each page: http://www.alledia.com/blog/jo...d-itemids/

0
ssekazinga Noble Julius
April 27, 2007

Hey Guyz gone thru the previous comments ok what am looking at right now is searchinh by Image or Displaying images in my search results, do u have any idea baout that!?

JNS Technology Uganda

steve
Steve Burge
April 27, 2007

Hi

Unfortunately, Joomla really does lack a powerful search component currently.

If you take the /images/ line out of robots.txt then Google will search your images, but there isn't a component that can do that currently, unfortunately.

Steve

0
Audra
May 06, 2007

Hi - I'm wondering if anyone can assist me..........
I have changed the search component's options as needed (same as mentioned in 2nd ost here - ( to all and alpha) - the search page comes up ok, with radio boxes cheecked accordingly, But if I enter the search term directly into tnot eth module and hit eth button - when the search page comes up - it has doen a different default searc (all instead of any) although the boxes are checked correctly.I am wondering if I need to change defulats eslewhere and have worked through th bot and module to do this as much as I could - but to no avail

Audra

Zorro
Klaus Nitsche
May 21, 2007

Audra (and Jean who asked me via e-mail - I'll get back to you via mail):

To have Joomla's built-in search module use the "all" setting, you'll have to hack it as well. Open modules/mod_search.php and go down to the very bottom where the input form is set up. As the last statement within the form, enter



That should make the search module behave.

Those who use templates with hard-coded search fields will have to change their template's index.php file accordingly.

Kind regards,
Zorro

Zorro
Klaus Nitsche
May 21, 2007

The comment component swallowed the code I was trying to post.

For your convenience, I have made a file that replaces the original modules/mod_search.php file. It is identical to the Joomla 1.0.12 file but contains the additional line before the closing form tag.

It is available at: http://www.nitsche.org/mod_search_hacked.txt
You can rename it to mod_search.php and overwrite your existing file with it.

Kind regards,
Zorro

steve
Steve Burge
May 21, 2007

Zorro - many thanks for this. Do you mind if I may a quick blog post about this, pointing people to your hack?

Zorro
Klaus Nitsche
May 21, 2007

No problem, go right ahead Steve.

0
Darlene
June 11, 2007

I am trying to search the actual directory I made with dmdocuments component. The only search option included is for title a description. I want to search the html files in the directory is there any way to select search a particular directory instead of content items.

Thanks for any help.

0
Rachel
June 28, 2007

Hi, I seem to be having trouble with the Joomla 1.0.4 search component. I could have sworn, once it was published, that all results I had checked off in the Site Mambots returned correctly. Now it seems that only Category results are returned. No newsfeeds or content display as results. I have not made any changes since then so I'm not sure what is going on. Any advice? Thanks!

0
Nikolas T
July 03, 2007

Is there aany mambot / module to allow search to a specific category / section?

0
Audra
July 05, 2007

Hi Zorro - just found your reply post from may - fantastic simple solution adding that line into my search module - Thanks a million

(Sorry was slow to thank you

0
nemo
August 16, 2007

Hi, does anyone know the changes you can make to the search module to be able to search through virtuemart items and not just the article pages?

0
Seren
September 11, 2007

At the top of this page it is said that "Joomla! doesn't support search strings longer than 20 characters". Is there a way to increase the number of characters, say to 30?

0
Walter Stinnett
September 12, 2007

I tried to do a search on text within a component but no results were returned. Is there a way to configure the default search component to return results from components, extensions, etc?

0
Rana Chand
December 10, 2007

Hi you all guys....I am looking a joomla Meta Search Engine component just like similar as http://www.dogpile.com/ meta search engine. I have not found any single joomla web site who develop and implement Meta Search Engine...Please if any help on this very serious problem...I want to develop a Meta Search Engine component for our joomla web site...

Thanks ....

0
Kane
January 13, 2008

Someone please assist. When I do a search on my site it no longer returns any results. Could some one assist me in trouble shooting it

0
eric1
February 27, 2008

where we can looking for good search componet content alpa betical like 0-9 and A to Z like http://www.lyrics007.com/ thanks.

0
Guy
April 07, 2008

Great. I never knew I can disable searching in Newsfeeds and Weblinks. I didn't know how to move it .

Thanks for the advice.

0
aimz
May 02, 2008

hey can anyone please telme how to display previously searched data?/? i ave been stuck on this, please help!

0
smithveg
May 05, 2008

Previous search data? I think you need to have another modules to track the visitors search text in order to do so. I got no idea... Hopes this's a hint for you.

I'm seeking they way to make the mod_search in advance, to have a dropdown just beside the mod_search textbox. See. How i customize the com_search to have a dropdown at http://www.homelink.com.my.

But i do not sure how to customize a dropdown into mod_search. Any ideas?

0
Pio
May 09, 2008

hi people,

pls how can i set my search engine. I would like to put the search button at the same high of text but i can't find the file to change this setting. Do you know how i can?

0
Snichols
May 15, 2008

Hi,

Has anyone managed to hack the earch engine module so that it only searches one specific category. If so do you have the code. This is driving me nuts!

Steve

chris2005
chris2005
June 09, 2008

Hi Steve,

sure, no problem.

In /components/com_search/search.html.php:

Find line 126, replace 'any' with 'all'.
Find line 215, replace 'any' with 'all'.

Also, in /components/com_search/search.php:

Find line 102, replace 'any' with 'all'.

That should do it. These line numbers are for Joomla 1.0.12.

Not pretty, hacking the core code, but someone's gotta do it. smilies/grin.gif

Is there a 1.0.15 version too?

Regards,
Chris

0
crissy
July 26, 2008

Hi,
I would like to ask if there is a way I can customize my joomla search by date?
thanks in advance.

0
benc
September 15, 2008

has anyone done this for J1.5? can somebody post the code? thanks.

0
sagar2
September 28, 2008

how to implement alphabetical and 0-9 search in joomla? smilies/grin.gif thanks in advance smilies/wink.gif

0
fufu
September 28, 2008

Hi ,

I see the question is already here, but can some one give us the code to search in a given section? do I have to duplicate module to do it in more than one section with not the same modules printed on left side as example?

0
Mekonnen
October 06, 2008

Hi all,

Can I add two opetions to joomla default search say with web and the Site So that when my user selects web it searches the word using google and when selects site it searches in my web site only?

Any help please

Thanks

0
kaspar
October 12, 2008

Hi Steve,
I have gone through the above question and answer, i hope you would solve my issue.

My Question:
I need to display my site content only like - keyword name, key content, my site url path .

I hope you would solve my issue. I am using joomal_157 ( latest version ). It has some default search with category, section and static page. I don't want joomla default search option.
i want the output like myyogaonline this site.

0
Ganga
November 01, 2008

Hi Steve,

As of now, no one can answer my question regarding the display problem when doing a search from here

http://www.indeenlivres.com/index.php

If you do a search or change the number of answer per page it will look like this

http://www.indeenlivres.com/index.php?option=com_search&Itemid=99999999&searchword=test&submit=Rechercher&searchphrase=any&ordering=newest

It does the same with every templace I use
My joomla is 1.0.15

Your help will be very much appreciated. Thanks!

0
dizi izle
November 29, 2008

Greats, thankk sir.

I Love You Joomla

0
steve_moriarti
August 19, 2009

Life save and time saver!! The categories in the search puzzled me and I would have never of found those mambots!! Cheers man!smilies/smiley.gif

0
XTC
October 14, 2009

Unfortunately the above hacks are not relevant to V1.5... also perhaps just to give another view on matters I have noticed this:

Joomla does not search all the text fields in the database, in fact it most certainly does not search the entire database so somewhere in the Joomla coding there must be code syntax restricting Joomla to search only certain default pre-named tables / fields...

Seems to me what we need to do is strip that out and add our own tables / fields that WE want Joomla to search - obviously those tables / fields NOT listed will not get searched, which also suits some of the requests I have read above.

So far I have not found the relevant database table/field variable within the Joomla code to change, but it most certainly must be there.

Anyone know more about this?

renekreijveld
Rene Kreijveld
October 15, 2009

@XTC: To have Joomla search specific tables you would need to create a specific search plugin for that. In that case you wouldn't have to hack the search component.

0
Durant Cricket
October 19, 2009

Joomla or CMS made simple ? What do you guys reccomend?

0
Gurpreet
November 30, 2009

can anyone tell me ,how can i add alphabetic search in my user listing in joomla displayed by cb

0
tt_tomp
December 08, 2009

Where is the title field coming from on the standard Joomla search results page? I have the module title set to "Search Results" but it displays "Search". I cannot figure out where it's pulling this title from. The component template code show:



Any idea what's going on here?

0
malli
December 31, 2009

hi
i want set the search option and category list in same line and same potions


please help me ?

0
Burgutex
January 14, 2010

I didn't understand anything! This is simple Joomla search module or another module? Please explain something.. This subject is very close..

Write comment

 
  smaller | bigger
 

busy