-
-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Labels
backServer, DataServer, DatafrontFrontend, DesignFrontend, Designp2Priority 2 bug (medium)Priority 2 bug (medium)
Description
Describe the bug
The package count on the username page is far lower than the official npm registry.
Example:
- npmx: https://npmx.dev/~yyx990803 (61 public packages)
- npm: https://www.npmjs.com/~yyx990803 (328 packages)
The discrepancy is too large to be explained by caching delays.
Additional context
I suspect the issue is that the code currently filters only by owner.name and should either include both owner.name and owners.name, or filter by owners.name alone.
| filters: `owner.name:${ownerName}`, |
I tried changing it to owners locally, got 0 results, and had to fall back to npm. It seems that owners should be included in attributesForFaceting in npm-search to make this work.
For testing purposes, the following query can approximate a full package list:
const { results } = await client.search({
requests: [
{
indexName,
query: ownerName,
offset,
length,
restrictSearchableAttributes: ['owners.name'],
typoTolerance: false,
removeWordsIfNoResults: 'none',
analyticsTags: ['npmx.dev'],
attributesToRetrieve: ATTRIBUTES_TO_RETRIEVE,
attributesToHighlight: [],
} satisfies SearchQuery,
],
})Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backServer, DataServer, DatafrontFrontend, DesignFrontend, Designp2Priority 2 bug (medium)Priority 2 bug (medium)