Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'Create/Edit Search Schema' functionality #20

Closed
dmitrizagidulin opened this issue Nov 25, 2015 · 3 comments
Closed

Implement 'Create/Edit Search Schema' functionality #20

dmitrizagidulin opened this issue Nov 25, 2015 · 3 comments
Assignees

Comments

@dmitrizagidulin
Copy link
Contributor

Currently, to create or edit a search schema, a user has to download the default schema (which they deduce from our docs), edit it in a text editor, and then upload it to Riak via curl.

Since we're already linking to the raw search schema in several places in the Explorer GUI (such as the Cluster view, Bucket Type and Bucket views, etc), we should make user's lives easier and allow them to edit the schema directly via Explorer.

So:

  1. Create a SearchSchema model (once Issue Implement 'Search Index detail' view #18 - Implement 'Search Index detail' view is implemented, modify the Index model to have a 'belongsTo' relationship with the Schema model (currently, an index just has a schema id field)).
  2. Implement a Create/Edit Search Schema screen -- allow users to edit the schema in a textbox.
  3. On saving, PUT the schema to Riak, as usual.
  4. Do a global search for /search/schema/ -- there are a handful of places where we build the raw schema URL manually, in the templates. Extract that URL to a Schema model property.

Bonus points for integrating a nice code editor (with syntax highlighting) JS plugin to edit the schemas, instead of a plain textbox.

Note: there is currently no way to list which schemas have been uploaded to Riak. (This'll require a separate issue, on the Explorer API -- see issue basho-labs/riak_explorer#89).

Note: Once a schema has been edited, the Search Indexes that are using it have to be reloaded. (it doesn't just take effect automatically once uploaded). The ability to reload an index (for user convenience) should also be implemented, separately (see issue basho-labs/riak_explorer#88).

@paultannenbaum
Copy link
Contributor

So you mention having a index having a 'hasMany' relationship with schemas, but is that really the case? Seems to me with how things are setup that they are a 1 to 1 relationship. Either way I can get started on this but would love clarity on how these two interact

@dmitrizagidulin
Copy link
Contributor Author

Huh, I have no idea why I wrote that, initially :) (I'll edit the description shortly).

It's the reverse, actually. An index can only have one schema. (Which can be changed, although that requires the index to be reloaded). But one schema can be used by many indexes.
So it's a logical/abstract 'schema hasMany indexes' relationship, but not an ember data relationship. There's no API call that says "give me all the indexes used by this schema".

@paultannenbaum paultannenbaum self-assigned this Dec 16, 2015
@dmitrizagidulin
Copy link
Contributor Author

Implemented by #58, closing.

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

No branches or pull requests

2 participants