Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find assets endpoints (/api/assets) forces substring/partial match in attributes #478

Open
discordianfish opened this issue Oct 12, 2016 · 2 comments

Comments

@discordianfish
Copy link
Contributor

Hi,

I just realize that if you search for an attribute via /api/assets collins wraps the search term with ** forcing partial matches. Even anchoring with ^term$ doesn't work. It looks like collins is converting a search for "attribute=attrib;foo" into ATTRIB:*foo*:.

This is unexpected and hard to work around if you need explicit matches. No anchoring is working, so you need to search the results on the client side again.

Instead, collins should simply not wrap the term in **. This way people can use the wildcards where necessary while defaulting to full string match.

@discordianfish
Copy link
Contributor Author

Actually anchoring is working. Had an unrelated issue. Still, matching on substring by default seems an odd choice. Any chances this will be changed?

@william-richard
Copy link
Contributor

Yeah, I agree that matching on substrings by default is a strange choice. I have no idea why it was made, and it's actually caused a few bugs for us over the years that I've been using collins.
We have discussed changing it, but have been perhaps overly worried that automation is relying upon this functionality, and changing it would have unexpected consequences.
It is worth having a discussion about, and perhaps changing when we do the next major, non-backwards compatible release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants