-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[docs] reorder blog articles #97
Conversation
fa8123a
to
1b22774
Compare
de6fc1e
to
adc28dd
Compare
- https://github.com/kvch/searx-admin last maintained 4 years ago - searx-admin does not support 'use_default_settings' [1] (b4b81a5) [1] https://searxng.github.io/searxng/admin/settings.html#use-default-settings Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The article "Command line engines" should be in admin's engine documentation (like the recoll engine). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The article "SQL engines" should be in admin's engine documentation (like the recoll engine). Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This article is obsolete since a long time: Python 2 support has been dropped and these days, virtualenv is managed by ``make pyenv.install``. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The article "Offline engines" should be in developer's documentation next to chapter "Engine overview". Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This engine just exists for documentation purpose. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a a complete revision of the article "Offline engines", which also merges the content from the searx-wiki [1] into this article. [1] https://github.com/searx/searx/wiki/Offline-engines Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
- Split chapter "Engines" and rename it into "Engines & Settings" - Move docs/admin/engines.rst -> docs/admin/engines/engine_settings.rst Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This engine just exists for documentation purpose. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch revision of the article "Engine Overview": - add links & anchors - improve formating of the tables Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This patch is a marginal revision of the article "settings.yml", most changes are from normalizing the YAML syntax. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
The blog article 'Query your local search engines' has been renamed 'Local Search Engines', revised and moved into admin's chapter 'Engine & Settings'. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Move article 'Developing in Linux Containers' from blog section do developer section. Since there are no more articles in the blog section, remove the section completely. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
adc28dd
to
6f7b0d7
Compare
FYI: online HTML representation of this PR is available from https://return42.github.io/searxng/ |
|
||
""" | ||
global _my_online_engine # pylint: disable=global-statement | ||
_my_online_engine = engine_settings.get('name') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand it makes a demo of the init
function, but the parameter is not used.
Out of topic for this PR, engine_settings
values are copied as attributes into the module. So engine_settings.get('name')
could be name
(with global _my_online_engine, name
above).
And engine_settings
can be:
{
k: getattr(engine, k)
for k in dir(engine)
if not k.startswith('__') and not callable(getattr(engine, k))
}
instead of get_engine_from_settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I guess I have a problem to understand why we have this argument engine_settings
.. does it make sense to drop this argument? .. for me it was a bit confusing that we update module's name space with the values from YAML (engine_data
):
searxng/searx/engines/__init__.py
Lines 117 to 125 in 5f76238
def update_engine_attributes(engine, engine_data): | |
# set engine attributes from engine_data | |
for param_name, param_value in engine_data.items(): | |
if param_name == 'categories': | |
if isinstance(param_value, str): | |
param_value = list(map(str.strip, param_value.split(','))) | |
engine.categories = param_value | |
elif param_name != 'engine': | |
setattr(engine, param_name, param_value) |
and later, when the processor is initialized ...
searxng/searx/search/processors/abstract.py
Lines 70 to 72 in 5c5db71
def initialize(self): | |
try: | |
self.engine.init(get_engine_from_settings(self.engine_name)) |
we call a function that gather engine_data
from the YAML settings.
In sense of single point of definition I guess it is better to say, that everything is in the namespace of engine's modul and this can be configured by (is updated from) the YAML file.
But may be I'm totally wrong, since I do not have a complete overview.
The naming of overrides is arbitrary. But the recommended overrides are the | ||
following: | ||
Global names with a leading underline are *private to the engine* and will | ||
not be overwritten. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, names starting with _
can be overwritten but they can be None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops .. I forgot to reflect your hint into the documentation. What Do you think, is it better to fix the documentation or is it better to fix the code that overrides private members?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to fix the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[1] searxng#97 (comment) Suggested-by: @dalf [1] Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
For details read along the commit messages
Hint: there a two patches with a fix in this PR: