News for hackers. Stuff that matters.
Re:Programmable Search Engine by karterk on Tuesday October 06, 2020 @01:14AM (#24694911)
I've implemented Google Custom Search Engine on a few sites before, and it's not clear if this is the same (repackaged?) or different. The biggest question (as with many Google products) is when this it going to be shut down, given that Google Search Appliance itself reached its end of life in 2019.

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).

Re:Programmable Search Engine by redslazer on Tuesday October 06, 2020 @04:00AM (#24695604)
I have been playing around with Typesense and MeileSearch. Typesense was quicker to get started with but MeileSearch sorting made more sense.
Re:Programmable Search Engine by karterk on Tuesday October 06, 2020 @05:06AM (#24695929)
Happy to hear any feedback on what I can do to make it easier. Typesense does not require you to define a full index-time sorting order (except for a default sorting field) so it's pretty flexible on what fields you can sort on at query time.
Re:Programmable Search Engine by franze on Monday October 05, 2020 @05:50PM (#24692434)
Oh, the old Google Custom Search Engine is still around, rebranded. Think it was called also Google Co-Op once.

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.

Re:Programmable Search Engine by paxys on Monday October 05, 2020 @05:58PM (#24692505)
I remember when they used to sell a physical search box that you could plug into your server.
Re:Programmable Search Engine by codazoda on Monday October 05, 2020 @07:08PM (#24693049)
I had the pleasure of working with two of these. They did not give you the same quality of results that Google's website did. Utter garbage in a blue rack mounted case.
Re:Programmable Search Engine by jfim on Monday October 05, 2020 @07:12PM (#24693078)
One thing I've heard from multiple googlers is that their internal wiki search is crap exactly because there's limited hyperlinking to give a good ranking for pages. Google's algorithm basically crunches a lot of human provided data (inbound links, clicks, dwell, etc.) into an algorithmic score, but with limited data it's not much better than tf-idf.

That's probably the same thing that you've encountered with the search appliance.

Re:Programmable Search Engine by tyrust on Tuesday October 06, 2020 @01:19AM (#24694933)
I think you might have to change your "is" to a "was". wiki isn't really used anymore and the internal search is really really good.
Re:Programmable Search Engine by deanCommie on Tuesday October 06, 2020 @02:29AM (#24695224)
You guys don't use a wiki anymore? What replaced it?

Seems some form of wiki always has value inside a company?

Re:Programmable Search Engine by cameronbrown on Tuesday October 06, 2020 @07:48AM (#24696723)
There's a ton of different forms of documentation within Google, but mainly Google Docs or markdown.
Re:Programmable Search Engine by no_wizard on Monday October 05, 2020 @09:33PM (#24693963)
What is tf-idf, if you don’t mind me asking
Re:Programmable Search Engine by 8note on Monday October 05, 2020 @09:52PM (#24694066)
It's a search scoring algorithm, combining how frequently the search term is used in a document with how frequently it appears in other documents.

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

Re:Programmable Search Engine by nullsense on Monday October 05, 2020 @10:04PM (#24694109)
Term Frequency/Inverse Document Frequency.

It's what Apache Lucene does which is what ElasticSearch uses under the hood.

Re:Programmable Search Engine by dwhit on Monday October 05, 2020 @09:55PM (#24694079)
Re:Programmable Search Engine by throwaways885 on Monday October 05, 2020 @11:07PM (#24694398)
Pretty much. Internal search at Google actually used these appliances for a long time. Fortunately it's still been evolved and was externalised as a Google Cloud product a few years back.
Re:Programmable Search Engine by mtmail on Monday October 05, 2020 @06:02PM (#24692529)
Re:Programmable Search Engine by omgwtfbyobbq on Monday October 05, 2020 @08:17PM (#24693585)
The loss of merch was the writing on the wall. ;)

The appliance used to come with a T-shirt, but no longer includes one.

Re:Programmable Search Engine by gogopuppygogo on Tuesday October 06, 2020 @01:17AM (#24694926)
I remember when Apple sold me a developer license that came with a T shirt each year...
Re:Programmable Search Engine by dhosek on Monday October 05, 2020 @10:34PM (#24694251)
I was on a team that set one of those up for the Fox Filmed Entertainment intranet. It was a mess to set up, but it did look cool.
Re:Programmable Search Engine by fergie on Tuesday October 06, 2020 @01:47AM (#24695043)
I used to sell those. They were actually quite good for their time, especially when they first came out, but they were really expensive.

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.

Re:Programmable Search Engine by caro_douglos on Tuesday October 06, 2020 @04:06AM (#24695634)
Remember hosted urchin?
Re:Programmable Search Engine by vram22 on Monday October 05, 2020 @07:38PM (#24693280)
That was probably the Google Search Appliance.
Re:Programmable Search Engine by franze on Monday October 05, 2020 @05:52PM (#24692452)
I.e. my old "Google Digg” Search Engine. Called ”Gigg”

https://cse.google.com/cse?cx=001532657764357279270:7uvopk6d...

Re:Programmable Search Engine by seg_lol on Monday October 05, 2020 @07:34PM (#24693243)
Re:Programmable Search Engine by wbarber on Monday October 05, 2020 @10:16PM (#24694172)
Googled for confirmation that the Google CSE index is different from "the real Google Index" and haven't been able to confirm that.

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.

Re:Programmable Search Engine by ipsum2 on Monday October 05, 2020 @06:33PM (#24692795)
It looks like its still CSE, based off of the URL and the outdated design language before material (<2014? https://programmablesearchengine.google.com/cse/create/new)
Re:Programmable Search Engine by shaneapen on Monday October 05, 2020 @11:02PM (#24694372)
Exactly! Is there any new interesting features at the least? Nothing stands out to me except the stats.
Re:Programmable Search Engine by bluewavescrash on Monday October 05, 2020 @08:58PM (#24693792)
LOL I thought I was going crazy.
Re:Programmable Search Engine by softwaredoug on Monday October 05, 2020 @07:06PM (#24693044)
From a relevance PoV, I think the docs here[1] tell you everything you need to know

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

[2] http://querqy.org

Re:Programmable Search Engine by pknopf on Monday October 05, 2020 @08:42PM (#24693716)
I look Google's product, because it (looks?) like it would work with static sites, like GitHub pages.
Re:Programmable Search Engine by softwaredoug on Monday October 05, 2020 @10:44PM (#24694293)
Totally sounds great for that use case
Re:Programmable Search Engine by m-i-l on Tuesday October 06, 2020 @06:20AM (#24696280)
As others have noted, this is Google's Custom Search Engine rebranded, which will show adverts in the free version.

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/

Re:Programmable Search Engine by ignoramous on Tuesday October 06, 2020 @07:37AM (#24696654)
LunrJS looks great, but if one needs an instant text-based search, this is what I've got on my FAQ page:

        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)
Re:Programmable Search Engine by m-i-l on Friday October 09, 2020 @05:23PM (#24734593)
Looks nice, but as you say that just searches the current page. Here's how I search my entire site with slightly fewer lines of JavaScript:

  // 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);
    });
Re:Programmable Search Engine by tenkabuto on Monday October 05, 2020 @07:38PM (#24693274)
I wonder if there's a limit on how many URLs it can search and if I can import a list of URLs rather than inputting them one by one.

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...

Re:Programmable Search Engine by rc_mob on Monday October 05, 2020 @10:55PM (#24694345)
5000 is not very many at all
Re:Programmable Search Engine by tenkabuto on Tuesday October 06, 2020 @12:09AM (#24694606)
Yeah. I tried looking for some alternative service, but Bing's custom search is paid and has even lower limits.
Re:Programmable Search Engine by isnt on Tuesday October 06, 2020 @01:06PM (#24700046)
It's 5000 URL patterns e.g. www.example.com/* .pdf or example.com/foo*

https://support.google.com/programmable-search/answer/451388...

Re:Programmable Search Engine by transitivebs on Tuesday October 06, 2020 @01:38AM (#24695005)
Hmmm, I just tried setting up a new site search for an existing site and can't get any search results to show up. I'm guessing it takes awhile for the search index to populate, but that isn't really messaged anywhere in the product UX.

The last solution I used was https://www.meilisearch.com/ -- it's open source and way cheaper than Algolia.

Re:Programmable Search Engine by neurobashing on Monday October 05, 2020 @08:00PM (#24693457)
I set this up a while ago but never turned it on. I have a very simple web site - it's basically my mixology recipe book - and I started adding https://lunrjs.com to it this weekend. I ended up yak-shaving for the bulk of my time, but initial experiments were promising; anyone used it?
Re:Programmable Search Engine by Fileformat on Monday October 05, 2020 @08:13PM (#24693545)
I highly recommend lunr.js. I've used it on side projects both client side [1] and server side [2] and it works great. My only Yak-shaving was tweaking the separator regex.

[1] https://github.com/VectorLogoZone/vectorlogozone/blob/gh-pag...

[2] https://github.com/VectorLogoZone/logosearch/blob/main/src/s...

Re:Programmable Search Engine by freakynit on Tuesday October 06, 2020 @04:17AM (#24695683)
Same old Google trick to gain more control over others' content. Naah... not interested
Re:Programmable Search Engine by reilly3000 on Tuesday October 06, 2020 @12:53AM (#24694805)
How does this compare to Algolia? I was shocked at the irony when I discovered that Firebase docs recommended using Algolia for full-text search queries over Firebase data.
Re:Programmable Search Engine by sarthakjshetty on Tuesday October 06, 2020 @01:25AM (#24694963)
I think that has to do with the fact that both Algolia and Firebase went through YC. IIRC, PG stated that the first 100 or so customers of YC companies are in fact YC Companies. I think Firebase decided to give Algolia a try early on and decided to stick with them since.
Re:Programmable Search Engine by reilly3000 on Tuesday October 06, 2020 @01:55AM (#24695076)
The thing that’s kind of wild is that Firestore, which is their new reimplementation of the original Firebase db (now Realtime Database), is what is recommending Algolia:

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.

Re:Programmable Search Engine by Buetol on Tuesday October 06, 2020 @02:58AM (#24695325)
Took 2sec to setup and works very well !

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

Re:Programmable Search Engine by jpadkins on Tuesday October 06, 2020 @11:39AM (#24698872)
wow. what a surprise to see this on hn today.

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

Re:Programmable Search Engine by Nazzareno on Tuesday October 06, 2020 @04:38AM (#24695791)
They claim "pay a low price for an ad-free experience", but what is the price?
Re:Programmable Search Engine by Nazzareno on Wednesday October 07, 2020 @03:44AM (#24706139)
Re:Programmable Search Engine by norswap on Tuesday October 06, 2020 @07:39AM (#24696669)
Was curious, and found a "custom search engine" (previous name of this product) for my tumblr blogs (which are still online) that I made back in the days.

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.

Re:Programmable Search Engine by skytreader on Tuesday October 06, 2020 @10:16AM (#24697848)
What a horrible product name. I've always lamented the fact that big brands need very little creativity in product naming. Though Google is sometimes but often lazy, I can at least ascertain some reason behind their product names:

- 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.

Re:Programmable Search Engine by Ocelot20 on Tuesday October 06, 2020 @07:53AM (#24696743)
In case you're curious...

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

Re:Programmable Search Engine by sa46 on Tuesday October 06, 2020 @03:36PM (#24701498)
Interesting,the Google results for "search engine" are heavily weighted by recency compared to Algolia.

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...

Re:Programmable Search Engine by fsflover on Tuesday October 06, 2020 @04:06AM (#24695632)
See also: https://yacy.net, open source p2p search engine, which can be used locally too.
Re:Programmable Search Engine by schwinn140 on Monday October 05, 2020 @06:20PM (#24692684)
I wonder if they're getting interested in this again after seeing Algolia and Elasticsearch take off? I suppose this was only a matter of time.
Re:Programmable Search Engine by xtiansimon on Tuesday October 06, 2020 @08:44AM (#24697091)
Off-Topic question for Search-heads. Anyone know of an in-browser solution to make web search start with your bookmarks (rank previous bookmarked items higher)?

[Solution to search browser-URL-history first before the rest of the WWW][1]

[1]: https://softwarerecs.stackexchange.com/questions/46270/solut...

Re:Programmable Search Engine by Havoc on Tuesday October 06, 2020 @04:59AM (#24695901)
Well that was underwhelming
Re:Programmable Search Engine by dimator on Monday October 05, 2020 @06:27PM (#24692747)
Now everyone that's ever said "I would pay for an ad free experience" can get what they want.... and come up with another reason to be unsatisfied.
Re:Programmable Search Engine by t0astbread on Monday October 05, 2020 @07:09PM (#24693056)
I propose data collection!