Skip to content

Commit

Permalink
better formatting for saved search docs IQSS#10893
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Nov 19, 2024
1 parent 646ebd5 commit d77ff0d
Showing 1 changed file with 44 additions and 11 deletions.
55 changes: 44 additions & 11 deletions doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6081,27 +6081,60 @@ Saved Search
The Saved Search, Linked Dataverses, and Linked Datasets features are only accessible to superusers except for linking a dataset. The following API endpoints were added to help people with access to the "admin" API make use of these features in their current form. Keep in mind that they are partially experimental.
The update of all saved search is run by a timer once a week (See :ref:`saved-search-timer`) so if you just created a saved search, you can run manually the ``makelinks`` endpoint that will find new dataverses and datasets that match the saved search and then link the search results to the dataverse in which the saved search is defined.
List all saved searches. ::
List All Saved Searches
^^^^^^^^^^^^^^^^^^^^^^^
GET http://$SERVER/api/admin/savedsearches/list
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
curl "$SERVER_URL/api/admin/savedsearches/list"
List a Saved Search by Database ID
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export ID=1
curl "$SERVER_URL/api/admin/savedsearches/$ID"
Delete a Saved Search by Database ID
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``unlink=true`` query parameter unlinks all links (linked dataset or Dataverse collection) associated with the deleted saved search. Use of this parameter should be well considered as you cannot know if the links were created manually or by the saved search. After deleting a saved search with ``unlink=true``, we recommend running ``/makelinks/all`` just in case there was a dataset that was linked by another saved search. (Saved searches can link the same dataset.) Reindexing might be necessary as well.
List a saved search by database id. ::
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export ID=1
GET http://$SERVER/api/admin/savedsearches/$id
curl -X DELETE "$SERVER_URL/api/admin/savedsearches/$ID?unlink=true"
Delete a saved search by database id.
Execute a Saved Search and Make Links
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``unlink=true`` query parameter unlinks all links (linked dataset or Dataverse collection) associated with the deleted saved search. Use of this parameter should be well considered as you cannot know if the links were created manually or by the saved search. After deleting a saved search with ``unlink=true``, we recommend running ``/makelinks/all`` just in case there was a dataset that was linked by another saved search. (Saved searches can link the same dataset.) Reindexing might be necessary as well. ::
Execute a saved search by database id and make links to Dataverse collections and datasets that are found. The JSON response indicates which Dataverse collections and datasets were newly linked versus already linked. The ``debug=true`` query parameter adds to the JSON response extra information about the saved search being executed (which you could also get by listing the saved search).
DELETE http://$SERVER/api/admin/savedsearches/$id?unlink=true
.. code-block:: bash
Execute a saved search by database id and make links to Dataverse collections and datasets that are found. The JSON response indicates which Dataverse collections and datasets were newly linked versus already linked. The ``debug=true`` query parameter adds to the JSON response extra information about the saved search being executed (which you could also get by listing the saved search). ::
export SERVER_URL=https://demo.dataverse.org
export ID=1
PUT http://$SERVER/api/admin/savedsearches/makelinks/$id?debug=true
curl -X PUT "$SERVER_URL/api/admin/savedsearches/makelinks/$ID?debug=true"
Execute all saved searches and make links to Dataverse collections and datasets that are found. ``debug`` works as described above. This happens automatically with a timer. For details, see :ref:`saved-search-timer` in the Admin Guide. ::
Execute All Saved Searches and Make Links
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Execute all saved searches and make links to Dataverse collections and datasets that are found. ``debug`` works as described above. This happens automatically with a timer. For details, see :ref:`saved-search-timer` in the Admin Guide.
.. code-block:: bash
export SERVER_URL=https://demo.dataverse.org
export ID=1
PUT http://$SERVER/api/admin/savedsearches/makelinks/all?debug=true
curl -X PUT "$SERVER_URL/api/admin/savedsearches/makelinks/all?debug=true"
Dataset Integrity
~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit d77ff0d

Please sign in to comment.