Skip to content

Instantly share code, notes, and snippets.

#include "postgres.h"
#include "fmgr.h"
#include "utils/builtins.h"
PG_MODULE_MAGIC;
PG_FUNCTION_INFO_V1(char_count_c);
Datum
char_count_c(PG_FUNCTION_ARGS)
@tsg
tsg / hybrid_search.py
Created February 27, 2024 21:18
Hybrid Search using Xata
from xata.client import XataClient
from sentence_transformers import SentenceTransformer
import sys
import time
xata = XataClient()
# expect the query as the first argument
if len(sys.argv) != 2:
print("Usage: python hybrid_search.py <query>")
@tsg
tsg / recipes.md
Last active March 1, 2024 11:55
Loading recipes for search testing

Testing

CREATE TABLE recipes(
	title text,
	ingredients text,
	directions text,
	link text,
	source text,
	ner text, 
@tsg
tsg / gist:23534eb1822d1e84947731c38194be1f
Created July 3, 2020 14:32
Split Kibana ndjson into search/visualization/dashboard as expected by the package registry
import json
import sys
import os
# create dest directories
def ensure_directories(dest_dir):
def ensure_dir(dir):
if not os.path.exists(dir):
os.makedirs(dir)

Keybase proof

I hereby claim:

  • I am tsg on github.
  • I am tudor_g (https://keybase.io/tudor_g) on keybase.
  • I have a public key ASDGbXTP31qAPvVyBpru7063YfSmT4BjDtKkaP7vecsxAAo

To claim this, I am signing this object:

###################### Auditbeat Configuration Example #########################
# This is an example configuration file highlighting only the most common
# options. The auditbeat.reference.yml file from the same directory contains all
# the supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/auditbeat/index.html
#========================== Modules configuration =============================