Filter apis
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Filter apis
Hello,
We need to filter data based on text. We have tried with filter[f_search]. But, that is not well. It is searching from all text fields and also it searched for individual character. We need to search full string and in product name only.
So, we have check filter[~=][product.lable]. It is working fine. But, Again we have two language then it is creating issue. So, Can we use this filter ([~=]) into text content only? Right now it is working with product.lable.
example: this is working fine
{endpoints}+"/jsonapi/product?filter[~=][content]=Hitachi washing&include=text"
We need to use same condition for text.content field into included array.
regards
Tejas
We need to filter data based on text. We have tried with filter[f_search]. But, that is not well. It is searching from all text fields and also it searched for individual character. We need to search full string and in product name only.
So, we have check filter[~=][product.lable]. It is working fine. But, Again we have two language then it is creating issue. So, Can we use this filter ([~=]) into text content only? Right now it is working with product.lable.
example: this is working fine
{endpoints}+"/jsonapi/product?filter[~=][content]=Hitachi washing&include=text"
We need to use same condition for text.content field into included array.
regards
Tejas
Re: Filter apis
You can try
but please be aware that the "~=" operator is extremely slow becaus it uses no indexes!
Code: Select all
&filter[~=][index.text:name("en")]=Hitachi washing
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Re: Filter apis
So, from listed operators, which one is fastest?
Re: Filter apis
The "==" or "=~" operator uses indexes and are fast.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Re: Filter apis
Hello, we are using f_search parameter on api request. But that is searching from all text fields. So, we are not getting very precise result on first positions.
While, if we check same thing on demo website on laravel platform, search results are very good.
How can we prepare api which return accurate results?
Currently we are calling this {endpoints-product}?sort=relevance&filter[f_search]=gas%20detector&include=text,media
On this api, Product with name : Gas detector is coming at end. And other products returns first cause those product has gas keyword into description.
Thanks in advance
While, if we check same thing on demo website on laravel platform, search results are very good.
How can we prepare api which return accurate results?
Currently we are calling this {endpoints-product}?sort=relevance&filter[f_search]=gas%20detector&include=text,media
On this api, Product with name : Gas detector is coming at end. And other products returns first cause those product has gas keyword into description.
Thanks in advance
Re: Filter apis
What happens if your remove "sort=relevance"?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Re: Filter apis
It is returning same result.
Re: Filter apis
The 2020.10 LTS version used in the Laravel demo returns correct order by relevance:
https://laravel.demo.aimeos.org/default ... retty=true
There had been some improvements in 2020.07 and 2020.10 regarding ranking IIRC.
https://laravel.demo.aimeos.org/default ... retty=true
There had been some improvements in 2020.07 and 2020.10 regarding ranking IIRC.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star