- Change Summary:
-
Add screenshots.
- Added Files:
Refactor Whoosh and Elasticsearch support into pluggable backends
Review Request #8254 — Created June 21, 2016 and submitted
A previous patch introduced support for Elasticsearch instead of Whoosh
as an alternative search engine backend. Now, both Whoosh and
Elasticsearch are provided asSearchBackend
s and we produce the search
configuration form dynamically based on what search backends are
available.We now use a registry to manage these backends. Extensions can now
register additional search backends (such as for Solr or other
Haystack-supported backends) through this interface.The search settings have been moved out of the general settings into its
own form as the logic just for the form generation was getting rather
complicated.
- Ran unit tests.
- Verified the settings form worked correctly.
Description | From | Last Updated |
---|---|---|
Can you make this field longer? |
chipx86 | |
Can you make this field longer? |
chipx86 | |
dddd |
QH qhr | |
noqa? |
david | |
Returns? |
david | |
Missing a period. At first I was going to say this should say "Form," but it's managing multiple forms. Can … |
chipx86 | |
I think maybe, "If enabled, a search field will be provided for ..." |
chipx86 | |
"review requests, diffs, and users." |
chipx86 | |
This is redundant. We can get rid of it. |
chipx86 | |
This is redundant. We can get rid of it. |
chipx86 | |
Missing a description. |
chipx86 | |
"... for the base form and every search engine settings form.""" Which I'm not sure we want, actually. Probably just … |
chipx86 | |
This is missing a "Returns". |
chipx86 | |
Let's expand on the error message to make it more helpful: The search engine "%s" could not be found. If … |
chipx86 | |
Missing a "Returns". |
chipx86 | |
Missing docs. |
chipx86 | |
Let's add the same comment here that we have on other forms: # Reload any important changes into the Django … |
chipx86 | |
We're going to need to migrate this setting. |
chipx86 | |
Same error as above. |
chipx86 | |
Missing docs. |
chipx86 | |
Let's pass in files as well, in case we have some backend in the future that requires some uploaded license … |
chipx86 | |
We should have a docstring at the top of this file. |
chipx86 | |
We should have a docstring for this file. |
chipx86 | |
Missing docs. |
chipx86 | |
Let's flesh this out so it's clear what the purpose and responsibilities are. |
chipx86 | |
Let's have a _name suffix, to distingush it from a class or something. |
chipx86 | |
Missing Args. |
chipx86 | |
This is kind of vague. I'm not really left with an idea of what goes here. It'd be nice to … |
chipx86 | |
Missing *args. |
chipx86 | |
Missing a file docstring. |
chipx86 | |
"Elasticsearch". (I sure wish the "s" was still capitalized in their name...) |
chipx86 | |
Maybe say "... that the elasticsearch module ..." |
chipx86 | |
Would be nice to point to the docs. I have this in the Conditions stuff: This works as a :py:ref:`registry … |
chipx86 | |
"... with the specified ID." |
chipx86 | |
They don't return None if not found. They raise an exception. If we want to return None, we should make … |
chipx86 | |
Missing a file docstring. |
chipx86 | |
Would be nice to narrow down this selector by ID, if we can. (Not sure if the form has one.) |
chipx86 | |
Blank line between these. |
chipx86 | |
{% endblock scripts-post %} |
chipx86 | |
search before signals. |
chipx86 | |
This lost its docstring. |
chipx86 | |
No need for the parens and explicit tuple here. |
chipx86 | |
Missing Returns: |
chipx86 | |
Missing a file docstring. |
chipx86 | |
Missing a docstring. |
chipx86 | |
No need for the type= |
chipx86 | |
'SearchSettingsForm' imported but unused |
reviewbot | |
Col: 80 E501 line too long (113 > 79 characters) |
reviewbot | |
'elasticsearch' imported but unused |
reviewbot | |
Should this string be marked for localization? |
david | |
Col: 80 E501 line too long (113 > 79 characters) |
reviewbot | |
'elasticsearch' imported but unused |
reviewbot |
- Commit:
-
03be0c1e3729ac9e5beb5e7f5f5bced98625c79d14d135aab4325ab473df1f26407b34eb75e74e33
- Diff:
-
Revision 2 (+465 -166)
-
Foundation for all this looks great! Nearly all my comments have to do with documentation (I really want us to flesh these out going forward, so we can help foster a better development community and also make life easier for students.)
-
-
-
Missing a period.
At first I was going to say this should say "Form," but it's managing multiple forms. Can you expand the comment and describe what this class is handling?
-
-
-
-
-
-
"... for the base form and every search engine settings form."""
Which I'm not sure we want, actually. Probably just want it for the base form. I think we should take the specific arguments we need (data, files) and pass those below.
-
-
Let's expand on the error message to make it more helpful:
The search engine "%s" could not be found. If this was provided by an extension, you'll need to make sure the extension is enabled.
-
-
-
Let's add the same comment here that we have on other forms:
# Reload any important changes into the Django settings.
-
-
-
-
Let's pass in files as well, in case we have some backend in the future that requires some uploaded license key or something.
-
-
-
-
-
-
-
This is kind of vague. I'm not really left with an idea of what goes here. It'd be nice to flesh this out a bit, maybe talk about the kinds of things this might want to check.
-
-
-
-
-
Would be nice to point to the docs. I have this in the Conditions stuff:
This works as a :py:ref:`registry <registry-guides>`, allowing additional choices to be added dynamically by extensions or other code.
-
-
They don't return
None
if not found. They raise an exception. If we want to returnNone
, we should make sure it's doing that here. -
-
-
-
- Change Summary:
-
Address Christian's issues.
Address the fact that the form data wasn't actually saving. - Commit:
-
14d135aab4325ab473df1f26407b34eb75e74e33be9ff7aeb21de0c537a954dbe61a41a1f863a301
- Diff:
-
Revision 3 (+532 -166)
- Added Files:
- Change Summary:
-
Addressed Christian's issues.
- Diff:
-
Revision 4 (+139 -61)
-
Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/admin/views.py reviewboard/search/search_backends/registry.py reviewboard/search/search_backends/whoosh.py reviewboard/search/__init__.py reviewboard/search/search_backends/base.py reviewboard/search/search_backends/elasticsearch.py Ignored Files: reviewboard/htdocs/media/10854188_291516057725053_7460375966763285299_o.jpg reviewboard/templates/admin/search_settings.html reviewboard/htdocs/media/1420843716467.png Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/admin/views.py reviewboard/search/search_backends/registry.py reviewboard/search/search_backends/whoosh.py reviewboard/search/__init__.py reviewboard/search/search_backends/base.py reviewboard/search/search_backends/elasticsearch.py Ignored Files: reviewboard/htdocs/media/10854188_291516057725053_7460375966763285299_o.jpg reviewboard/templates/admin/search_settings.html reviewboard/htdocs/media/1420843716467.png
-
-
-
- Diff:
-
Revision 5 (+140 -62)
-
Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/admin/views.py reviewboard/search/search_backends/registry.py reviewboard/search/search_backends/whoosh.py reviewboard/search/__init__.py reviewboard/search/search_backends/base.py reviewboard/search/search_backends/elasticsearch.py Ignored Files: reviewboard/htdocs/media/10854188_291516057725053_7460375966763285299_o.jpg reviewboard/templates/admin/search_settings.html reviewboard/htdocs/media/1420843716467.png Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/admin/views.py reviewboard/search/search_backends/registry.py reviewboard/search/search_backends/whoosh.py reviewboard/search/__init__.py reviewboard/search/search_backends/base.py reviewboard/search/search_backends/elasticsearch.py Ignored Files: reviewboard/htdocs/media/10854188_291516057725053_7460375966763285299_o.jpg reviewboard/templates/admin/search_settings.html reviewboard/htdocs/media/1420843716467.png
-
-