janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
238 stars 57 forks source link

Use native $search in v4. #65

Closed Gadensgaard closed 3 years ago

Gadensgaard commented 6 years ago

OData v4 supports the $search parameter natively: http://www.odata.org/getting-started/basic-tutorial/#search

janhommes commented 6 years ago

I remember that we use the $search query parameter but it was still only returning an exact match. That depends on the implementation, but for me only using $search was not leading to what I wanted. So I had to add the substring/contains methods. Does that not work for you? If you like to have an exact match, you can still use $filter.

Otherwise we might need an implementation that supports both ways, maybe by interpreting searchFunc?

Gadensgaard commented 6 years ago

But the substring/contains method is just a custom filter. I would prefer the library to follow the standard specification.