Vorto relies on Elasticsearch to search for models in productive environments.
Conversely, a custom JCR query building mechanism is in use in development environments.
Both resulting search services use a common intermediary syntax to simplify and harmonize the search.
The search is available as a text field in the web UI, and can be also performed as a GET request in the HTTP API.
Vorto model can be searched with the following syntax.
See the vortolang 1.0 specification for a full description of all properties below.
Tag | Description | Values | Tag required | Example |
---|---|---|---|---|
Name | The model's name.
name:abc becomes name:abc* behind the scenes. |
Any | No |
|
Author | The author of the model | Any | Yes |
|
User reference | A shortcut for either author: or lastModifiedBy |
Any | Yes |
|
Visibility | Whether the model is private or public |
|
Yes |
|
Type | The model's type |
|
Yes |
|
State | The model's state |
|
Yes |
|
Namespace | The model's namespace | Any | Yes |
|
Version | The model's version | Any | Yes |
|
Note: The web UI contains a few drop-downs and checkboxes to complement the text-based search - those elements are equivalent to specifying a fixed value for a tag.
Combined together, these search terms can produce powerful searches, with the following rules:
- All tags and values are case-insensitive
- Values cannot contain whitespace
- Tagged expressions must follow the strict
[tag name case-insensitive][:][value]
syntax - All values can contain any number of single character (
?
) or multi-character (*
) wildcards, even enumerated values like types or states - Tags themselves cannot contain wildcards
- Multiple tags can be used, with the following rule:
- All identical tags e.g.
name:a* name:*b
will return models matching either expression, inclusively - All different tags (including un-tagged
name
searches) will return models matching all expressions
- All identical tags e.g.
The following examples illustrate and elaborate on the rules above.
Description | Syntax | Explanation |
---|---|---|
Multi-tag search with same tags | mymodel* name:my*2 |
|
Multi-tag search with different tags | name:my* type:info* state:rel* |
This will search for models that fulfill all conditions listed below:
|
Complex search | mymodel* myothermodel* userReference:bob visibility:* type:function* type:mapping state:draft state:\*re* namesapce:com.mycompany* version:1.0.? |
This will return all models that fulfill all of the following conditions:
|
At time, the Elasticsearch index can change, e.g. when a model index field type is modified.
This can happen when allowing free-text search for enumerated types, thus changing the index type
from key
to text
.
This requires re-creating the whole Vorto index for Elasticsearch.
One straightforward way to do this is to send an HTTP POST request to the /rest/forcereindex
endpoint while authorized as a system administrator (i.e. with role ROLE_SYS_ADMIN
).
In the web UI, this is done by:
- Logging in to the Vorto site as a system administrator
- Navigating to the manage section
- Selecting the Global repository functions tab
- Clicking Re-create index (as opposed to just Reindex)
The operation will entirely re-create the Vorto index, then re-index the model.
Caution is advised: back-up the model first.