mirror of
https://github.com/nextcloud/documentation.git
synced 2026-01-02 17:59:36 +07:00
Document optional unified search result entry attributes
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
@@ -40,7 +40,7 @@ jQuery was updated to v2.2. The most notable change is that ``$(document).ready(
|
||||
Search
|
||||
******
|
||||
|
||||
The unified search replaces the traditional search input, hence ``OCA.Search`` became a noop. For backwards compatibility, the code will not raise any errors now, but it does not have any functionality.
|
||||
The :ref:`unified search<unified-search>` replaces the traditional search input, hence ``OCA.Search`` became a noop. For backwards compatibility, the code will not raise any errors now, but it does not have any functionality.
|
||||
|
||||
Removed globals
|
||||
***************
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _unified-search:
|
||||
|
||||
======
|
||||
Search
|
||||
======
|
||||
@@ -394,3 +396,19 @@ For a **cursor-based pagination** a app-specific property is used to know a refe
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Optional attributes
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The unified search is available via OCS, which means client application like the mobile apps can use it to get access to the server search mechanism. The default properties of a search result entry might be difficult to parse and interpret in those clients, hence it's possible to add optional string attributes to each entry.
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?php
|
||||
|
||||
$entry = new SearchResultEntry(/* same arguments as above */);
|
||||
$entry->addAttribute("type", "deckCard");
|
||||
$entry->addAttribute("cardId", "1234");
|
||||
$entry->addAttribute("boardId", "567");
|
||||
|
||||
.. note:: This method was added in Nextcloud 21. If your app also targets Nextcloud 20 you should either not use it or add a version check to invoke the method only conditionally.
|
||||
|
||||
Reference in New Issue
Block a user