Skip to content

Instantly share code, notes, and snippets.

@ritec
Forked from aaronsakowski/model.rb
Created July 30, 2021 20:24
Show Gist options
  • Select an option

  • Save ritec/759d5db42a74a8f16a315b61020ea059 to your computer and use it in GitHub Desktop.

Select an option

Save ritec/759d5db42a74a8f16a315b61020ea059 to your computer and use it in GitHub Desktop.

Revisions

  1. @aaronsakowski aaronsakowski renamed this gist Oct 27, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @aaronsakowski aaronsakowski created this gist Oct 27, 2013.
    66 changes: 66 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,66 @@
    searchkick autocomplete: ["name"],
    settings: {
    analysis: {
    analyzer: {
    searchkick_keyword: {
    type: "custom",
    tokenizer: "keyword",
    filter: ["lowercase", "snowball"]
    },
    default_index: {
    type: "custom",
    tokenizer: "standard",
    # synonym should come last, after stemming and shingle
    # shingle must come before snowball
    filter: ["standard", "lowercase", "asciifolding", "stop", "searchkick_index_shingle", "snowball"]
    },
    searchkick_search: {
    type: "custom",
    tokenizer: "standard",
    filter: ["standard", "lowercase", "asciifolding", "stop", "searchkick_search_shingle", "snowball"]
    },
    searchkick_search2: {
    type: "custom",
    tokenizer: "standard",
    filter: ["standard", "lowercase", "asciifolding", "stop", "snowball"]
    },
    searchkick_autocomplete_index: {
    type: "custom",
    tokenizer: "standard",
    filter: [ "standard", "lowercase", "asciifolding", "searchkick_autocomplete_ngram" ]
    },
    searchkick_autocomplete_search: {
    type: "custom",
    tokenizer: "standard",
    filter: [ "standard", "lowercase", "asciifolding"]
    },
    searchkick_suggest_index: {
    type: "custom",
    tokenizer: "standard",
    filter: ["lowercase", "asciifolding", "searchkick_suggest_shingle"]
    }
    },
    filter: {
    searchkick_autocomplete_ngram: {
    type: "edgeNGram",
    max_gram: 15,
    min_gram: 1
    },
    searchkick_index_shingle: {
    type: "shingle",
    token_separator: ""
    },
    # lucky find http://web.archiveorange.com/archive/v/AAfXfQ17f57FcRINsof7
    searchkick_search_shingle: {
    type: "shingle",
    token_separator: "",
    output_unigrams: false,
    output_unigrams_if_no_shingles: true
    },
    searchkick_suggest_shingle: {
    type: "shingle",
    max_shingle_size: 5
    }
    },
    }
    }