Skip to content

API search by "tags" is not returning all components #750

Closed
@balbet

Description

@balbet

Describe the bug

We are using the "Tags" field to store our internal component part number reference. Several components might have the same reference, because they could be equivalent (for example, 2 resistors with the same value, package and tolerance, but with different MPN). It's nice that we can add several tags, the problem comes when we try to retrieve them using the API:

https://our_database/api/parts?tags=Z05959

This only returns the component that matches exactly with the tag Z05959. I can see it in this format the JSON:
"tags":"Z05959"
But the component that has 2 tags was stored as comma separated. I can see it in this format the JSON:
"tags":"Z06108,Z05959"

So, my API request doesn't return the last component. The only way to get it is sending this request:
https://our_database/api/parts?tags=Z06108,Z05959

But of course, this is not an option because we don't know the other reference.

Expected behavior

The expected behavior would be that we get all the components where the tag matches in each comma separated string, and not the entire string. This works fine when the search is done using the web:

https://our_database/en/parts/search?keyword=Z05959&name=1&category=1&description=1&mpn=1&tags=1&storelocation=1&comment=1&ipn=1&ordernr=1

That's why we thing the API behaviour is a bug.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions