Power in Google CSE - how to make Google Python search engine :)
Check out the new site at https://rkblog.dev.
21 September 2008
Comments
Google has a public service called Custom Search Engine - CSE. It's not very popular - if you want google powered search for your site you use Google Ajax search or other services. Google CSE is much more complex, and it's hart to see the "cool part" until you get the dreamed result.
Google CSE allows you to tune the Google search results against some keywords, sites etc. If you want a search engine for Python frameworks then Rainhard Django or construction pylons aren't the things you look for...
Here is a XML config file for the Google CSE hosted on your site:<?xml version="1.0" encoding="UTF-8" ?>
<GoogleCustomizations>
<CustomSearchEngine>
<Title>Python-Search</Title>
<Description>Python-Search</Description>
<Context>
<BackgroundLabels>
<Label name="pylabel" mode="BOOST" weight="0.8" />
</BackgroundLabels>
</Context>
</CustomSearchEngine>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=python+$q&btnG=Search&num=100&label=pylabel"/>
<Annotations>
<Annotation about="http://wiki.pylonshq.com/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://pylonshq.com/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://www.djangoproject.com/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://code.djangoproject.com/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://www.djangobook.com/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://docs.python.org/lib/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://docs.python.org/dev/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/*">
<Label name="pylabel"/>
</Annotation>
</Annotations>
</GoogleCustomizations>

<?xml version="1.0" encoding="UTF-8" ?>
<GoogleCustomizations>
<CustomSearchEngine>
<Title>Python-Search</Title>
<Description>Python-Search</Description>
<Context>
<BackgroundLabels>
<Label name="pylabel" mode="BOOST" weight="0.8" />
</BackgroundLabels>
<Synonyms>
<SynonymEntry word="pylons">
<Synonym>pylons framework</Synonym>
</SynonymEntry>
<SynonymEntry word="pylons">
<Synonym>pylons python</Synonym>
</SynonymEntry>
</Synonyms>
</Context>
<Context refinementsTitle="Search for $q in categories:">
<Facet>
<FacetItem title="Python">
<Label name="pylabel" mode="BOOST" weight="0.8">
<IgnoreBackgroundLabels>true</IgnoreBackgroundLabels>
</Label>
</FacetItem>
</Facet>
<Facet>
<FacetItem title="Pylons">
<Label name="pylons" mode="FILTER">
<IgnoreBackgroundLabels>true</IgnoreBackgroundLabels>
</Label>
</FacetItem>
</Facet>
<Facet>
<FacetItem title="Django">
<Label name="django" mode="FILTER">
<IgnoreBackgroundLabels>true</IgnoreBackgroundLabels>
</Label>
</FacetItem>
</Facet>
<Facet>
<FacetItem title="Python Reference">
<Label name="pyreference" mode="FILTER">
<IgnoreBackgroundLabels>true</IgnoreBackgroundLabels>
</Label>
</FacetItem>
</Facet>
</Context>
</CustomSearchEngine>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=python+language&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=jython&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=ironpython&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=django+framework&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=pylons+framework&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=pyqt&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=pygtk&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=python+$q&btnG=Search&num=100&label=pylabel"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=pylons+framework&btnG=Search&num=100&label=pylons"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=pylons+python&btnG=Search&num=100&label=pylons"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=pylons+python+$q&btnG=Search&num=100&label=pylons"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=pylons+framework+$q&btnG=Search&num=100&label=pylons"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=django+framework&btnG=Search&num=100&label=django"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=django+python&btnG=Search&num=100&label=django"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=django+framework+$q&btnG=Search&num=100&label=django"/>
<Include type="Annotations" href="http://www.google.com/cse/tools/makecse?url=http://www.google.com/search?q=django+python+$q&btnG=Search&num=100&label=django"/>
<Annotations>
<Annotation about="http://docs.python.org/lib/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://docs.python.org/dev/*">
<Label name="pylabel"/>
</Annotation>
<Annotation about="http://wiki.pylonshq.com/*">
<Label name="pylons"/>
</Annotation>
<Annotation about="http://pylonshq.com/*">
<Label name="pylons"/>
</Annotation>
<Annotation about="http://docs.djangoproject.com/en/dev/*">
<Label name="django"/>
</Annotation>
<Annotation about="http://code.djangoproject.com/wiki/*">
<Label name="django"/>
</Annotation>
<Annotation about="http://www.djangobook.com/*">
<Label name="django"/>
</Annotation>
<Annotation about="http://docs.python.org/lib/*">
<Label name="pyreference"/>
</Annotation>
<Annotation about="http://docs.python.org/dev/*">
<Label name="pyreference"/>
</Annotation>
</Annotations>
</GoogleCustomizations>


RkBlog
Check out the new site at https://rkblog.dev.
Comment article