Programmable Search Engine
programmablesearchengine.google.com
programmablesearchengine.google.com
If you want a dead simple way to integrate search onto your site/app but find the learning curve of something like Elasticsearch steep, take a look at this project that I've been working on:
https://github.com/typesense/typesense
Typesense is an attempt to offer a great search experience out of the box -- with minimal configuration. It also supports clustering/HA, so you can certainly go a long way before considering something like ES (which is a great product but also pretty beefy).
I used it for some hacks i.e.: a people search engine once. And some SEO indexing checks before Google Search Console existed. Became pretty useless as the index was then seperated from the real Google Index.
Looking at it there is a way to upload XML files. Mhmmmmm... prop. good starting point for the next Google Bug Bounty Hunt.
https://cse.google.com/cse?cx=001532657764357279270:7uvopk6d...
The appliance used to come with a T-shirt, but no longer includes one.
That's probably the same thing that you've encountered with the search appliance.
A word that shows up in the document and no others means it gets a very high score, vs "and" shows up in every document and thus doesn't score well for any
It's what Apache Lucene does which is what ElasticSearch uses under the hood.
Seems some form of wiki always has value inside a company?
Its weird that Google has been so half-hearted about «enterprise search» since they stopped selling GSAs. You would think that they would be itching to know what lies behind your firewall.
I've tinkered with Google CSE a lot and it does have its uses. The knowledge map options are fun to tinker with even if a bit of a black box.
As for the xml - when you download the xml that's intended to be your starting point for an engine, it doesn't include parts of the definition of the CSE like sites you've listed to exclude. So that functionality seems to be a little broken, but I've confirmed you can add and remove elements of the knowledge graph at least via the xml file.
In short it's a rules and keyword-tagging heavy experience, not at all comparable to Elasticsearch or Lucene (which let you really get down to the metal to customize core algorithm behavior).
BTW if you want this kind of experience in an open source stack, I would check out Querqy for Elasticsearch and Solr[2]
[1] https://developers.google.com/custom-search/docs/ranking
If you want to add search to a small static site, e.g. a small personal website, then https://lunrjs.com is good.
Or you could take a look at my side project which includes a search as a service with a simple API: https://searchmysite.net/
function search(querybox, searchables, searchstatus) {
const t = querybox.value.toLowerCase()
let hits = [];
let misses = [];
for (s of searchables) {
// empty "t" matches everything
if (s.innerText.toLowerCase().indexOf(t) >= 0) {
hits.push(s)
} else {
misses.push(s)
}
}
if (hits.length > 0) {
for (g of misses) g.style.display = "none";
for (k of hits) k.style.display = ""; // default display style
searchstatus.innerText = hits.length + " results found."
} else {
searchstatus.innerText = "No results found."
for (g of misses) g.style.display = "" // show all
}
}
function setupSearch() {
const searchables = document.getElementsByClassName("searchme")
const querybox = document.getElementById("searchbox") // <input>
const searchstatus = document.getElementById("searchstatus")
if (!searchables || !querybox || !searchstatus) {
console.log("search setup skipped")
return
}
querybox.addEventListener("keyup", e => search(querybox, searchables, searchstatus), false)
}
window.addEventListener('load', function(event) {
setupSearch();
}, false) // Construct the API query
const apiEndpoint = 'https://searchmysite.net/api/v1/search/michael-lewis.com';
let urlParams = new URLSearchParams(window.location.search);
let queryParam = urlParams.get('q');
if (queryParam == null || queryParam == '') { queryParam = '*' }
let apiQuery = apiEndpoint.concat('?q=', queryParam);
// Build the results (using fetch rather than XMLHttpRequest)
fetch(apiQuery)
.then((resp) => resp.json())
.then(function(data) {
let searchResults = data.results;
document.getElementById('query').value = queryParam; // Set the value of the search box to the query
if (searchResults && searchResults.length > 0) {
return searchResults.map(function(result) {
// Each result is going to be displayed as <li><a href="${result.url}" class="title">${result.title}</a></li>
let li = document.createElement('li'), a = document.createElement('a');
a.appendChild(document.createTextNode(`${result.title}`));
a.href = `${result.url}`;
a.classList.add('title');
li.appendChild(a);
// Each result is added to the <ul id="results"></ul>
document.getElementById('results').appendChild(li);
})
}
else {
// If there are no results update the <h1 class="title" id="results-title">Results</h1>
document.getElementById('results-title').innerText = 'No results';
}
})
.catch(function(error) {
console.log(error);
});EDIT: It appears that you can import URLs by pasting in a list once you've made a simple search engine. But supposedly there is a limit of 5000 URLs: https://support.google.com/programmable-search/thread/200713...
https://support.google.com/programmable-search/answer/451388...
The last solution I used was https://www.meilisearch.com/ -- it's open source and way cheaper than Algolia.
[1] https://github.com/VectorLogoZone/vectorlogozone/blob/gh-pag...
[2] https://github.com/VectorLogoZone/logosearch/blob/main/src/s...
https://firebase.google.com/docs/firestore/solutions/search
Given a clean slate I would have thought they might push Cloud Search or this service, even without any special integration. Candidly I haven’t taken the time to understand either of those offerings but I have to assume you could could index JSON documents just as easily as with Algolia. Not that there’s anything wrong with that; it was just surprising to see them promote a third party in general and a search engine specifically. After having used 90+ Google products over the last 17 years, transacted many millions of with them, and read innumerable pages of docs, I’ve not really seen anything quite like that— where a quite common use case of their product actively promotes a competitor and links to them.
EDIT: It's really Custom Search Engine rebranded to me, it doesn't index all you website, I still prefer Algolia if I had to have a external search provider.
EDIT 2: Seems very customizable, maybe by adding all your urls it will index all you site, making it a viable alternative to Algolia
I am a product manager that works on programmable search engine. AMA*(that I can actually answer)
If you are interested in what has been changing recently, https://programmablesearchengine.googleblog.com/
Edit: and yes, this is a new name for what many knew as Google Custom Search Engine. Also, here is our community site where a lot of Q&A happens: https://support.google.com/programmable-search/community
I tried it ... and it's terrible for my use case. Because these blogs are mostly not hyperlinked anywhere (one is a personal quote collection, another is a collection of hacks and tech tips I found useful), Google doesn't seem to even have them indexed. Nevermind that I manually submitted them for indexation back in the day.
Not that I expected much better from Google at this point.
- The really boring ones like Google Docs, Google Maps, Google Talk, even GMail and Inbox, etc. were all potential generic B2B products so there's an incentive to make it as simple (read: boring) as possible. Even your Executive Emeritus couldn't second-guess what Google Docs does.
- Nexus, Pixel, and Stadia were all competing for a demographic that needed to catch attention; as names these aren't boring at all. "Google Phone"/"Google Smartphone" will be dead even before it launches against iPhone.
- Kubernetes kinda falls between the two. It's a B2B product but it introduces a completely new concept so it needs its own name. Plus they made it a standard so you can't slap the big G before it.
Now, "Programmable Search Engine" just sounds like a product name concocted by naive CS-undergrad seniors[1]. Did no one suggest "Google Search Appliance Plus" (no more confusing than "YouTube Red")?
[1] My CS undergrad senior batch would've named this "Programmable Search Engine System". God forbid anyone think what we're doing is not related to software engineering.
No customization applied, pointed at Hacker News: https://cse.google.com/cse?cx=37e5b152f44307b8a&q=%22search%...
Hacker News' own search: https://hn.algolia.com/?q=%22search+engine%22
Google looks like it's much better at non-title searches:
https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
https://cse.google.com/cse?cx=37e5b152f44307b8a&q=%22high-ca...
[Solution to search browser-URL-history first before the rest of the WWW][1]
[1]: https://softwarerecs.stackexchange.com/questions/46270/solut...