<commit_before>import instantsearch from "../../../src/lib/main.js";
import algoliasearch from "algoliasearch/lite";
import capitalize from "lodash/capitalize";

window.instantsearch = instantsearch;
window.search = instantsearch({
  indexName: window.searchConfig.indexName || "instant_search",
  searchClient: algoliasearch(
    window.searchConfig.appId || "latency",
    window.searchConfig.apiKey || "6be0576ff61c053d5f9a3225e2a90f76"
  ),
  searchParameters: {
    hitsPerPage: 3,
  }
});

const el = html => {
  const div = document.createElement("div");
  div.innerHTML = html;
  return div;
};

function initWidgetExample(codeSample, index) {
  const state = { IS_RUNNING: false };

  const [, widgetName] = /widgets.(\S+)\(/g.exec(
    codeSample.lastChild.innerText
  );

  // container for code sample live example
  const liveExampleContainer = createLiveExampleContainer(
    widgetName,
    "widget",
    index
  );
<commit_msg>fix(community): fix search config (#3142)<commit_after>import instantsearch from "../../../src/lib/main.js";
import algoliasearch from "algoliasearch/lite";
import capitalize from "lodash/capitalize";

const {
  appId = "latency",
  apiKey = "6be0576ff61c053d5f9a3225e2a90f76",
  ...searchConfig
} = window.searchConfig || {};

window.instantsearch = instantsearch;
window.search = instantsearch({
  indexName: "instant_search",
  searchClient: algoliasearch(appId, apiKey),
  searchParameters: {
    hitsPerPage: 3,
  },
  ...searchConfig
});

const el = html => {
  const div = document.createElement("div");
  div.innerHTML = html;
  return div;
};

function initWidgetExample(codeSample, index) {
  const state = { IS_RUNNING: false };

  const [, widgetName] = /widgets.(\S+)\(/g.exec(
    codeSample.lastChild.innerText
  );

  // container for code sample live example
  const liveExampleContainer = createLiveExampleContainer(
    widgetName,
    "widget",
    index
  );

{'fraction_non_alphanumeric': 0.13312532501300053, 'fraction_numerical': 0.0249609984399376, 'mean_word_length': 4.144385026737968, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1668851', 'n_tokens_mistral': 651, 'n_tokens_neox': 615, 'n_words': 130}