LogoLogo
  • What is LABDRIVE
  • Concepts
    • Architecture and overview
    • Organize your content
    • OAIS and ISO 16363
      • Understanding OAIS and ISO 16363
      • LABDRIVE support for OAIS Conformance
      • Benefits of preserving research data
      • Planning for preservation
      • ISO 16363 certification guide
      • LABDRIVE support for FAIRness
  • Get started
    • Create a data container
    • Upload content
    • Download content
    • Introduction to metadata
    • Search
    • File versioning and recovery
    • Work with data containers
    • Functions
    • Storage mode transitions
    • Jupyter Notebooks
  • Configuration
    • Archive organization
    • Container templates
    • Configure metadata
    • Users and Permissions
    • Running on premises
  • DATA CURATION AND PRESERVATION
    • Introduction
    • Information Lifecycles
    • Collecting Information needed for Re-Use and Preservation
    • Planning and Using Additional Information in LABDRIVE
    • How to deal with Additional Information
      • Representation Information
      • Provenance Information
      • Context Information
      • Reference Information
      • Descriptive Information
      • Packaging Information
      • Definition of the Designated Community(ies)
      • Preservation Objectives
      • Transformational Information Properties
    • Preservation Activities
      • Adding Representation Information
        • Semantic Representation Information
        • Structural Representation Information
        • Other Representation Information
          • Software as part of the RIN
            • Preserving simple software
              • Jupyter Notebooks as Other RepInfo
            • Preserving complex software
              • Emulation/Virtualisation
                • Virtual machines as Other RepInfo
                • Docker and other containers as Other RepInfo
              • Use of ReproZip
      • Transforming the Digital Object
      • Handing over to another archive
    • Reproducing research
    • Exploiting preserved information
  • DEVELOPER'S GUIDE
    • Introduction
    • Functions
    • Scripting
    • API Extended documentation
  • COOKBOOK
    • LABDRIVE Functions gallery
    • AWS CLI with LABDRIVE
    • Using S3 Browser
    • Using FileZilla Pro
    • Getting your S3 bucket name
    • Getting your S3 storage credentials
    • Advanced API File Search
    • Tips for faster uploads
    • File naming recommendations
    • Configuring Azure SAML-based authentication
    • Exporting OAIS AIP Packages
  • File Browser
    • Supported formats for preview
    • Known issues and limitations
  • Changelog and Release Notes
Powered by GitBook
On this page
  • Search using the Management Interface
  • Basic search
  • Advanced search
  • Locating and downloading files with direct links
  • Creating Search Links
  • Search using the API
  • Search by container
  • File name search
  • Metadata search

Was this helpful?

  1. Get started

Search

PreviousIntroduction to metadataNextFile versioning and recovery

Last updated 5 months ago

Was this helpful?

LABDRIVE provides a user-friendly, easy to use web interface for searching alongside a full API for Query DSL (Domain Specific Language) based on JSON to define queries, that supports the to search for items.

This guide is just an introduction to the LABDRIVE capabilities for you to get familiar with them.

Here you can find:

  • How to search using the management interface

  • How to do basic search using the API

Search using the Management Interface

In order to get to the search interface, you must sign in to the platform's management interface and go to "Content search":

Once here, you will notice that there is the option to do either a basic search or an advanced search.

Basic search

(1) Introduce your query here. It could simply be a word or it could be a metadata-based query if you start typing any metadata field.

(2) You can also make an advanced query by selecting the {;} symbol:

(3) With these options you can restrict the types of data that the platform is going to search in.

  • Metadata, for searching in the item metadata.

  • File content, for searching in the item content (full text in a PDF for instance), for the indexed documents.

  • Embedded metadata, for searching in the item's embedded metadata (EXIF metadata for images, headers for PDF files, etc.).

  • File name and path, for searching based on the item name.

(4) You can restrict your search to a particular archive node or group of containers.

(5) You can restrict your results to only files or only folders.

(6) You can filter based on content tags.

(7) You can filter by file format (if the content is characterized).

You will see your results in (8).

In (9) you will be able to arrange your results depending on different parameters.

And (10) is an example of a search made inside a file's content.

Advanced search

The advanced search option allows you to do more complex queries in an easier, user-friendly way, by using fields and operators. This includes the nesting option of AND and OR, and adding as many rules to your query as you wish.

Unlike a basic search, which may rely on more simpler keywords, an advanced search allows users to apply filters such as exact phrases, date ranges, file types, and exclusions. These additional options help narrow down search results, making it easier to locate precise information quickly, especially useful for complex topics or detailed research needs.

(1) Here we have the logical operators AND and OR. These will allow users to define logical operators between search conditions. By default, AND is selected, meaning all specified conditions must be met for search results to appear.

(2) The "Search in" dropdown will allow users to specify the database, table or field in which they want to search. There is many different options; these are just some of them:

(3) "Add rule" will add a new search condition to further define the query, while (4), "Add group", allows the user to add a nested group of conditions, combining multiple rules with either AND or OR logic.

(5) In "Fields to show in search results", the user will be able to specify which fields they want to display in the search results.

(6) The "Save this query" button lets users save their specific query, and those will be then found in (7).

Here we have an example of a saved query where we have also added some fields to show in the results:

As you can see, users are able to download the search results as a CSV file, and they are also able to go directly to their file as well as download it.

Locating and downloading files with direct links

You can point to files and folders with their direct link, using the identifier that your platform assigns to them when they are uploaded.

For instance, if a file is in the container 9 and has the file id 10981 like in this example:

You can use the following link to open a container details view with the file pre selected:

https://acme.libnova.com/download/file/10981

This is useful for instance for telling one of your colleagues "this is the file you are looking for".

If what you want is to send someone a direct download link, so they can immediately download the file when opening the link, you can use:

https://acme.libnova.com/download/file/10981

Creating Search Links

But, what happens if you would like to provide a link to a file/folder or container that matches a certain query? You can do it using the Search Links functionality.

This functionality is really useful when performing integrations. For instance, you can ingest one object in your platform, assign an unique identifier to it and then, generate http links from other platforms that are going to open the ingested element (without needing to know the file ID that the platform assigns to it, or even if the file changes it location or name over time).

For files and folders, you can go to your search console in the management interface selecting Content Search:

When you build your query and click search, you will see that the URL will include it. For instance if you search for objects that contain a particular value in a field like here:

This way, you can send your colleagues a search query, that will display results to them (note that results will depend on their permissions).

And, if you happen to have a unique identifier in any of your fields, you can make your platform to guide them not only to the Search results page, but also to the particular file that matches they query (only one should match).

For instance, let's say that for a given object you have the following metadata:

If you craft and open the following URL

https://acme.libnova.com/search/files?q=uuid:6a937735-78a9-474b-bfd6-6486bdd2351c&direct=view_file

And there is only one file or folder with the selected UUID, the platform will redirect you to the folder/file, leaving it selected:

This method will work the same for files and for folders but, for files (does not work for folders), you can also include a direct download request:

https://acme.libnova.com/search/files?q=uuid:6a937735-78a9-474b-bfd6-6486bdd2351c&direct=download_file

This will immediately start download the file that matches your query.

The same is valid for containers. If you have a container with the following metadata:

You can create a link like:

https://acme.libnova.com/search/containers?q=uuid:7e1b6910-6ba1-40f3-9ce9-8e56853f56fa

That will show the search results like in the previous example. But for containers, you can do several things: you can redirect the user to the container details view, if only one is matching, by adding the following to the search link:

https://acme.libnova.com/search/containers?q=uuid:7e1b6910-6ba1-40f3-9ce9-8e56853f56fa&direct=view_container_details

And you can also make the link to open the Explore Content tab, if you include the following:

https://acme.libnova.com/search/containers?q=uuid:7e1b6910-6ba1-40f3-9ce9-8e56853f56fa&direct=view_container_content

Search using the API

1. Sign in to the LABDRIVE Management Interface

2. Obtain your LABDRIVE API key selecting your name and then Access Methods:

and then, follow one of the following methods:

Search by container

To get a list of every item in the container, with all properties use this method:

curl --request POST \
  --url "$your_platform_url/api/file/elastic" \
  --header "Content-Type: application/json" \
  --header "authorization: Bearer $your_platform_api_key" \
  --data '{
	"must": [
		{
			"term": {
				"container_id": 3
			}
		}
	]
}'
import requests

url = "http://10.0.1.28/api/file/elastic"

payload = {"must": [{"term": {"container_id": 3}}]}
headers = {
    "Content-Type": "application/json",
    "authorization": "Bearer <your API key here>"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)

Use:

  • url: Your LABDRIVE address

  • header: Your LABDRIVE API Token (add Bearer prefix)

  • container_id: The id of the container to list.

You can also request the file list of more than one data container with a single query:

curl --request POST \
  --url "$your_platform_url/api/file/elastic" \
  --header "Content-Type: application/json" \
  --header "authorization: Bearer $your_platform_api_key" \
  --data '{
	"must": [
		{
			"terms": {
				"container_id": [
					1,
					2
				]
			}
		}
	]
}'

File name search

When users are uploading a file to the platform, search results may not show the new file for up to 3 seconds. Consider this in your code when you are uploading and immediately after the upload, you need to search for the uploaded file.

To get a list of every item in the container, with all properties use this method:

curl --request GET  --url "$your_platform_url/api/file" \
       --header "Content-Type: application/json" \
       --header "authorization: Bearer $your_platform_api_key" \
       --data '{
          "conditions": [
              {
                  "container_id": 185
              }
                        ],
          "limit": 100,
          "offset": 0
      }'

Or if you are looking for all files in container 185, with a size larger than 702 bytes and characterized as a PDF 1.5 (PRONOM fmt/19), you can use:

curl --request GET  --url "$your_labdrive_url/api/file" \
       --header "Content-Type: application/json" \
       --header "authorization: Bearer $your_labdrive_api_key" \
       --data '{
          "conditions": [
              {
                  "container_id": 185
              },
              {
                  "size": {
                      "operator": "gt",
                      "value": 702
                  }
              },
              {
                  "type": "FILE"
              },
              {
                  "format": "fmt\/19"
              }
          ],
          "limit": 100,
          "offset": 0
      }'

Metadata search

When users are updating metadata for an object, search results may not show the updated element for up to 3 seconds. Consider this in your code when you are updating the metadata and immediately after the edit, you need to search for it.

It is possible to search for any of the metadata associated to your items (item metadata, item embedded metadata -if available-, file hash, etc). It is also possible to create complex queries combining multiple query types in one and to use wildcards:

Metadata fields in your queries are NOT the same as in your metadata schema, and should be adjusted with two changes:

  • Include the "metadata." test as their prefix.

  • Replace any "." or any other special character by an "_".

E.g.: If your IECODE is "dc.title", the search term will be "metadata.dc_title"

curl --request POST \
  --url "$your_platform_url/api/file/elastic" \
  --header "Content-Type: application/json" \
  --header "authorization: Bearer $your_platform_api_key" \
  --data '{
	"must": [
		{
			"nested": {
				"path": "metadata",
				"query": {
					"simple_query_string": {
						"analyze_wildcard": true,
						"fields": [
							"metadata.dc_author"
						],
						"query": "albert*",
						"default_operator": "and"
					}
				}
			}
		}
	]
}'

API examples here are just illustrative. Check the for additional information and all available methods.

This section is just an introduction. Many operators and properties are available for search. Make sure you read .

LABDRIVE API documentation
Advanced API file search
ElasticSearch syntax