VisibleURL - Making relevant parts bold

6 views
Skip to first unread message

Sumedh

unread,
Nov 6, 2009, 5:28:10 AM11/6/09
to Google AJAX APIs
Hi Friends,

I have created a Google custom search engine...Now I want to tweak the
CSS a bit...

Right now, the green visibleURL is all plain...the search term is not
bold unlike regular google search...

How can I change this and make the search term bold? I searched in the
docs but couldn't find this...

Thanks in advance for help!

And the concept of custom search engines rocks...hopefully, Google
will give more and more control to users so that they can explore
their niche fully... :)

Vision Jinx

unread,
Nov 6, 2009, 5:54:54 AM11/6/09
to Google AJAX APIs
Hi,

I can't see your app or code so I can't give any specific suggestions,
but if you have searched the docs and didn't see anything in there for
it then it should not be that hard to create a callback handler to do
that. In the callback handler you can make a regex or replace method
to replace your search terms with a bolded one. But first, I would
start by using say FireBug for FF and inspect the element to see if
there is an easy way to just use a css selector for it instead.

If your looking for more control over the API they provide a callback
handler where you can parse the data yourself or for full control you
can also use the RESTful aspects of the API to have complete control
over things (eg. parse the raw JSON data and generate your own results
from it).

Cheers!
Vision Jinx

Jeremy Geerdes

unread,
Nov 6, 2009, 6:36:07 AM11/6/09
to google-ajax...@googlegroups.com
I would echo everything that visionjinx said in his post and add a
couple of details. First, if you're using the Custom Search Control
(i.e., the one that overlays the results on the page) or the default
SearchControl, you're probably going to need to build your own control
to accomplish this. This isn't really as difficult as it would seem if
you have some knowledge of HTML, Javascript, and CSS, and there are a
number of samples that you can look at in the documentation and play
with in the API Playground. And second, you will need to use a regex
or replace method to find the search term(s) in the url. When the AJAX
Search API returns the results, the search terms are not highlighted
in any way in anything except the result's title property.

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
http://jgeerdes.blogspot.com
http://jgeerdes.wordpress.com
jgee...@mchsi.com

Unless otherwise noted, any price quotes contained within this
communication are given in US dollars.

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

And check out my blog, Adventures in Web Development, at http://jgeerdes.blogspot.com
!

Sumedh

unread,
Nov 9, 2009, 7:19:10 AM11/9/09
to Google AJAX APIs
Thanks friends :)

You can find my first draft here - http://www.indiastocksearch.com

I have used a callback (setSearchStartingCallback) to set the date
range like this (hard coded for now, indicates year 2009) -
searcher.setQueryAddition("daterange:2454837-2455141");

But this doesn't seem to be working for refinements...i.e. the
tabs...is it creating a new searcher object when i click on a
refinement? How can I apply this date range to all tabs?

I am an absolute new bee to this API so please forgive me if my
queries are naive...

On Nov 6, 4:36 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> I would echo everything that visionjinx said in his post and add a  
> couple of details. First, if you're using the Custom Search Control  
> (i.e., the one that overlays the results on the page) or the default  
> SearchControl, you're probably going to need to build your own control  
> to accomplish this. This isn't really as difficult as it would seem if  
> you have some knowledge of HTML, Javascript, and CSS, and there are a  
> number of samples that you can look at in the documentation and play  
> with in the API Playground. And second, you will need to use a regex  
> or replace method to find the search term(s) in the url. When the AJAX  
> Search API returns the results, the search terms are not highlighted  
> in any way in anything except the result's title property.
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgeerdes.wordpress.com
> jgeer...@mchsi.com
>
> Unless otherwise noted, any price quotes contained within this  
> communication are given in US dollars.
>
> If you're in the Des Moines, IA, area, check out Debra Heights  
> Wesleyan Church!
>
> And check out my blog, Adventures in Web Development, athttp://jgeerdes.blogspot.com

searchtools-avi

unread,
Nov 9, 2009, 5:11:43 PM11/9/09
to Google AJAX APIs
I have some code for formatting and working with the CSE:

http://searchtools.com/analysis/google-cse-ajax-css.html

Hope it helps,

Avi

On Nov 9, 4:19 am, Sumedh <sumedh.inam...@gmail.com> wrote:
> Thanks friends :)
>
> You can find my first draft here -http://www.indiastocksearch.com
>
> I have used a callback (setSearchStartingCallback) to set the date
> range like this (hard coded for now, indicates year 2009) -
> searcher.setQueryAddition("daterange:2454837-2455141");
>
> But this doesn't seem to be working for refinements...i.e. the
> tabs...is it creating a new searcher object when i click on a
> refinement? How can I apply this date range to all tabs?
>
> I am an absolute new bee to this API so please forgive me if my
> queries are naive...
>
> On Nov 6, 4:36 pm, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
>
> > I would echo everything that visionjinx said in his post and add a  
> > couple of details. First, if you're using the Custom Search Control  
> > (i.e., the one that overlays the results on the page) or the default  
> > SearchControl, you're probably going to need to build your own control  
> > to accomplish this. This isn't really as difficult as it would seem if  
> > you have some knowledge of HTML, Javascript, and CSS, and there are a  
> > number of samples that you can look at in the documentation and play  
> > with in the API Playground. And second, you will need to use a regex  
> > or replace method to find the search term(s) in the url. When the AJAX  
> > Search API returns the results, the search terms are not highlighted  
> > in any way in anything except the result's title property.
>
> > Jeremy R. Geerdes
> > Effective website design & development
> > Des Moines, IA
>
> > For more information or a project quote:http://jgeerdes.home.mchsi.comhttp://jgeerdes.blogspot.comhttp://jgee...
Reply all
Reply to author
Forward
0 new messages