SQL Search

SQL Search

Beginning with 3.88 release, Nexus Repository Manager uses SQL table search instead of Elasticsearch (ES). This change applies to all editions of Nexus Repository Manager (Pro and OSS) and affects how search queries are processed internally.

This page explains the search behaviour differences that some users may observe after upgrading, particularly when using wildcard searches or advanced search queries.

Scope of Change

Search is now executed directly against the configured database. Nexus Repository Manager supports two databases for SQL search: PostgreSQL and H2. PostgreSQL is intended for production use and provides scalable performance and relevance-based search results. H2 is intended for development and testing only and may behave differently when searching large datasets.

What is Unchanged

The move to SQL search does not change how you interact with search in Nexus Repository Manager. Search endpoints, query syntax, and supported repository formats remain the same. Exact match searches continue to behave as before, and no reindexing or manual configuration is required as part of the upgrade process.

Search Behaviour Differences

The following table summarizes the key differences in general search behaviour when using SQL search instead of Elasticsearch.

Feature SQL Search Elastic Search
Case Sensitivity Case-insensitive Case-insensitive
Wildcard Support Trailing wildcard only by default. Minimum prefix length is configurable (default: 3 characters). See Configure Minimum Prefix Length for Trailing Wildcards. Positional wildcard patterns are supported for specific component search fields when nexus.search.multi.wildcard.regex.enabled=true is enabled. See Positional Wildcard Patterns. Supports trailing and leading wildcards (for example, *spring)
Fuzzy/Similar Matches Not supported Supported
Stemming/Root Matching Not supported Supported
Stop Word Removal Not supported Supported
Relevance Ranking Supported with PostgreSQL; not supported with H2 Supported
Phrase Search Supported with quotes; matches the exact phrase Supported with quotes; may also match similar phrases due to stemming or fuzzy matching
Term Splitting Without quotes, terms are split on spaces and common delimiters Similar term splitting with more flexible matching
Component Search (Raw Format) Leading slash (/) required Leading slash not used

Positional Wildcard Patterns

Nexus Repository supports positional wildcard patterns for component searches when the following property is enabled:

nexus.search.multi.wildcard.regex.enabled=true

A positional wildcard pattern uses one or more asterisks (*) between known parts of a value. The matching parts must appear in the same order.

By default, wildcard patterns use standard Nexus Repository search behavior based on tokenized matching.

Supported Search Fields

Positional wildcard patterns are supported for the following component search fields:

Search Field Supported Values
Group, namespace, or organization Group, Namespace, Organization
Name, artifact ID, or package name Name, Artifact ID, Package name
Version Version

Examples

Pattern Behavior
org*apache* Matches org.apache.commons and org.jboss.apache.
commons*lang Matches commons-lang, but does not match lang-commons.
1*2*3 Matches 1.2.3 and 1-rc2-build3.

Limitations

Positional wildcard patterns are not supported for format-specific fields, such as Maven base version, Docker tags, and npm scope.

Positional wildcard patterns are not supported for keyword search.

For these fields, wildcard patterns use standard Nexus Repository search behavior based on tokenized matching.

Performance Considerations

Positional wildcard patterns use regex matching, which is slower than standard searches.

To reduce search cost:

Database Consideration

Search behaviour and performance vary depending on whether SQL search is backed by PostgreSQL or H2.

H2 is suitable only for development and testing environments. As repository size grows (more than 10,000 components), search performance may degrade, and result ranking is not available.

PostgreSQL is recommended for all production deployments. It scales to large numbers of components, supports relevance-based ranking, and provides performance comparable to the previous Elasticsearch-based implementation. Use PostgreSQL if you expect high search volumes or have a large number of components.

Repository Format Behaviour

Most repository formats behave the same with SQL search as they did with Elasticsearch. However, some formats may return slightly different results in specific search scenarios.

NuGet V3

NuGet V3 search supports both exact and wildcard queries, but with some important changes:

NuGet V2

NuGet V2’s autocomplete feature continues to return up to 30 package IDs that match your prefix query.

npm V1

npm V1 search remains largely unchanged:

PyPI

PyPI search supports both exact and wildcard queries, with some restrictions:

Search results

No results found.