Today we’ll look at the format of the search.ini, as much as I understand it, and look at how you can change/edit/add your own entries. I hope that you will understand how to tinker with the file yourself, and then I’ll introduce you to some of the tools for making this process easier.
The most important thing to know when working with search.ini is this: Make Backups. Don’t leave your only copy in Opera’s control, as it will overwrite your copy when they update it, which they do from time to time. However, if that happens, Opera will save your old search.ini in a \Uninst\Backup. Still, why take the chance? (Ok, I know that you probably won’t listen to reason, so here’s a copy of the default search.ini in case you lost yours.)
So the first thing to look at is what Opera gives you by default. You can check what Opera has to offer by going to the Advanced Preferences (If you are using MSWindows: ctrl + F12 or Tools → Preferences. On Mac OS X: cmd + F12 or cmd + , or the Opera menu → Preferences). Click on “Advanced” and then “Search”.
The default searches in Opera 8.01 are:
| Search Engine | Keyword |
|---|---|
| g | |
| Opera Web | s |
| Amazon.com | z |
| Price Comparison | c |
| Ebay.com | e |
| Download.com | w |
| Google groups | r |
| Google News | n |
| Find in page | f |
| Opera support | o |
What do those letters mean? Well, they are the search shortcuts. You can use them in the addressbar or in the F2 prompt. For example if you want to search Google for “Opera Lover” you would use “g Opera Lover”.
Easy enough, right? But what if you want more choices? Of course Opera will let you do that. Unfortunately you have to edit the file directly. There really ought to be an easier way (OmniWeb does this really well). The good news is that it isn’t all that hard. The bad news is that you have to make sure that Opera is not running.
Well let’s take a look at one entry, the one from Google:
[Search Engine 1] Name=&Google URL=http://www.google.com/search?q=%s&sourceid=opera&num=%i&ie=utf-8&oe=utf-8 Query= Key=g Is post=0 Has endseparator=0 Encoding=utf-8 Search Type=0 Verbtext=17063 Position=-1 Nameid=0
There are threethings to notice here. First is the %s in the URL line. That %s will be converted to whatever you enter after the keyword. The second is Key=g. The third is the & which indicates what letter is used for the quick search (F2 + LETTER)
The pre-assigned keyboard shortcuts are all single keys, but they don’t have to be. This comes in handy if you want to use a longer keyword like “mw KEYWORD” to search m-w instead of the default dictionary or “af” for AcronymFinder, or “imdb” for the ultra-cool IMDB.
So let’s look at how to add your own. First, go to a website that has a search engine you want to use. I’m going to use IMDB as an example because it’s the site that I go to when we’re watching a movie and I say to my wife “What else was that actress in?” and she looks up and says “She was the doctor in that other show” and I say “No she wasn’t” and she says “You still doubt my powers? How long have we been married?” and I hardly hear her because I’m already pulling up IMDB and finding out that she’s absolutely right. Again.
Head over to IMDB. Notice the search engine on the top left and choose from the dropdown (I choose “all” because I like to cast a wide net) and then I plug in “Batman Begins” (because that’s the last movie I saw) and execute the search and see that it takes me to http://www.imdb.com/find?q=batman%20begins;s=all. We’ve already learned that we replace the search term (“batman%20begins”) with %s. Then we decide that we want to use “imdb” as the search keywords… and then we plug it into search.ini (while Opera is not running). I generally look for one of the entries that I am not going to use and change everything after the [Search Engine X] line:
[Search Engine 6] Name=IMDB URL=http://www.imdb.com/find?q=%s;s=all Query= Key=imdb Encoding=utf-8 Is post=0 Has endseparator=0 Search Type=0 VerbText=17063 Nameid=0 Position=-1
Now rather than Key=imdb you could have used Key=i but that would conflict with my search for Google Image Search (which would be http://images.google.com/images?biw=&q=%s&hl=en&btnG=Search+Images by the way). Choose your own adventure.
That’s all there is to it.
OK, so there are a whole bunch of lines in there that I haven’t talked about. Why not? Because you really don’t need to know them for most uses.
Google: I’m Feeling Lucky
This one is a little tricky since you can’t see the resultant URL. Some searching around revealed this:
[Search Engine 8] Name=Google - I'm Feeling Lucky URL=http://www.google.com/search?hl=en&ie=iso-8859-1&q=%s&sourceid=opera&btnI=I%27m+Feeling+Lucky Query= Key=l Encoding=iso-8859-1 Is post=0 Has endseparator=0 Search Type=0 VerbText=17063
What searches do you use? Good reference sites that you’d recommend to others? Leave a comment, make the world a better place.
{ 19 comments… read them below or add one }
Maybe you could’ve told people about the enseparator.
I have divided my searches in Google things, Word searches (dictionary, encyclopedia, acronym finder), warez searches (Torrentspy, Isohunt, Astalavista, Packetnews and IRCSpy) and misc.
I divided them by adding to the last one of each group the Has endseparator=1 line.
Yesterday I found this tool:
“Opera Search.ini Editor (Opsed aka Op6sed) is a simple tool for easy customization of the search engines used by the fastest browser on earth, i.e. the Opera browser. Feel free to send any comments, suggestions and the definitions of your favorite search engines.” (http://www.operapl.prv.pl/en/)
I haven’t tried it yet, but it might be pretty useful, I think.
I prefer don´t touch the search.ini file and to do my own search panel using the Search Field Editor!
How funny that you start your example with acronym-finder, since that’s one of the extras I’ve added to my own search.ini.
In an office setting, it’s also useful for setting up a search of your corporate intranet, for example.
Other searches I’ve added include:
Name=&Dictionary
URL=http://dictionary.reference.com/search?q=%s
Key=d
Name=&Thesaurus
URL=http://thesaurus.reference.com/search?q=%s
Key=t
Name=Google &Image
URL=http://images.google.com/images?num=100&safe=off&q=%s
Key=i
Name=&Books (Worldcat Libraries)
URL=http://www.google.com/search?sourceid=opera&safe=off&q=site%3Aworldcatlibraries.org+%s
Key=b
Name=Wiki&pedia
URL=http://en.wikipedia.org/wiki/Special:Search?search=%s
Key=p
And thanks for the tip that you can use longer strings for the Key field. You just opened up a whole mess o’new options for me!
I didn’t expect to find two search.ini in my Opera installation. It took me a bit of testing before I realized I must not be editting what Opera 8.01 was using.
I have a folder “\Opera\profile” that contained the search.ini file my installation uses. I mistakenly had been editting “\Opera\search.ini”, which seems to be (probably appropriately) ignored when I log in on this computer.
After copying the modified file to the \profile folder the imdb and other custom searches work just as described. This is a very helpful tip, thank you! :)
as for search type, I tried the other day to add my own search engine and set search type 2. guess what! the result is two search result pages(google and opear search, which is the first 2 in my search.ini list) tile horizentally. so now whenever I add new search engine, I always set search type=3.
the translations: I use only English and japanese translation. but the whole translation lists still appears when I delete all the other translation items in search.ini. how to let the popup menu only display the desired translation?
thanks.
I couldnt get it to work for
google .co.uk searches
When using the previous version of Opera (8.0) I could get the search.ini to recognise google.co.uk. Since I upgraded to 8.01, despite modifying search.ini to co.uk again, it now doesn’t work, and defaults to google.com
John and I talked via email and discovered that he made a very common mistake - editing the wrong search.ini file! Make sure to edit the one in your profile directory (see opera:about).
How could I add Googles search site (i.e. “site:currentserver.com”) to Operas search field, just like the Google Toolbar in IE?
Is there a way to get a firefox kind of I’m Feeling Lucky integrated? So that if I type a keyword in my adressbar I go to the site listed #1 in google?
Thanks in advance!
(No, you have to type a letter and a space first — TjL)
Using Icab, (http://www.icab.de)
I can just go to the webpage, put the cursor in the search field and a right click the mouse. A contextual menu option “Add to internet search list” is an option. It’s automagically added. I can then go to the search bar and either use a “g” for google sort of feature, or a drop down to choose.
I’m a noob. How would I add Teoma Search?
1) Goto http://www.teoma.com/
2) Type in some search term (I like to use something in ALLCAPS like FOOBAR)
3) Note the URL in the resulting search page, i.e.
http://s.teoma.com/search?q=FOOBAR&qcat=1&qsrc=0&Search.x=0&Search.y=0
4) Replace searched-for term (in this case “FOOBAR”) with %s, i.e.
http://s.teoma.com/search?q=%s&qcat=1&qsrc=0&Search.x=0&Search.y=0
5) Use that URL in search.ini
Another tip: Go to Google and search for “teoma.com search.ini” to see how others have used it (this will, of course, also work for other items besides teoma.com)
Yet another tip: Many times the resulting search URL is much more complicated than it has to be for the purposes of search.ini. In the case of teoma.com (or Google, or many others) all you need is the part that directly connects to the search word(s). That is, rather than all this:
http://s.teoma.com/search?q=FOOBAR&qcat=1&qsrc=0&Search.x=0&Search.y=0
all you need is this
http://s.teoma.com/search?q=FOOBAR
You may want to test shortened/simplified versions of the search result URL before modifying search.ini.
About the google “site:” search, just do a normal google search with “site:whatever.com” as one of the keys, like:
“g search.ini site:opera.com”
Also works for other advanced google parameters, like the link search (“link:whatever.com”), and could be useful for other searches.
Play with it and see what happens :)
When upgrading Opera, sometimes this file will be overwritten (don’t worry, a copy is saved at least as of 8.02) every time you start Opera. This is because the file version has changed with the new Opera version and needs to be updated in your own file. For example, under “[Version]” I recently had to change “File Version=4” to “File Version=6” for it to accept my own file.
{{TjL writes: Good point! I know some people who put File Version=999 to prevent Opera from ever overwriting it. If yours is overwritten, look in the Uninst directory.}}
Thank you, Joel @ 02:25 PM, July 01, 2005:
I saw your post when I was just about to get up & beat my head against the wall because I couldn’t work something so straight-forward. The old 2 ini trick… working fine now.
Now that Opera 9 permits unlimited search.ini entries and allows for one-click creation, I’m finding all kinds of versatile uses for it, including the keyword search for my library network, the Internet Archive’s Wayback Machine (URL doesn’t work, just prefix it); New York Times link generator, DNS Report, I may add BugMeNot… The possibilities are endless!
@josh, regarding simply right-clicking to add search:
This has become a new feature in Opera 9, so it’s now easier than ever to add search engines.
Simply right click the search field and select “Create Search” from the menu. Remember to add a shortcut – that way you can type ” ” to speed up the search even more. Many of these shortcuts are already built right into Opera, i.e. i use “g ” to search Google 100 times a day.