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

A feature that prioritizes certain websites for higher placement in search results #1086

Open
nexryai opened this issue Apr 12, 2022 · 10 comments
Labels

Comments

@nexryai
Copy link
Contributor

nexryai commented Apr 12, 2022

Is your feature request related to a problem? Please describe.
I love this search engine. But sometimes it is less accurate than other search engines.

Describe the solution you'd like
It would be nice to have a feature (plugin) that prioritizes certain sites (such as stackoverflow) at the higher end of the search results.

@return42
Copy link
Member

I fully understand what you mean .. on my instance i block domains / have a look at this discussion

@dalf
Copy link
Member

dalf commented Apr 12, 2022

In kagi.com:

  • in the preferences, you can block / lower / raise / pin domain names.
  • in the result page, you can do the same: for each result, a popup appears when the mouse over a button (in SearXNG it can be the "cached" link). The popup contains information about the website [*] , and it is possible to set the ranking.

[*] the informations: ranking, when the domain was registered, is it a ads website ? is it fast ?, etc.... Google has done that for a time with less data.

kagi requires a login so the preferences can be stored on the server.

@return42
Copy link
Member

kagi requires a login so the preferences can be stored on the server.

Not very privacy friendly .. we should look for server-side solution that do not need to identify the user .. even if this means we can only offer fewer features to our end users.

@dalf
Copy link
Member

dalf commented Apr 12, 2022

Not very privacy friendly ..

Sure it doesn't fit into SearXNG, however I found the idea interesting.
In SearXNG, we have the missnamed "hostname_replace" plugin.
This plugin can already removes some results, this issue asks to prioritizes some website. The last part is to lower the priority of the some website.

For example:

  • if hostname_replace is embedded into the ResultContainer.
  • we add a new settings: hostnames (at the same level than engines):
hostnames:
  replace:
    '(.*\.)?youtube\.com$': 'invidious.example.com'
    '(.*\.)?youtu\.be$': 'invidious.example.com'
    '(.*\.)?youtube-noocookie\.com$': 'yotter.example.com'
    '(.*\.)?reddit\.com$': 'teddit.example.com'
    '(.*\.)?redd\.it$': 'teddit.example.com'
    '(www\.)?twitter\.com$': 'nitter.example.com'
  remove:
    - example\.com$
  lower_priority:
    - another\.com$
  higher_priority:
    - website\.org$

@nexryai
Copy link
Contributor Author

nexryai commented Apr 19, 2022

This looks very cool. Is it possible to do this with a custom plugin?

@return42
Copy link
Member

Is it possible to do this with a custom plugin?

No, ATM there is only a weight per engine, if hasattr(engines[result_engine], 'weight'): see Engine settings

searxng/searx/results.py

Lines 130 to 139 in e22dc2b

def result_score(result):
weight = 1.0
for result_engine in result['engines']:
if hasattr(engines[result_engine], 'weight'):
weight *= float(engines[result_engine].weight)
occurences = len(result['positions'])
return sum((occurences * weight) / position for position in result['positions'])

In SearXNG, we have the missnamed "hostname_replace" plugin.

Personally I prefer to extend (modify, replace .. whatever) the existing hostname_replace plugin. The configuration of this plugin could look like the one @dalf suggested in his comment above.

@nexryai
Copy link
Contributor Author

nexryai commented Apr 19, 2022

Personally I prefer to extend (modify, replace .. whatever) the existing hostname_replace plugin. The configuration of this plugin could look like the one @dalf suggested in his comment above.

I agree with you. This is a very nice idea :)

@upintheairsheep
Copy link

Is your feature request related to a problem? Please describe. I love this search engine. But sometimes it is less accurate than other search engines.

Describe the solution you'd like It would be nice to have a feature (plugin) that prioritizes certain sites (such as stackoverflow) at the higher end of the search results.

Agree. The engine is unusable due to some websites giving irrelevant information.

@return42
Copy link
Member

@upintheairsheep can you be more precise and productive?

@S0ulf3re
Copy link

I would love to see a feature like this as well. Perhaps something that could work alongside the hostname_replace. A "Suggested websites" section in the search results that's configured in the YAML with regex of sites that you want to see first. Perhaps below the infocard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Triage
Development

No branches or pull requests

5 participants