Create custom google search with options to search the web and my site - search-engine

I want to create a custom google search for my site. My requirements are as follows:
I need a text box for search and two radio buttons(one for searching my site and other for searching web).
Depending on the radio button selected the results should be displayed.
I have a separate search results page ('/search').
I know how to create a simple google custom search. But this requirement of providing an option to search the site or web is a little tricky for me.
Please help

I was able to solve this issue.
I first created a search engine in https://cse.google.com/cse/ for my site and configured it to search the web in Basics tab-> Sites to Search option.
With this the search engine would search the entire web.
The code that I placed on the search results page had something this:
"gcse:searchresults-only as_sitesearch='site to search'"
This is a part of the code that google gives you.
Here the parameter 'as_sitesearch' will control which site is to be searched. When the radio button of Searching the web was selected I did not pass any value to 'as_sitesearch' and when the radio button of Searching my site was selected I passed the site url to 'as_sitesearch'.
This worked for me

Related

Joomla - Wrong url path from google results

I have a strange problem in one Joomla website.
If i access from homepage and then navigate into the site it works correct, but if i go in some internal page from google results it shows uncorrect page layout, because the url is not correct.
This is the correct url
Correct page from homepage
and this the uncorrect url that Google finds Uncorrect page from Google
in this second page is showed rating module (that i never used) instead of an article, as you can see in links.
Someone can help me?
EDIT: I'm using Joomla 2.5 version. Every menu item is category blog type, and must show all articles of one category. Each category have 2 articles. In the uncorrect link seems that it access to single article, adding the rating that i have hidden in each article
Which version are you using?
if you can turn on SEF option in the global settings in joomla admin. Then you need to make sure all your articles are in menus. then if you link them on different pages it should keep the url the same.
The way you have it at the moment with all the x=123&... get params pages will show for what ever ids you change the menu to.
The reason you are seeing an uncorrect layout is the two different Itemid parameters (the right url has 127 while the wrong one has 104). The rest of the difference in the urls will be ignored by Joomla.
Solution: Find your menu item with id 104 (look at the menu ids on the right of the menu items view), then check which modules appear on the page from there. There may be modules in non-visible positions.
One of these modules is publishing the links with the wrong ids. If it's a Joomla core (like a search module) you can usually force the Itemid either in the module or in the component's configuration. Else you need to fixsome third party code.
Only once you have solved the multiple-itemid should you turn on SEF, otherwise you'd get the same problem only more difficult to trace.
sh404 could help you with this, I'd give it a try on a test site to see if it gets you out of trouble faster.

Clear cache/indexed pages of a Google Custom Search Engine

I added a Google Custom Search Engine to a site. There is a search box in the header. It also shows the list of frequently searched keywords. Since, the header was available on all pages, the search engine index all the pages according to these keywords too. This was wrong. I searched and added class='nocontent' to the relevant div. Now the question:
I want the clear the cache of my custom search engine and force it to reindex pages. How to do that? I have tried to remove the site and add it again but it does not work.
You may want to use the "On-Demand Indexing" feature to request updated indexing for your CSE.
http://code.google.com/apis/customsearch/docs/indexing.html
There are several additional help pages with related information. I cannot post any further links here (because I lack sufficient rep on Stack Overflow), so I'll tell you how to find those pages:
On the page linked above, under "Other Resources" in the sidebar, click "Help Center"; then click "How to", click "Search results", click "Indexing", and follow the listed links.
NOTE:
At this time the class="nocontent" exclusion feature of Custom Search may not yet work in some cases. Please see this discussion in the Custom Search forum (and check there again later for any updates):
https://groups.google.com/a/googleproductforums.com/d/msg/customsearch/Rz63MiyoU6I/_tSZ_g_9D_AJ

how to find webpages which link to some specific page?

Just wondering if there's any way to search all web pages which link to some specific url? For example, all web pages containing link to example.com? Thanks
You probably might want to explore the Google Search API which allows you to use Google search results in your programs.

Linking to a specific section of a page from Google custom search engine result

I would like to know if there is a way when using Google custom search engine to have Google CSE link to a page with a URL like this
http://www.mysite.com/mysection/mysectionarticles.html#myarticle234
or something close to that.
Let’s say Google would find the searched words in a certain part of the page it could be in a or after an anchor or something like that and would supply in the search result a way to link to this specific section of the page.
So if you have big pages the user wouldn't have to scroll through the page to find the relevant part he saw in the CSE snippet.
It could also be used if you have a dynamic page that change state using JavaScript. Part of the page is hidden to the user until he does an action in the pages, but this hidden content was indexed by Google because it’s part of the page. So when the user clicks on the link in the search result he ends up on a page and can’t find the relevant part because it’s hidden.
Take a look at Google's support for structured/rich data and ajax urls for crawling (aka hash-bangs). One or both of them ought give you access to the pages with the right things displayed.

Creating Custom Search Webpage Using Google Engine

I want to create a search webpage which should display the Google results page as well as results from our intranet webpage. Can I design it using Google Custom Search Engine?
Not unless you expose your intranet to the public Internet for Google to index, which is probably not something you want to do.
They have services to index intranet content as well, but they might be a big costly.

Resources