Skip to content

Instantly share code, notes, and snippets.

@brianmcgue
brianmcgue / fix_index_pointers.rb
Created August 18, 2020 22:23
This is a script to run against Elastic Enterprise Search <= 7.9.0 for customers that are experiencing issues indexing documents.
require 'httpclient'
require 'json'
require 'uri'
# --------------------------------------
# Edit these variables
HOST = 'http://localhost:9200'
ELASTICSEARCH_USERNAME = 'elastic'
ELASTICSEARCH_PASSWORD = 'changeme'
DRY_RUN = false # don't actually edit anything yet
require 'httpclient'
require 'json'
require 'uri'
# --------------------------------------
# Edit these variables
HOST = 'http://localhost:9200'
ELASTICSEARCH_USERNAME = 'elastic'
ELASTICSEARCH_PASSWORD = 'changeme'
DRY_RUN = false # don't actually edit anything yet
@brianmcgue
brianmcgue / red_hat_gcp_testing.md
Last active June 16, 2020 15:36
Testing Enterprise Search on Red Hat

Testing Enterprise Search on Red Hat

Set up a Red Hat GCP instance in the elastic-swiftype project

  1. Visit the elastic-swiftype GCP project
    • if you don't have access, talk to @kellen and @bvans about getting access
  2. Click CREATE INSTANCE
  3. Name the instance
  4. Select a region
  5. Set the Machine type to n1-standard-4
  6. Change the Boot disk and set the follow parameters
@brianmcgue
brianmcgue / schema_ranking_correlation.rb
Last active May 14, 2020 01:13
An attempt to determine if how correlated the results are for 5.x and 7.x schema
require 'json'
require 'elastic-site-search' # gem install elastic-site-search
require 'pry'
class RankingComparer
API_ENDPOINT = 'http://localhost:3002/api/v1/'
API_KEY = 'uQTxqyzMRxYMXgnnxVU1'
PAGE_SIZE = 40
attr_reader :base_engine_name, :new_engine_name
def spongebob_case(string)
string.split('.').map do |sentence|
capital = false
sentence.strip.split.map do |word|
if word.downcase == 'i'
'I'
else
capital = false
word.each_char.map do |char|
if char.downcase == 'l'