Closed jbeaudoin11 closed 6 years ago
You can use this feature to search by a single field:
search: {
param: 'searchName',
attributes: [ 'name' ]
}
As mentioned here: https://github.com/tommybananas/finale#search
By default, the substring search is performed using a
{field} LIKE '%{query}%'
It's exactly what i've done ! But i wanna use multiple filter at once.
So i just look a little closer to the code and the problem is with extraSearchCriteria
. For some reason it's adding param into the criteria/where field. We can see it well in my first post, there is the 2 fields + the symbol line. It work perfectly if i remove these extra criteria.
Why can't you just add all of your search queries individually and use them all using this method?
var userResource = finale.resource({
model: User,
endpoints: ['/users', '/users/:id'],
search: [
{operator: '$eq', param: 'emailVerified', attributes: [ 'email_verified' ]},
{param: 'searchOnlyUsernames', attributes: [ 'username' ]}
]
});
Sadly i'm not working on this project anymore so it's hard for me to reply..
Maybe it would work the way you are describing it, but i'm not sure and can't realy test it.
What I did is a patch and i'm not sure if it broke something.. but it was looking good at the moment..
I'm looking to do something like
localhost:8080/api/v0/media?campaign_id=7&name=09
. Which should result in every media with campaign_id == 7 and where the name contains "09" (%09%)..But i'm not able to find how to do it with "epilogue".. when i log the sequelize call i get :
What i'm looking to get is :