LocalSearch - results criteria / max distance?

4 views
Skip to first unread message

jhodgski

unread,
Aug 19, 2010, 9:56:39 PM8/19/10
to Google AJAX APIs
Does anyone know what the maximum distance used by the LocalSearch API
is when finding matching places? And is it possible for me to
configure it in my code?

Cheers,
James

Jeremy Geerdes

unread,
Aug 19, 2010, 10:04:08 PM8/19/10
to google-ajax...@googlegroups.com
There is no maximum distance. Even though the API uses distance as a weighting factor when calculating relevance, there is no hard radius. And there is no way to configure a hard radius. However, you can direct the API to weight distance more heavily by using the sspn parameter. Look in the documentation to see how you can do that.

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

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jrge...@gmail.com

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

> --
> You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group.
> To post to this group, send email to google-ajax...@googlegroups.com.
> To unsubscribe from this group, send email to google-ajax-searc...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en.
>

jhodgski

unread,
Aug 20, 2010, 9:40:37 AM8/20/10
to Google AJAX APIs
Thanks Jeremy,

The sspn parameter looks good, but where/how does it fit into my code?

My code...
// Create a search control
var searchControl = new google.search.SearchControl();

// Create and customise localSearch
var localSearch = new google.search.LocalSearch();

localSearch.setAddressLookupMode(google.search.LocalSearch.ADDRESS_LOOKUP_DISABLED);

// Add local searcher
var options = new google.search.SearcherOptions();
options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
searchControl.addSearcher(localSearch, options);

Thanks,
James

On Aug 20, 3:04 am, Jeremy Geerdes <jrgeer...@gmail.com> wrote:
> There is no maximum distance. Even though the API uses distance as a weighting factor when calculating relevance, there is no hard radius. And there is no way to configure a hard radius. However, you can direct the API to weight distance more heavily by using the sspn parameter. Look in the documentation to see how you can do that.
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.com
> jrgeer...@gmail.com
Reply all
Reply to author
Forward
0 new messages