NOT operator for filter queries

23 views
Skip to first unread message

Gorka Egino Arroyo

unread,
Mar 4, 2025, 4:18:27 AMMar 4
to Freesound API
Hi,
According to the documentation,

> Simple logic operators can also be used in filters:
> filter=type:(wav OR aiff) filter=description:(piano AND note)

But I couldn't get the NOT operator working. I tried this:

And I got an empty response:
HTTP 200 OK Allow: GET, HEAD, OPTIONS Content-Type: application/json Vary: Accept { "count": 0, "previous": null, "next": null, "results": [] }

Is there something I am missing? Or could the NOT operator be implemented for filters? (I am aware that you can do that in the query text, but I am looking specifically to using it with filters)

Frederic Font Corbera

unread,
Mar 7, 2025, 6:05:25 AMMar 7
to freeso...@googlegroups.com

hi!

Thanks for bringing that up. Negative operator is implemented with "-" sign, but I just realized there is a bug that does not allow to use it. You can use it if you do something like that filter=tag:(-guitar piano), but you can't use it "alone".

I hope that helps,

frederic

--
Frederic Font - ffont.github.io
Phonos - phonos.upf.edu
Music Technology Group, UPF - mtg.upf.edu
Freesound - freesound.org


--

---
You received this message because you are subscribed to the Google Groups "Freesound API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to freesound-ap...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/freesound-api/f02b723f-4001-4052-be1d-e7d24275ca8en%40googlegroups.com.

Gorka Egino Arroyo

unread,
Mar 8, 2025, 5:13:02 AMMar 8
to Freesound API
gràcies Frederic!
Maybe the API Docs (on resources > search resources > text search > the 'filter' parameter > " Simple logic operators can also be used in filters:...") could be updated to reflect this possibility?
Also, is there any plan to fix the bug for using the negative operator 'alone'?

Gorka
2025(e)ko martxoaren 7(a), ostirala (12:05:25 (UTC+1)); frederic erabiltzaileak hau idatzi zuen:
Reply all
Reply to author
Forward
0 new messages