[SOLVED] Can't get the search-plugin to work

As the title says. Im not able to get the search-plugin Flowpack.SearchPlugin with the Flowpack.SimpleSearch.ContentRepositoryAdaptor up and running.

After the installtion-process i try to run: ./flow nodeindex:build
but this throws an issue -> “Notice: Array to string conversion…Flowpack_SimpleSearch_Domain_Service_SqLiteIndex.php line 117”

I run neos in the version 3.3.7

Thanks in advance!

Same here. My question in the Neos Slack channel:

Hello,

I have installed the Flowpack.SearchPlugin with Flowpack.SimpleSearch and Flowpack.SimpleSearch.ContentRepositoryAdaptor. When trying to run ./flow nodeindex:build I get this error:

Notice: Array to string conversion in \project/source/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Flowpack_SimpleSearch_Domain_Service_SqLiteIndex.php line 117

print_r($propertyValue); in the mentioned line gives me:

Array
(
	[input] => Array
		(
			[0] => Home
		)

	[output] => 630ff31c-24e1-4b79-bac4-f2d4874554ce
	[payload] => {"nodeIdentifier":"630ff31c-24e1-4b79-bac4-f2d4874554ce"}
	[weight] => 20
)

So obviously that piece of code (implode etc.) cannot work since it is a multi-dimensional array.
Can this a problem with our site/node structure or with the Plugin code?

Could it be possible that this plugin does not work with a multi-language site…?

Hey, I need a bit more context on this error. I just installed simplesearch in a Neos 3.3 (with demo site) and ran the nodeindex:build command without problems. So that looks like a problem with this specific Node content. But I see that implode is rather limited in it’s use. You can work around this problem by configuring a custom search.indexing EEL expression that applies JSON.stringify on the property value for now, but I have an idea for a fix…

I would appreciate if you could try the latest version. I assume you have the 2.0.x version of the flowpack/simplesearch-contentrepositoryadaptor package. Please try installing version “2.0.x-dev” and see if the problem is fixed with that as I don’t have an easy way to test this.

Christian, thanks for your reply. I’m not quite sure what additional context/information I could give you. As already mentioned, it is a multi-language site. Is SimpleSearch intended to be used with language dimensions? I mean like “show only Swedish search results when I’m on the Swedish version of the site”…?

Do you recognise the array that fails? This must be some node property value from your project. I would like to know what it is…

This is what I get when I print_r the $properties argument in SqliteIndex#insertOrUpdatePropertiesToIndex (replaced customer/project name and text contents with ***):

Array
(
    [__identifier] => 112d8c74-e074-4be6-bcb6-5fb366a151fc
    [__workspace] => #live#
    [__path] => /
    [__parentPath] => ##
    [__sortIndex] => 
    [__type] => unstructured
    [__typeAndSupertypes] => #unstructured#
    [__dimensionshash] => #fb11fdde869d0a8fcfe00a2fd35c031d#
)
Array
(
    [__identifier] => b21139d3-e471-4f29-86d5-3f7aba579939
    [__workspace] => #live#
    [__path] => /sites
    [__parentPath] => #/#
    [__sortIndex] => 100
    [__type] => unstructured
    [__typeAndSupertypes] => #unstructured#
    [__dimensionshash] => #fb11fdde869d0a8fcfe00a2fd35c031d#
)
Array
(
    [_path] => 
    [_name] => 
    [_nodeType] => 
    [__identifier] => 630ff31c-24e1-4b79-bac4-f2d4874554ce
    [__workspace] => #live#
    [__path] => /sites/website
    [__parentPath] => #/#/sites#
    [__sortIndex] => 100
    [__type] => Neos.NodeTypes:Page
    [__typeAndSupertypes] => #Neos.NodeTypes:Page#Neos.Neos:Document#Neos.Neos:Node#Neos.Neos:Hidable#Neos.Neos:Timable#Flowpack.SearchPlugin:SuggestableMixin#Flowpack.SearchPlugin:AutocompletableMixin#Neos.Seo:TitleTagMixin#Neos.Seo:SeoMetaTagsMixin#Neos.Seo:TwitterCardMixin#Neos.Seo:CanonicalLinkMixin#Neos.Seo:OpenGraphMixin#Neos.Seo:XmlSitemapMixin#***.Website:HeaderVisualMixin#Neos.Neos:Content#FormatD.NodeTypes:TextMixin#***.Website:OnePageNavigationExternalLinkMixin#***.Website:MenuTitleMixin#***.Website:LinkTextMixin#
    [__dimensionshash] => #fb11fdde869d0a8fcfe00a2fd35c031d#
    [_hidden] => 
    [_hiddenBeforeDateTime] => 
    [_hiddenAfterDateTime] => 
    [__suggestions] => Array
        (
            [input] => Array
                (
                    [0] => Home
                )

            [output] => 630ff31c-24e1-4b79-bac4-f2d4874554ce
            [payload] => {"nodeIdentifier":"630ff31c-24e1-4b79-bac4-f2d4874554ce"}
            [weight] => 20
        )

    [__completion] => Home
    [titleOverride] => ***
    [metaDescription] => ***
    [metaKeywords] => ***
    [metaRobotsNoindex] => 
    [metaRobotsNofollow] => 
    [twitterCardType] => 
    [twitterCardCreator] => 
    [twitterCardTitle] => 
    [twitterCardDescription] => 
    [canonicalLink] => 
    [openGraphType] => website
    [openGraphTitle] => ***
    [openGraphDescription] => ***
    [xmlSitemapChangeFrequency] => 
    [xmlSitemapPriority] => 
    [title] => Home
    [uriPathSegment] => home
    [_hiddenInIndex] => 
    [text] => ***
    [headline] => ***
    [visualHeight] => height--big-820
    [onePageNavLink] => 
    [onePageNavLinkText] => 
    [linkText] => 
    [menuSubtitle] => 
    [applicationArea] => 
    [menuColumnWidth] => 4
    [layout] => 
    [subpageLayout] => 
)

After this the mentioned error occurs.
Does this help?

A lot <3
I can pinpoint it to the suggestions of the search plugin now. I will have a look there, apparently this is incompatible with the simple search. Although as said, the latest version (just tagged) should make it work.

Hey, it works! Thank you!
At least the nodeindex starts to get built but then I’m running out of memory… :confused:

Workspace "live" and dimensions "{"language":["de"]}" done. (Indexed 4023 nodes)
Workspace "live" and dimensions "{"language":["en","de"]}" done. (Indexed 4004 nodes)
Workspace "live" and dimensions "{"language":["fr","de"]}" done. (Indexed 4000 nodes)
Workspace "live" and dimensions "{"language":["it","de"]}" done. (Indexed 3901 nodes)
Workspace "live" and dimensions "{"language":["nl","de"]}" done. (Indexed 4004 nodes)
Workspace "live" and dimensions "{"language":["da","de"]}" done. (Indexed 3997 nodes)
Workspace "live" and dimensions "{"language":["sv","de"]}" done. (Indexed 3990 nodes)
Workspace "user-fdadmin" and dimensions "{"language":["de"]}" done. (Indexed 4023 nodes)
Workspace "user-fdadmin" and dimensions "{"language":["en","de"]}" done. (Indexed 4004 nodes)
Workspace "user-fdadmin" and dimensions "{"language":["fr","de"]}" done. (Indexed 4000 nodes)

mmap() failed: [12] Cannot allocate memory    

mmap() failed: [12] Cannot allocate memory

Fatal error: Out of memory (allocated 1600393216) (tried to allocate 20480 bytes) in /project/source/Packages/Libraries/doctrine/orm/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php on line 415

Gotta see what I can do about this …

I will say that if you have memory problems with 1.5 GB of data loaded for indexing, then probably simple search is too small a solution for your site.

Holy crap, I think you’re right… :thinking: We have a site with 7 languages and 19 workspaces. I’ve now given the Vagrant box 8 Gigs of RAM and will try the indexing again … actually we only need a simple kind of keyword search, ES would be „too much of a good thing”, I reckon …

Darn! Ran out of memory again … :confused:
So you would recommend to go for the ES variant of the SearchPlugin…?

That sounds like a lot for the SimpleSearch o.O

Yes indeed. What could be an alternative…?

Elastic Search :slight_smile:

OK, limiting the workspace to ‘live’ did the job. You guys could’ve told me that there’s this option… :stuck_out_tongue:

So I basically could get it up and running, but now, after searching for something:
Method "searchHitForNode" is not callable in untrusted context

The „good old untrusted context“ … :confused:

Meanwhile up an running but … uhhhmm … SimpleSearch has no substring search, right @christianm ?

Kasperltheater
Kasperl -> no result
Kasperl* -> result
Theater -> no result
*theater -> no result

OK, we’re going for Elastic Search, thanks!