fossasia / query-server

Query Server Search Engines
Apache License 2.0
1.66k stars 264 forks source link

Improper search engine names used #273

Closed shashank-sharma closed 6 years ago

shashank-sharma commented 6 years ago

I'm submitting a ...

Current behavior:

API url are mostly used to make values human readable like if we want to search google search engine then we can type google but right now baidu is represented as ubaidu which is not good.

https://query-server.herokuapp.com/api/v1/search/ubaidu?query=fossasia&format=json&num=10 Expected behavior:

It should look like https://query-server.herokuapp.com/api/v1/search/baidu?query=fossasia&format=json&num=10

bhaveshAn commented 6 years ago

API url are mostly used to make values human readable like if we want to search google search engine then we can type google but right now baidu is represented as ubaidu which is not good.

I think you are contradicting your self, now. ubaidu is used instead of baidu . This is because all the search engines are used with unique key in app/scrapers/__init__.py. If baidu was used than [b] was the key which is already for bing So, now,

  1. g --> google
  2. a --> ask
  3. d --> duckduckgo
  4. b --> bing
  5. y --> yahoo
  6. u --> baidu as ubaidu

So, it is not a issue. Hence, should be closed.

cclauss commented 6 years ago

Why use only the first letter as the unique key instead of the search engine's full name?

The button pressed gives us the full name ('google'), why do we dumb it down to just the first letter ('g')?

shashank-sharma commented 6 years ago

Why can't we change the method ? I am talking about the use of api. It should be easy to use. ubaidu doesn't make any sense that's why we need to do something about this so that user can type baidu instead of ubaidu.

It's true that it is checking first letter but we can change that method right. Instead of sending first character why don't we send whole word

cclauss commented 6 years ago

@shashank-sharma I agree with you. #266 changes the Python code so that the Python code uses the whole name and not just the initial letter and that we convert all instances of ubaidu into baidu.

raju249 commented 6 years ago

Do we really need this ? @bhaveshAn If yes, then I would like to claim this. But this will also mean to update susi and other users about this change. What you think ?

cclauss commented 6 years ago

@raju249 Our README.md says noting about ubaidu and tyoutube so it would be good to fix the other apps and this app to align to our API description in README.md. There are solutions to this issue in both #327 and #342 so it would be great if you could author a solution that actually gets merged.

raju249 commented 6 years ago

Sure @cclauss But #342 looks like a lot of changes and LGTM. Why don't we merge that then ?

cclauss commented 6 years ago

This issue is closed?

cclauss commented 6 years ago

Can we please close this issue?!?