Skip to content

No way to enforce an nGram filter #53

Description

@djpentz

I can't seem to get the plugin to enforce an ngram filter for one of my indexes. I must confess I'm still trying to completely figure out from stepping through the code how much control the Config.groovy file gives me, but I declared the following in it to no avail:

elasticSearch {
index {
analysis {
analyzer {
"my_analyzer" {
type = "custom"
tokenizer = "lowercase"
filter = ["my_ngram"]
}
}
filter {
"my_ngram" {
type = "nGram"
min_gram = 2
max_gram = 10
}
}
}
}
}

In the domain class I indicate:

static searchable = {
    name boost: 2.0, analyzer: "my_analyzer"
}

Basically I want to be able to search through a list of companies in response to a typeahead control and be able to provide the user with a list of suggestions based on substring matches. Is this possible currently with the plugin or would I need to fork and roll my own?

Many thanks for a superb plugin!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions