Hi,

Is there a way to analyze a field that is passed to the context suggester?
If, say, I have this in my mapping:

    mappings: {
        myitem: {
            title: {type: 'string'},
            content: {type: 'string'},
            user: {type: 'string', index: 'not_analyzed'},
            suggest_field: {
                type: 'completion',
                payloads: false,
                context: {
                    user: {
                        type: 'category',
                        path: 'user'
                    },
                }
            }
        }
    }


and I index this doc:
    POST /myindex/myitem/1
    {
        title: "The Post Title"
        content: ...
        user: 123
        suggest_field: {
            input: "The Post Title",
            context: {
                user: 123
            }
        }
    }


I would like to analyze the input first, split it into separate words, run 
it through lowercase and stop words filters so that the context suggester 
actually gets 
        suggest_field: {
            input: ["post", "title"],
            context: {
                user: 123,
                entity: 'posts'
            }
        }



I know I can pass an array into the suggest field but I would like to 
avoid lowercasing the text, splitting it, running the stop words filter in 
my application, before passing to ES. If possible, I would rather ES do 
this for me. I did try adding an index_analyzer to the field mapping but 
that didn't seem to achieve anything.

OR, is there another way to get autocomplete suggestions for words?

Cheers,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/d8a34b96-c26b-4d83-a664-5b8c79fbe568%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to