View Full Version : Search forum for phrase?
prowler3
01-28-12, 02:33 PM
I am trying to search for "sonar destroyed" in the SH3 and SH3 mods workshop forums. The search is returning anything with either "sonar" or "destroyed" instead of only posts containing the phrase. How do I do that?
Put the desired phrase in quotation marks.
That will force most search engines to return items found using only that exact wording. CAVEAT - it is easy to miss other relevant posts this way because they don't contain the desired phrase or spell it differently.
If you wanted to search for things about sonar destroyed in u-boats in 1943, you would search for:
"sonar destroyed" and "u-boats" and "1943"
This search will ignore any item that does not include all three terms in quotations. There may be lots of items about u-boats and sonar destroyed but either a different year or no year is mentioned. The more filters (AND) you add, the fewer results you'll get back and the easier it is to miss what you're looking for.
.
prowler3
01-28-12, 03:56 PM
I had tried the "sonar destroyed" with the quotation marks...apparently that doesn't work here as I still get every post which contains only "sonar" or only "destroyed". :hmmm:
Try entering site:www.subsim.com "sonar destroyed" in google. That will search the site for the term between the quotes.
You can set up a bookmark as well to launch the google search while having the forum page open. I can post the code to do that, if you are interested.
Ilmars
Herr-Berbunch
01-29-12, 05:26 AM
Ilmars has the only solution I know that works. :yeah:
prowler3
01-29-12, 02:54 PM
Thanks! Ilmars, I would be interested in the code you mentioned.
You can create a bookmark that will pop up a text box to submit a search term to google while browsing a the web page of a site. In order to do that try the following, it assumes a PC running Firefox, but can be configured to whatever browser you prefer.
First, browse a web page and create a bookmark for it. It doesn't matter what the page is, all we are doing is creating a bookmark to work with.
Next, click on the Bookmarks menu item in Firefox and locate the bookmark for the page you just created. Move your cursor to it and right click, then select Properties.
In the properties window you will see a "Name:" field and a "Location:" field. Enter a string like "Web page search" in the name field to give your bookmark a meaningful title.
Now copy the following snippet of code and paste it into the "Location:" field:
javascript:q%20=%20prompt("Enter%20a%20search%20phrase:",%20"");%20if%20(q!=null)%20location=("http://www.google.com/search?num=100&q=site:"%20+%20escape(location.hostname)%20+%20"%20\""%20+%20escape(q.replace(/\"/g,""))%20+%20"\"").replace(/%20/g,%20"+");%20void%200
Next press the Save button.
Note that there should be no spaces in the string that you pasted into the "Location:" field.
To execute a search on any web page, just browse to the web page and select the bookmark you created for the Web page search. It will pop up a text box that lets you enter a term to search for. It will pass the term surrounded by quotes to google, and position you to the google results page. You can further refine the term in the results page if you want. For example, you can add terms, or remove the quotes if you want an "OR" relationship.
I found that some forums (not necessarily subsim's) sometimes have problems with their embedded search utility, and this method sometimes returns more results than their embedded utility does.
Note that this code will search from the parent root of the web page you are on and drill down from the top, not from the position that you are located at.
Cheers,
Ilmars
I just noticed that you may not have been able to get the code snippet to work because there is something weird with the way the thread editor here wraps the code snippet, and I can't remove the problem by editing.
You should notice that there is a space in the string "ph rase" and
"location.host name" in the snippet posted.
Those spaces should not be there and when you copy/paste the snippet into the "Location:" field of the bookmark properties window, the spaces get replaced with a "%20" in both places. Remove the "%20" in both places after pasting and the snippet should work. Obviously, the strings should look like "phrase" and
"location.hostname" after you paste. Not "ph%20rase" and not
"location.host%20name"
Sorry about this convolution, I would repost the snippet, but I can't edit the blanks out.
Ilmars
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.