# Global search and comparison UI

1. [Step By Step Process](#id-1.-step-by-step-process)
2. [Demo Video](#demo-video)

## 1. Step By Step Process

## 1. Configuration

Global policy search and comparison relies on Indexer for some of its functionality. Such Indexer can be deployed locally, or run elsewhere so long as there is an HTTP access path which must be specified in the *ANALYTICS\_SERVICE* parameter in the .env configuration file:\
\
\&#xNAN;*Example:*

*"ANALYTICS\_SERVICE": "<http://localhost:3021>",*

### **1.1 Compare**

There are a several way to select policies for comparison, all of which **do not** require/result in the importing of the policies into Guardian.

![](https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-d66d7d96ac522d46dfb80a63c705d1b4e11008f3%2F0%20\(16\).png?alt=media)

![](https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-000f8ae8581d19b5f816e088eb8ee8f60aff78f8%2F1%20\(18\).png?alt=media)

Policies can be selected from different sources

* Already imported (i.e. now ‘local’) policies

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-876efadb5f3459eb2ef9cd2b41ea90ba25632cf6%2F2%20(20).png?alt=media" alt=""><figcaption></figcaption></figure>

* by message ID

![](https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-8d620b66819b70b093ac0035c888cebcc42524b4%2F3%20\(17\).png?alt=media)

* from local file

![](https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-bd70e29dc909ee51fae2848922806d123af2bcd5%2F4%20\(15\).png?alt=media)

### **1.2 Search**

Not using content similarity criteria for searching.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-9c6b07464661f3ef0ce971ca80426d2fc2a0e710%2F5%20(18).png?alt=media" alt=""><figcaption></figcaption></figure>

Searching based on the content similarity to the existing policy.

![](https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-d2e65b6dfe7d5bbeae06a8385b6edf1ff6407f43%2F6%20\(17\).png?alt=media)

#### **1.2.1 Filters**

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2FRJGSTv4KqeU8nubOd1IC%2Fimage.png?alt=media&#x26;token=2cc38b98-d730-465e-927e-b2481588cf4b" alt=""><figcaption></figcaption></figure>

* **Type –** data source
  * Search only imported – search only ‘local’ policies which have been imported (as ‘drafts’)
  * Local Guardian search – search in all published ‘local’ policies
  * Global search – global search through all policies (using Indexer)
* **Search** – search using keywords
* **Minted Tokens** – include only those policies which already produced issued/minted tokens, with the minimal quantity as specified
* **VC Documents** – include only those policies which already produced VC documents, with the minimal quantity as specified
* **VP Documents** – include only those policies which already produced VP documents, with the minimal quantity as specified
* **Policy Owner** – include only those owned by specific DID\[s]
* **Tools** - search by tool name

#### **1.2.2 Import**

Users can import found policies into local Guardian instance.

![](https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-844c5620b443c38bb73e3b277b482a45842fe15b%2F8%20\(18\).png?alt=media)

### 2. Comparison Result

We have several different sections in our comparison screen including filter parameters:

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-c7c42c8523f837ce02406ee445e0232806ebf5b8%2Fimage%20(530).png?alt=media" alt=""><figcaption></figcaption></figure>

Selected Policies are compared to the first Policy (displayed in the section on the left-hand side), the rest of the sections show the results of the ‘diffs’.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-327edf8289861e8aef34210f5cc19e37ad823557%2Fimage%20(531).png?alt=media" alt=""><figcaption></figcaption></figure>

### 2.1 Comparison Parameters

1. **Events:** configures if differences in events are reflected in the results of the comparison of blocks

| Parameter     | Definition                                                             |
| ------------- | ---------------------------------------------------------------------- |
| Don't compare | event differences are not reflected in the results of comparing blocks |
| All events    | event differences are reflected in the block comparison results        |

2\. **Properties :** configures how differences in Properties are reflected in the results of comparing blocks

| Parameter              | Definition                                                                                                            |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Don't compare          | differences in properties do not have effect on the comparison of blocks, except the ‘tag’ and ‘block type’ which do. |
| Only simple properties | only simple Properties influence block comparison                                                                     |
| All properties         | all Properties are taken into consideration for block comparison                                                      |

3\. **Children** : configures how differences in child blocks influence the results of comparing parent blocks

| Parameter                            | Definition                                                                           |
| ------------------------------------ | ------------------------------------------------------------------------------------ |
| Don't compare                        | when parents blocks are compared their child blocks are not taken into consideration |
| Only child blocks of the first level | only immediate children of parent blocks are compared when comparing parent blocks   |
| All children                         | all children of parent blocks are compared when comparing parent blocks              |

4\. **UUID** : configures if UUID and Hedera ID are taken into consideration when comparing blocks

| Parameter     | Definition                                                                                                                                                                                                                                                                                          |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Don't compare | UUIDs of schemas, tokens, topics, etc and their Properties are not compared when blocks are compared                                                                                                                                                                                                |
| All UUID      | <p>all IDs are taken into consideration when comparing blocks<br><em>(for example when this option is chosen if all Properties of tokens in two Policies being compared are the same these tokens would still be considered different since they would by definition have different UUIDs)</em></p> |

### 2. Sections:

There are different sections in the comparison such as

1. **Main** – shows results of comparison of the main fields of the Policies
2. **Policy Roles** – shows results of comparison of the roles of Policies
3. **Policy Groups** – shows results of comparison of the groups
4. **Policy Topics** – shows results of comparison of dynamic topics
5. **Policy Tokens** – shows results of comparisons of dynamic tokens
6. **Policy Blocks** – shows results of comparisons of Policy block structures

We have several Display settings in Policy Blocks section:

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-f5d5b1ee604695d764608c308898d7d725e8e634%2Fimage%20(532).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-36438851b39e366ad4e99f5393bd44ba5d22309d%2Fimage%20(533).png?alt=media" alt=""><figcaption></figcaption></figure>

**Display Settings:** description and show/hide settings for each color/type of difference:

| Color         | Purpose                                                                                 |
| ------------- | --------------------------------------------------------------------------------------- |
| Green         | blocks are equal, including their child blocks                                          |
| Green - Amber | blocks are equal, but their child blocks are different                                  |
| Amber         | blocks are of the same type and are partially equal, there are some notable differences |
| Red           | blocks are absent in the other Policy                                                   |

Block comparison displays can be unfolded to display a detailed view of the block Properties.

<figure><img src="https://1556785885-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNYWPEEAknX9Vki1yV5HY%2Fuploads%2Fgit-blob-09954fdf29c346c8650472812b38d156286c0c49%2Fimage%20(534).png?alt=media" alt=""><figcaption></figcaption></figure>

## Demo Video

[Youtube](https://youtu.be/qzUIqAa2m4E?si=ANBfV-vmJoJsMuvq\&t=155)
