Add support for Elasticsearch
Review Request #8209 — Created June 2, 2016 and submitted
The RB admin panel now includes settings for choosing between Whoosh
(the default) and Elasticsearch as search engines.
Set up Review Board to use Elasticsearch and was able to perform
searches after building the index.
Description | From | Last Updated |
---|---|---|
Let's swap these fields. The index depends on the URL. We should also increase the width of both fields. The … |
chipx86 | |
Can we make a constant on the class and then use that both here and in the SEARCH_ENGINE_CHOICES tuple? |
david | |
'elasticsearch' imported but unused |
reviewbot | |
Since there's only one variable being formatted in, we can just use %s and positional-based formatting, which should shorten this … |
david | |
How about "reviewboard"? |
david | |
You can use the new constant(s) here, too. |
david | |
You can use the new constant(s) here, too. |
david | |
Add a blank line between these? |
david | |
Hmm, this is a little weird. I think I'd prefer just attaching the change handler and then calling updateCacheFormDisplay() at … |
david | |
This should fit on one line. |
david | |
Same deal here. |
david | |
'elasticsearch' imported but unused |
reviewbot | |
'elasticsearch' imported but unused |
reviewbot | |
Since these are POD constants, the variable names should be all caps. As it is where you used it I … |
david | |
You could just make the jquery inline here rather than defining a variable and using add(): $('#row-search_results_per_page, #row-search_engine') .toggle(searchEnabled); |
david | |
You could just make the jquery inline here rather than defining a variable. |
david | |
You could just make the jquery inline here rather than defining a variable and using add(): $('#row-elasticsearch_index_name, #row-elasticsearch_url') .toggle(searchEnabled && … |
david | |
There's an extra line here. |
david | |
Something terrible has happened here with your editor. Please reindent. You can also combine the selectors into a single string … |
david | |
Let's rename during import to search_engines, so it's clear and won't conflict in the future. |
chipx86 | |
I think something went horribly wrong with search/replace. We're now shouting WOOSH and ELASTICSEARCH in a lot of places that … |
david | |
Missing docstring. |
chipx86 | |
'elasticsearch' imported but unused |
reviewbot | |
Swap these. |
chipx86 | |
Let's rename here as well. |
chipx86 | |
Missing a file docstring. |
chipx86 | |
Can we document both of these? |
chipx86 | |
Why the "WHOOSH"? |
chipx86 | |
Can be: $('#id_search_engine, #id_search_enable') .change(updateSearchFormDisplay); |
david | |
? This isn't how it's listed in pypi. |
chipx86 | |
'elasticsearch' imported but unused |
reviewbot |
-
-
Can we make a constant on the class and then use that both here and in the
SEARCH_ENGINE_CHOICES
tuple? -
Since there's only one variable being formatted in, we can just use %s and positional-based formatting, which should shorten this code a bit.
-
-
-
-
-
Hmm, this is a little weird. I think I'd prefer just attaching the change handler and then calling
updateCacheFormDisplay()
at the end of the function. -
-
-
Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py Ignored Files: reviewboard/templates/admin/general_settings.html Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py Ignored Files: reviewboard/templates/admin/general_settings.html Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/search/engines.py Ignored Files: reviewboard/templates/admin/general_settings.html Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/search/engines.py Ignored Files: reviewboard/templates/admin/general_settings.html
-
-
-
-
Since these are POD constants, the variable names should be all caps. As it is where you used it I mistook it for a class name.
Probably also don't need the blank line between them.
-
You could just make the jquery inline here rather than defining a variable and using
add()
:$('#row-search_results_per_page, #row-search_engine') .toggle(searchEnabled);
-
-
You could just make the jquery inline here rather than defining a variable and using
add()
:$('#row-elasticsearch_index_name, #row-elasticsearch_url') .toggle(searchEnabled && searchEngine === 'elasticsearch');
-
-
Something terrible has happened here with your editor. Please reindent.
You can also combine the selectors into a single string with a comma.
- Change Summary:
-
Address David's issues
- Commit:
-
b45d758a8a2418a9f76629e61c9213451fbc8eaa35eaaeded7060099b50331bf8a2630e5f904f4cd
-
Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py setup.py reviewboard/search/engines.py Ignored Files: reviewboard/templates/admin/general_settings.html Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py setup.py reviewboard/search/engines.py Ignored Files: reviewboard/templates/admin/general_settings.html
-
-
I think rather than hard-coding everything for Whoosh and Elasticsearch, we should do what we do for auth, hosting services, etc. and have a concept of backends that are registered as entrypoints, with config forms. It's a little more work up-front, but it makes it a lot easier down the road for us or third-parties to support additional search engines (say, AWS's search services).
We'd still go through Haystack for all this, so any extension providing such things would need to deal with that, but we'd have our side covered when it comes to settings and configuration.
-
Let's swap these fields. The index depends on the URL.
We should also increase the width of both fields. The URL especially.
-
-
-
-
-
-
-
-
- Change Summary:
-
Addressed all issues
- Commit:
-
35eaaeded7060099b50331bf8a2630e5f904f4cd2a246112bee6fc3747cd52d98f032e60387e836f
-
Tool: Pyflakes Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/search/search_engines.py Ignored Files: reviewboard/templates/admin/general_settings.html Tool: PEP8 Style Checker Processed Files: reviewboard/admin/siteconfig.py reviewboard/admin/forms.py reviewboard/search/search_engines.py Ignored Files: reviewboard/templates/admin/general_settings.html
-