Skip to content
This repository has been archived by the owner on Sep 2, 2020. It is now read-only.

Search on an index pattern #21

Open
yogeek opened this issue Jan 7, 2018 · 0 comments
Open

Search on an index pattern #21

yogeek opened this issue Jan 7, 2018 · 0 comments

Comments

@yogeek
Copy link

yogeek commented Jan 7, 2018

Hello,

Is it possible to search on an index pattern by specifying a wilcard in the Meta.index of the BlogIndex class ? I tried it like this :

class BlogIndex(DocType):
    pk = Integer()
    title = Text(fields={'raw': Keyword()})
    created_at = Date()
    body = Text()
    tags = Keyword(multi=True)
    is_published = Boolean()

    class Meta:
        index = 'blog-*'

But it gives an error when BlogIndex.init() is called because it is not possible to create an index with a wildcard...
If indexes already exists in ES, is it possible to use a wildcard index only for the search part ?
(in your example, you pass es_model=BlogIndex in the view : could the index of BlogIndex be replaces there to put a wildcard ?)

Thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant