Closed t-imamichi closed 1 year ago
Not sure how this would work given that a given app could update and the main docs would not know about it.
If it is difficult to merge all indices of applications, google programmable engine might work by specifying url. E.g., search "VQE" in Qiskit documentation by google https://www.google.com/search?q=inurl%3Aqiskit.org%2Fdocumentation+vqe&safe=active&hl=en
@t-imamichi if you want to take a shot at integrating the google engine into the docs then that would be great. The repo for the Sphinx theme is here: https://github.com/Qiskit/qiskit_sphinx_theme
Thanks. I will talk with @manoelmarques
@t-imamichi The results link you posted above shows the general Google results page which has too much extraneous info to just embed in Qiskit.
So the idea would be to use the "Google Programmable Engine" like you mentioned, however I understand that you need to create an id connected to your Google account and that there are terms of service related to it right ? Can a Google account be created for Qiskit ?
"....Before you can create a Google Custom Search you need to have a Google Account. You may already have one for Gmail, Google+ or another one of Google's services....."
As for the current situation, each application has its own search box and it own local logic. For instance, building the indexes for Finance, the code is:
Search.setIndex({docnames:["apidocs/qiskit_finance","apidocs/qiskit_finance.applications",....
Notice the relative paths because this code is in searchindex.js that exists at the root of each application and for Qiskit also. The logic is all self-contained and created when you build the docs. There is a "Search" javascript object for each app.
Since docs for Qiskit, Finance, Nature etc are all built separately, all have their own search box, invoking its local code and using its own index, so I am not sure how to integrate those using the current Sphinx docs build logic.
I see. If we need a google account, other services may be good. How about this one? https://duckduckgo.com/search_box Is it possible to embed iframe?
I hope the following works for example.
.. raw:: html
<iframe src="https://duckduckgo.com/search.html?width=400&site=qiskit.org&prefill=Search Qiskit.org" style="overflow:hidden;margin:0;padding:0;width:458px;height:40px;" frameborder="0"></iframe>
https://docutils.sourceforge.io/docs/ref/rst/directives.html#raw-data-pass-through
As for each application, we can leave the current search box as is because it can be used to search for the particular application.
@t-imamichi
The qiskit_sphinx_theme library is the one that has the search box and all its logic and it is used by all projects. In order to have one for Qiskit and another for the other projects, it might need another extension library written.
As for Duckduckgo I don't think that a search results page that shows shopping etc would be good for the docs. I created a simple html page by using the link above inside an iframe, then entered "qiskiterror", pressed enter and got:
From the Duckduckgo site:
"... Some drawbacks of this Duckduckgo custom search engine is that it contains ads ...."
"You can overcome disadvantages of Duckduckgo by creating a custom search engine with Expertrec. It has zero ads in search results and also has a codeless UI editor that can help you match your website search engine to the look and feel of your website. This comes at an affordable cost of $9 per month."
The idea of an integrated search bar for all of qiskit.org
lives on, but for now, I'll close this issue as "obsolete", because with Terra now being the only component of the metapackage, the search bar does search everything that's contained on https://qiskit.org/documentation now. Everything else is https://qiskit.org/ecosystem, and the current branding suggests that we probably won't be unifying those.
What is the expected behavior?
The documentation of applications (optimization, nature, finance, and machine learning) are separated from the main documentation since Qiskit 0.25. As a result, we cannot search a word in all applications at once. If we want to search something, we need to go to the page of the appropriate application page first. It is not so convenient. It would be great if qiskit page has an integrated search box for all applications.