Adapting Text Index

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
stiller
Advanced
Posts: 100
Joined: 05 Mar 2016, 15:59

Adapting Text Index

Post by stiller » 30 Oct 2024, 13:31

hi there,

I want to restrict text types in the aimeos search index.

Code: Select all

module.tx_aimeos.settings.mshop.index.manager.text.types {
0 = short
1 = long
}
works fine, when saving product texts. but the index is rewritten on index rebuild.

Applying

Code: Select all

mshop.index.manager.text.types {
0 = short
1 = long
}
in the typoscript field of the scheduler task produces the following error.

array_merge(): Argument #2 must be of type array, null given
in ..../aimeos-core/src/MShop/Index/Manager/Text/Standard.php line 780

780: $map['content'] = array_merge( $map['content'], $texts['']['content'] );

what's wrong?

Aimeos Version
2022.10.8

Beside this, it would be helpful to have a configuration option to exclude variants of select products as well as rebate products from the index.

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Adapting Text Index

Post by aimeos » 31 Oct 2024, 17:07

stiller wrote: 30 Oct 2024, 13:31 780: $map['content'] = array_merge( $map['content'], $texts['']['content'] );

Aimeos Version
2022.10.8
The problem is most likely caused because you exclude the product name and there are products without a short or long description. In later versions, the problem doesn't exist any more:
https://github.com/aimeos/aimeos-core/b ... #L755-L757
stiller wrote: 30 Oct 2024, 13:31 Beside this, it would be helpful to have a configuration option to exclude variants of select products as well as rebate products from the index.
That would be helpful, Theoretically, products of type "voucher" can be excluded easily but variant articles are regular products.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

stiller
Advanced
Posts: 100
Joined: 05 Mar 2016, 15:59

Re: Adapting Text Index

Post by stiller » 31 Oct 2024, 23:01

you're right. some products might not have all text types translated. anyway, inserting the lines of code from the current version doesn't change that behaviour. when executing the scheduler task I still get the described error.

beside this, the scheduler typoscript code

Code: Select all

mshop.index.manager.text.types {
0 = short
1 = long
}
doesn't seem to have any effect.
all types of text are indexed.

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Adapting Text Index

Post by aimeos » 04 Nov 2024, 14:02

stiller wrote: 31 Oct 2024, 23:01 you're right. some products might not have all text types translated. anyway, inserting the lines of code from the current version doesn't change that behaviour. when executing the scheduler task I still get the described error.
We've fixed that here:
https://github.com/aimeos/aimeos-core/b ... d.php#L755
stiller wrote: 31 Oct 2024, 23:01 beside this, the scheduler typoscript code

Code: Select all

mshop.index.manager.text.types {
  0 = short
  1 = long
}
doesn't seem to have any effect.
all types of text are indexed.
Seems to be OK. Can you check what is returned here?
https://github.com/aimeos/aimeos-core/b ... d.php#L677
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

stiller
Advanced
Posts: 100
Joined: 05 Mar 2016, 15:59

Re: Adapting Text Index

Post by stiller » 06 Nov 2024, 15:05

thank you for reply and quick fix.

I figured out that one specific article without long description and one url for all languages has caused the error.
but with your fix it is failsafe

also I've to admit

mshop.index.manager.text.types {
0 = short
1 = long
}

does work. sorry. I was confused by a lot of text coming from variant products. it makes no sense to me to add all information from variants besides having these variant products in the index anyway. we've introduced an if clause to get rid of unwanted texts on the selection product level.

also I don't see a reason why the index does include disabled products. the related texts shouldn't show up in search results.

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Adapting Text Index

Post by aimeos » 08 Nov 2024, 12:18

stiller wrote: 06 Nov 2024, 15:05 also I don't see a reason why the index does include disabled products. the related texts shouldn't show up in search results.
You are right, disabled products doesn't make much sense and products with a passed end date too. Both are not indexed any more now and the change will be in the next 24.10 LTS release.

What do you mean by "related texts"?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

stiller
Advanced
Posts: 100
Joined: 05 Mar 2016, 15:59

Re: Adapting Text Index

Post by stiller » 10 Nov 2024, 18:09

that's good news. thank you.

related texts = text items of the disabled products

Post Reply