NRGI / resourcecontracts.org

Resource Contracts
http://resourcecontracts.org
GNU General Public License v2.0
16 stars 9 forks source link

Decommission simple search functionality #1354

Closed iprunache closed 3 years ago

iprunache commented 3 years ago

Why

RC sites now generally use grouped search which is continuously maintained and improved.

There are still links on the site though, mostly on contract summaries, that reference the old simple search which is no longer maintained. Those links now fail.

What

Notes

Contract summaries mainly use the old search but there might be other pages too:

Screen Shot 2021-01-21 at 11 27 57

Examples of failing urls(scraped from half a day's worth of logs): https://resourcecontracts.org/search?contract_type=Production+or+Profit+Sharing+Agreement https://resourcecontracts.org/search?company_name=Kosmos+Energy+Equatorial+Guinea https://resourcecontracts.org/search?company_name=Guinea+Ecuatorial+de+Petroleos https://resourcecontracts.org/search?q=&country%5B%5D=ec&resource%5B%5D=Hydrocarbons https://resourcecontracts.org/search?q=&country%5B%5D=ec&resource%5B%5D=Copper https://resourcecontracts.org/search?q=&country%5B%5D=ec&resource%5B%5D=Gold https://resourcecontracts.org/search?q=&country%5B%5D=ec&resource%5B%5D=Silver https://resourcecontracts.org/search?amp=&country%5B%5D=mw&q= https://resourcecontracts.org/search?q=&resource%5B%5D=Chromite&country%5B%5D=ph https://resourcecontracts.org/search?company_name=Dowell+Schlumberger+de+M%C3%A9xico%2C+S.A.+de+C.V. https://resourcecontracts.org/search?q=Guinea+equatorial&order=asc&sortby=year https://resourcecontracts.org/search?q=Production+Sharing+Agreement+ https://resourcecontracts.org/search?contract_type=Production+or+Profit+Sharing+Agreement https://resourcecontracts.org/search?company_name=Kosmos+Energy+Equatorial+Guinea https://resourcecontracts.org/search?company_name=Guinea+Ecuatorial+de+Petroleos https://resourcecontracts.org/search?company_name=Quadra+Egypt+Limited https://resourcecontracts.org/search?q=&country%5B%5D=ec&resource%5B%5D=Hydrocarbons

iprunache commented 3 years ago

@charlesyoung should the old simple search still be in use? If so, I will replace this issue with one to fix the errors generated by it.

iprunache commented 3 years ago

The second search bar on Countries and Resources views also uses the simple search which crashes:

Screen Shot 2021-01-21 at 11 33 24
charlesyoung commented 3 years ago

Thanks @iprunache

Can you explain the difference between a grouped and simple search?

iprunache commented 3 years ago

@charlesyoung As I understand it, you introduced grouped search last year which displays contracts grouped by the parent contract. Previously it just listed all contracts with no grouping.

The grouped search uses the /search/group url while the old search functionality is still available at /search. Some features on the site still use the old search which is now broken.

Does that make sense?

charlesyoung commented 3 years ago

Thanks.

Do you have an idea of how much work it is to fix?

cc @SamCCSI

iprunache commented 3 years ago

@charlesyoung I'm not sure from your comment if you want to also keep the old search and fix it or remove it and replace it with links to the newer grouped search.

charlesyoung commented 3 years ago

Would it work updating the search result URL.

So from

https://resourcecontracts.org/search?company_name=Guinea+Ecuatorial+de+Petroleos

To

https://resourcecontracts.org/search/group?company_name=Guinea+Ecuatorial+de+Petroleos

iprunache commented 3 years ago

Yes, if you want to use the grouped search everywhere the urls need to be updated to use the /search/group endpoint. That should be enough.

charlesyoung commented 3 years ago

Can Vitamin update the endpoints? How much time will it take?

candrei commented 3 years ago

@charlesyoung I've consulted with @iprunache and reviewed the necessary changes; Ionut can update the links on the contracts pages to reduce the number of errors. We think that YI will be more efficient in making the rest of the changes that require more time (not a small change), ie: we've discovered that more work will be needed than updating the references to the /search/group endpoint, eg: search bar available on the countries and/or resources summary pages.

charlesyoung commented 3 years ago

Completed.

Just need to deploy to Prod site.