-
-
Save ritec/759d5db42a74a8f16a315b61020ea059 to your computer and use it in GitHub Desktop.
Searchkick autocomplete by token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment