Skip to content

suggest with completion not working #202

@Mohammadhp

Description

@Mohammadhp

I create a Document as below :

@registry.register_document
class QuestionDocument(Document):
    name = fields.CompletionField(
        attr='title'
    )

    class Index:
        name = 'questions'

    class Django:
        model = QuestionModel
        fields = ['text', 'title']

And then try to perform a suggest query with completion as following:

matched_questions = list(QuestionDocument.search().suggest("suggestions", word, completion={'field': 'name'}).execute())

But i get error regarding that name is not a completion suggest field.

elasticsearch.exceptions.RequestError: RequestError(400, 'search_phase_execution_exception', 'Field [name] is not a completion suggest field')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions