Created
March 13, 2018 16:35
-
-
Save colonelrascals/233a37a7f3f5fb8a0fe00f420f2b44ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def indexing(self): | |
| obj = UserDoc( | |
| meta={"id": self.id}, | |
| email=self.email, | |
| first_name=self.first_name, | |
| last_name=self.last_name, | |
| date_joined=self.date_joined, | |
| expertise=self.expertise_str, | |
| institution=self.institution, | |
| position=self.position, | |
| name_suggest=self.full_name, | |
| ) | |
| print obj | |
| obj.save(index="users2") | |
| return obj.to_dict(include_meta=True) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # @users_index.doc_type | |
| class User(DocType): | |
| email = Text() | |
| first_name = Text() | |
| last_name = Text() | |
| date_joined = Date() | |
| expertise = Text() | |
| institution = Text() | |
| position = Text() | |
| # autocomplete fields | |
| name_suggest = Completion(analyzer=analyzer("standard")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment