Searching for Components

Searching for Components

Searching for components finds information about specific artifacts in the repository. Use this for research into available components, to integrate with your build tool migrations, to download packages, and for quality assurance.

Changes to Search in 3.88.0
In version 3.88.0, Sonatype Nexus Repository moved fully to SQL search and removed Elasticsearch. With this change, search behavior is more precise, and some previously supported wildcard patterns no longer work. For details, see our SQL Search documentation.

Searching Overview

Component search is available in the search bar at the top and the Search button on the side navigation. The following permissions are required to use the search bar in the UI and find components from specific repositories:

nx-search-read
repository-view (per repository)

After entering a search, the first 300 results are visible in the component list. Selecting a component in the list changes to a display of the component information.

Note that result ordering may depend on the configured database; relevance ranking requires using a PostgreSQL database.

More Criteria Drop-down

Use the more criteria dropdown to add additional search criteria to your query. This criteria includes specific metadata fields for the repository as well as format-specific criteria.

Keyword search query string

Tokenization is the process of splitting text into smaller parts, or 'tokens', during indexing and querying. Component metadata and coordinates are tokenized in the Nexus Repository database so the search provides better matching.

When using keyword searches with a hyphenated component name such as aether-util, the query is tokenized to aether and util, providing results for both keywords. The tokens of your query string must exactly match a searchable field.

Tokenization does not include fuzzy or stemmed matching. See SQL Search for details.

To match exactly aether-util, use double quotes in the search term to require the full string for a match.

"aether-util"

Use the asterisk (*) character as a wildcard to broaden component search results.

Configure Minimum Prefix Length for Trailing Wildcards

You can configure the minimum number of characters required before a trailing wildcard through the nexus.search.wildcard.minPrefixLength property.

By default, SQL search requires at least three characters before a trailing wildcard (*). You can configure the nexus.search.wildcard.minPrefixLength property in the nexus.properties file located in the data directory at $data-dir/etc/nexus.properties. The property accepts integer values within a validated range of 1 to 100. When the property is not specified, Nexus Repository uses the default value of 3 characters. Restart your Nexus Repository instance after you change the configuration.

Example:

nexus.search.wildcard.minPrefixLength=1

The above configuration allows searches with a single-character prefix, such as version=1.*`. Note that lower values may match more components, potentially affecting query performance on large repositories.

For HA deployments, every node has its own configuration. Make sure to update the nexus.properties for each node.

Search Fields and Component Attributes

Note
Nexus Repository adopted SQL search from versions 3.88 and later. It introduced format specific behavioural differences. For more details, see SQL Search documentation.

This section explains the different search fields available in Nexus Repository to narrow down the results.

The following are the search fields available for all the repositories:

Composer Repositories

Only available in Sonatype Nexus RepositoryTM Pro. Interested in a free trial? Start here.

Conan Repositories

Conan Revisions are available for PostgreSQL or H2 databases only

Common Version criteria for Conan format is a combination of Base Version and Channel, for instance, "1.0.0-stable"

See Conan's documentation on package revisions

Docker Repositories

Maven Repositories

NuGet Repositories

p2 Repositories

PyPI Repositories

RubyGems Repositories

Yum Repositories

Preconfigured Searches

Preconfigured searches are available when a repository for the format exists in the Nexus Repository and the user has repository-view access to the repository. The format-specific search is available via the format-named menu item in the Search section of the Browse menu.

Each preconfigured search supports adding further criteria.

The same search can be accessed by selecting the Search item in the Browse main menu. The search term can be provided in the Keyword input field in the Search feature view.

Search results

No results found.