Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocompleter doesn't work in TYPO3v9 (pageType without effect) #158

Open
AppWerft opened this issue Jul 25, 2019 · 5 comments
Open

Autocompleter doesn't work in TYPO3v9 (pageType without effect) #158

AppWerft opened this issue Jul 25, 2019 · 5 comments

Comments

@AppWerft
Copy link
Contributor

This code in Partials/Form/Fields/Text.html

{f:uri.action
         arguments:{dictionary:fieldInfo.autocompleteDictionary,q:'%%%%'},
         action:'suggest',
         pageType:'1369315139',
         additionalParams:{type:1369315139},
         format:'data',
         noCacheHash:1
 )}\"}

In the generated link the key type is missing. In older installation (8.*) it worked.
Here an example link:
https://hosdev.sub.uni-hamburg.de/de/suchen-entdecken/discovery/?tx_find_find%5Baction%5D=suggest&tx_find_find%5Bcontroller%5D=Search&tx_find_find%5Bformat%5D=data&tx_find_find%5Bq%5D=hamb&cHash=6c348fe79748ec6163d21aa39c563794

Any ideas? The added additionalParams: is a workaround, but didn't work.

@AppWerft
Copy link
Contributor Author

AppWerft commented Jul 25, 2019

If I use pageType:'1369315139', or additionalParams:{type:'1369315139'}, -- in both cases type=1369315139 isn't part of Uri.
If I use a test like additionalParams:{typex:'1369315139'}, then typexis part of query string. I think somebody removestype` from object.

Additional noCacheHash:1 doesn't work in v9.*.

@AppWerft
Copy link
Contributor Author

OK, little progress:
If I add .data to the mapping in config.yaml file. In this case .data will appended to path with this result:

https://hosdev.sub.uni-hamburg.de/de/text-mit-suchschlitz.data?no_cache=1&tx_find_find%5Baction%5D=suggest&tx_find_find%5Bcontroller%5D=Search&tx_find_find%5Bformat%5D=data&tx_find_find%5Bq%5D=jena&cHash=08dfec0143f8f0d50be66a3271780472

This request generates an empty JSON array.

@AppWerft
Copy link
Contributor Author

Degugging SolrServiceProvider.suggestQuery:

$arguments:

Array ( 
	[action] => suggest 
	[controller] => Search 
	[format] => data 
	[q] => jena 
) 

$this->query:

Solarium\QueryType\Suggester\Query Object
(
    [options:protected] => Array
        (
            [handler] => suggest
            [resultclass] => Solarium\QueryType\Suggester\Result\Result
            [dictionaryclass] => Solarium\QueryType\Suggester\Result\Dictionary
            [termclass] => Solarium\QueryType\Suggester\Result\Term
            [omitheader] => 1
            [build] => 
            [reload] => 
            [query] => jena
        )

    [helper:protected] => 
    [params:protected] => Array
        (
        )
)

$solrResults:

Array()

Search for jena works in solr console ;-)

How can I see the real http request against solr?

@AppWerft
Copy link
Contributor Author

This is the $this->query in v8 of TYPO3:

Solarium\QueryType\Suggester\Query Object
(
    [options:protected] => Array
        (
            [handler] => suggest
            [resultclass] => Solarium\QueryType\Suggester\Result\Result
            [termclass] => Solarium\QueryType\Suggester\Result\Term
            [omitheader] => 1
            [query] => jena
        )
    [helper:protected] => 
    [params:protected] => Array
        (
        )
)

The main difference is the new [dictionaryclass] => Solarium\QueryType\Suggester\Result\Dictionary.

I guess an other default behaviour.

@AppWerft
Copy link
Contributor Author

AppWerft commented Jul 26, 2019

In current project we use TYPO3 v9 and solarium "~4.2"
In the older (running) project we use TYPO3 v8 and solarium "3.7"
The standard search request seems to work in both versions of solarium. The suggester makes trouble. Maybe we have to modify the suggestQuery-method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant