How to make a Google Maps address - like lookup - api

You've probably all seen the maps.google.com.au address lookup. Start typing into the text box and your address auto completes in the list before you've finished. It also bolds the matching sections of the text that link to what you are typing.
I've used both the javascript api of maps and the http api. The geocoding seems to do something decent with the matches but i'm not entirely sure how one would go about getting this to work.
Anyway have a tutorial or a quick five step process that they would recommend I follow to get this feature going?

The feature you are looking for is "find as you type" or "suggest as you type" or AJAX live search.
To get the functionality via the Maps API is possible as any other find as you type solution. For each key entered into your search box you already send the request to the server and see what matches the entered text so far. The problem is that you can only send so many requests to google before you get a 620 (too many requests) error. Having a find-as-you-type mechanism is usually easier when you have your own small DB which you can query, that is faster and you won't have problems with too many requests.
Some links with tutorials:
Javascript Autocomplete Combobox - find as you type
Suggest as you type
AJAX Live Search

Related

Bing Spell Checker is not working as expected

https://api.bing.microsoft.com/v7.0/spellcheck?text=mus&mkt=en-GB&mode=spell
Using the above URL and given my supplied API key within the request headers - I am getting no results back from the Bing Spell Checker API using PostMan or from Refit in C#(Xamarin Forms).
For 'mus' I'm expecting 'must', for 'tst' I'm expecting 'test' but, neither seem to work.
I've set the mode to 'spell' which should be the case however, even in 'proof' mode it doesn't return any results.
Please can somebody let me know why?
Thanks
The documentation explains:
Bing Spell Check API lets you perform contextual grammar and spell checking on a text string. While most spell-checkers rely on dictionary-based rule sets, the Bing spell-checker leverages machine learning and statistical machine translation to provide accurate and contextual corrections.
I assume that passing single words in most cases won’t provide enough information for this approach.
Try passing phrases that put your words in some reasonable context like mst have or quality tst.
For single word suggestions you can try a dictionary based service or software package.

Search Database via Google Custom Search? Attached Google CSE to (SQL/NoSQL) Database for website?

TOPIC - Google Search Engine / Custom Search - with Database
References
Search for "Google Search Engine" and "Google Custom Search"
(New to StackOverflow; just joined the other day.I'm limited to 2 links I can post right now).
NOTE:
I have not YET decided/committed to any specific coding language, framework, etc. Not until I figure out how to accomplish my question (below).
BACKGROUND INFO
What I'm trying to do (for now) is add a "search-box/ search engine" to a simple website I'm building out. Before I get too far into it (planning ahead) I would like to use Google CSE if all possible (which can do A LOT of things and works well). However, I will have a database (not sure on type YET. Will depend on what my options and I can do with CSE) of "items" that I want to be able to quickly search (in the search-box) i.e. like Amazon.com.
QUESTION:
Is there any way at all, to use Google Custom Search and or Custom Search API to search/attach a database (SQL, NoSQL, or others)? I would HIGHLY prefer being able to do all of this in Google Cloud Platform, and use one of their storage/database products.
If I get what you try to do, Google CSE is enough.
From the google doc you linked :
#Defining a Custom Search Engine in Control Panel
In the Sites to search section, add the pages you want to include in
your search engine. You can include any sites you want, not just the
sites you own. You can include whole site URLs or individual pages
URLs. You can also use URL patterns.
#Enabling Autocomplete
[...]you can enable or disable autocomplete feature using
enableAutoComplete attribute.
For the Is there any way at all [..] to search a database, I'll said not directly, but it's not a big problem.
Google CSE work on "indexable web pages", so it'll not work again a raw DB, restricted internet, or custom network not under http(s)://.
But in your case, if you make a DB, I suppose you'll have to make web page to display the data you store inside to your users ? (like products pages on Amazon)
If yes, then you'll run Google CSE again these pages by adding your http://[server ip] or http://[domain name] in the white list.
As far as I know, custom search won't guarantee all your content will be indexed.
You probably want to try exporting a full sitemap.xml, a RSS feed and if the custom search results from either of these won't satisfy you, you will probably want to look at the google search appliance product.
There's also http://sphinxsearch.com/ by the way.

Web Scraping through Excel VBA

I need to fetch company addresses(cim) from site http://www.ceginfo.hu/
Example Company Name: AB-KONTÍR Szolgáltató Bt.
I know how to do it using WinHttp.WinHttpRequest object and FireBug.
But I am not able to decide to which URL I should send this request.
When I analyse the request/responses using FireBug, I get the following URL:
http://www.ceginfo.hu/company/search/4221638
4221638 is CompanyID here I think. But in my case I will have company name only and that's what my problem is.
So can anybody please tell me where can I get URL using firebug or any other tool using which I can track the URL with Company Name as parameter which I can use in my VBA code.
Thanks in advance!
So can anybody please tell me where can I get URL using firebug or any
other tool using which I can track the URL with Company Name as
parameter which I can use in my VBA code.
No. Unless there is a publicly available database (I would suggest calling them, if you can) or an API that allows for programmatic access, the only way to arrive at this link slug is by executing the search.
Further, the post slog is not as relevant as you think. If you search for simply "Kontir", this is the resulting page -- with many results:
http://www.ceginfo.hu/company/search/4222407
You're going to have to automate the "search" -- passing the criteria to the Web Page and executing the button-click and/or HTTPPost, and then parse the result(s). In the example company name, there is only one result. But it is possible as in my example above, that there may be multiple matches for some queries, and then you will need to have a method of dealing with these, or ignoring them.

Normal Google Custom Search

I'm writing an application that analyses search engine results.
With the Google Search API now being depreciated and limited to 1000 queries/day they are forcing developers to move to the AJAX APIs and to use the Custom Search API to do a Google search.
The thing is I don't need a Custom Search, I need a general search not one that is filtered by site; OK maybe filtered by USA/UK (Google.com/Google.co.uk).
Does anyone know how to just do a regular Google search using the AJAX APIs? Is the Custom Search the right thing to be using?
I don't want to hit the 1000/day limit using the old service but this is exactly what I need.
I did find: How do I create a CSE that searches the entire web?
http://www.google.com/support/customsearch/bin/answer.py?hl=en&answer=1210656
But by the sounds of it this will distort the search results.
Thank you.
OK. Here's how I think it is done.
Create a Custom Search Engine.
Add a site such as *.com When this is created go to the Advanced tab
and download the context xml.
Remove the Background Label associated with the site.
Upload the XML to replace the previous context.
This seems to work just fine and is returning the same values as far as I can see.
Yes, you are right *in theory, and this should let you get 100 results a day on the fly. Just this Saturday though, Google confirmed how here -
(* so far though, we can't get it working...)

How to detect if a query string is relevant for a Google Map Static API lookup

I am currently developing a web app that uses Google's Static Map API, in order to display maps of places upon user's request.
My problem is the following: How can I detect if a given string is relevant or not to searching Google Maps ?
Examples:
Searching for "North Beach San Francisco" with the following URL returns a relevant map of what is asked.
http://maps.google.com/maps/api/staticmap?size=270x185&maptype=roadmap&sensor=false&markers=north%20beach%20san%20francisco
However, searching for something that is not an address like Orwell's "1984" with the following URL does also return a map but it is absolutely not relevant to the query.
http://maps.google.com/maps/api/staticmap?size=270x185&maptype=roadmap&sensor=false&markers=1984
My point is, I don't need to parse the query since Google Maps Static API can find an address pretty easily, but I need to know if the string the user submitted should be searched in Maps or just regular search.
There is a lot of address-parsing related questions on SO, but I repeat that I don't want to have a full address parsing process, I just want to know if Google would have displayed a map link if I had searched the same thing on their website.
I do know the Google Geocoding API but it's roughly the same, as it will return coordinates even for unadapted queries like "1984". (And I'm not even talking about the limitations that make it pretty impossible to use in a large-scale web application)
Thank you for your time !
Gael
What I eventually did:
Google Geocoding API has a response parameter that indicates the accuracy of the geocoding lookup. Using this parameter, I was able to determine if my query is a real address or just a standard query looking like an address.
Keep in mind that both Geocoding Service and Javascript Geocoding API have limitations (as of now, 2,500 requests per IP per day)
Do post a comment if you want further information about that !