Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable stemmer filter in elasticsearch index #61

Open
jvence opened this issue Oct 19, 2020 · 1 comment
Open

Enable stemmer filter in elasticsearch index #61

jvence opened this issue Oct 19, 2020 · 1 comment

Comments

@jvence
Copy link

jvence commented Oct 19, 2020

I think it would be a good idea to update data_utils.py to include a Stemming filter by default when creating Elasticsearch indices. This would tremendously improve the results returned by ES.

@jvence
Copy link
Author

jvence commented Oct 19, 2020

Here's my take on it:

index_settings = {
    "settings": {
        "analysis": {
            "filter": {
                "english_stop": {
                    "type": "stop",
                    "stopwords": "_english_"
                },

                "english_stemmer": {
                    "type": "stemmer",
                    "language": "english"
                }
            },
            "analyzer": {
                "rebuilt_english": {
                    "tokenizer": "standard",
                    "filter": [
                        "lowercase",
                        "english_stop",
                        "english_stemmer"
                    ]
                }
            }
        }
    },
    "mappings": {
        "_doc": {
            "properties": {
                "content": {
                    "type": "text",
                    "analyzer": "rebuilt_english"
                }
            }
        }
    }
}

@jvence jvence changed the title Enable stemmer filter in data_utils Enable stemmer filter in elasticsearch index Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant