I have time trying to figure out the characters of the apostrophe at the beginning or in the middle of words. I can deal with possessive English, but I also try to please the French and process words like "d'action", where the character of the apostrophe comes at the beginning of the word, and not at the end, like "her."
A search through haystack auto_query for "d action" will return results, but "d'action" returns nothing. If I request the elasticsearch _search API (_search? Q = D% 27ACTION), I directly get the results for "d'action". So I wonder if this is a hay mover problem.
My configuration:
'settings': { "analysis": { "char_filter": { "quotes": { "type": "mapping", "mappings": [ "\\u0091=>\\u0027", "\\u0092=>\\u0027", "\\u2018=>\\u0027", "\\u2019=>\\u0027", "\\u201B=>\\u0027" ] } }, "analyzer": { "ch_analyzer": { "type": "custom", "tokenizer": "standard", "filter": ['ch_en_possessive_word_delimiter', 'ch_fr_stemmer'], "char_filter": ['html_strip', 'quotes'], }, }, "filter": { "ch_fr_stemmer" : { "type": "snowball", "language": "French" }, "ch_en_possessive_word_delimiter": { "type": "word_delimiter", "stem_english_possessive": True } } } }
I have also subclassed ElasticsearchSearchBackend and BaseEngine, so I can add the above configuration:
class ConfigurableESBackend(ElasticsearchSearchBackend):
source share