2020-10-17

Select language for query and option to search pages in all languages.

Hello, how can I add a select box or radio buttons to the search box to allow users to select three options: Show German Results only, Show English results only, Show results in any language? I mean directly below the search box and without the need to create a user account etc. Thank you Harald PS: I'm referring to version 6. Version 7 doesn't work with PHP 7.2 as there are statements like ??= in the code.
(Edited: 2020-10-17)
Hello, how can I add a select box or radio buttons to the search box to allow users to select three options: Show German Results only, Show English results only, Show results in any language? I mean directly below the search box and without the need to create a user account etc. Thank you Harald PS: I'm referring to version 6. Version 7 doesn't work with PHP 7.2 as there are statements like ??= in the code.

-- Select language for query and option to search pages in all languages
Hey Harold,
Hmmm. The ?? null coalescing operator was introduced in PHP 7.0. I was pretty sure that also included ??=
In Yioop 6.0 there should be a Settings link in the top bar of each page which would allow your to control the language. This does not require an account. The code for this view is in src/views/SettingsView.php. Its controller is src/controllers/SettingsController.php. The language settings are stored in the $_SESSION variable. You can disable which languages are populated in the SettingsView list by logging in as root and going to Manage Locales, editing the locale you want disabled and unchecking Locale Enabled. Adding no:guess to a query prevents Yioop from trying to guess what the default language is and so search results would be with respect to all languages.
Best,
Chris
Hey Harold, Hmmm. The ?? null coalescing operator was introduced in PHP 7.0. I was pretty sure that also included ??= In Yioop 6.0 there should be a Settings link in the top bar of each page which would allow your to control the language. This does not require an account. The code for this view is in src/views/SettingsView.php. Its controller is src/controllers/SettingsController.php. The language settings are stored in the $_SESSION variable. You can disable which languages are populated in the SettingsView list by logging in as root and going to Manage Locales, editing the locale you want disabled and unchecking Locale Enabled. Adding no:guess to a query prevents Yioop from trying to guess what the default language is and so search results would be with respect to all languages. Best, Chris
2020-10-18

-- Select language for query and option to search pages in all languages
Hello Chris, thank you for your reply. First: I'm really impressed by YIOOP.
Regarding the PHP error, this is one of the messages I got: [Thu Oct 15 14:07:50.342194 2020] [php7:emerg] [pid 29747] [client 95.112.36.210:49413] PHP Parse error: syntax error, unexpected '=' in ...../ctsearch/src/controllers/SearchController.php on line 617 I think the "Null coalescing assignment operator" was added in PHP 7.4: https://stitcher.io/blog/new-in-php-74
I'll check your suggestions, thank you. What I want is a direct option on the search page (below the search box) to select the language without the need to go to an extra page. I already disabled all unrequired locales.
I tried to add lang:de, lang:en and lang:all to the query, but it does not work well, as it does not consider the language specific word stemmings (I hope it's the right word) etc. (they are clearly different in English and German).
Kind regards, Harald
Hello Chris, thank you for your reply. First: I'm really impressed by YIOOP. Regarding the PHP error, this is one of the messages I got: [Thu Oct 15 14:07:50.342194 2020] [php7:emerg] [pid 29747] [client 95.112.36.210:49413] PHP Parse error: syntax error, unexpected '=' in ...../ctsearch/src/controllers/SearchController.php on line 617 I think the "Null coalescing assignment operator" was added in PHP 7.4: https://stitcher.io/blog/new-in-php-74 I'll check your suggestions, thank you. What I want is a direct option on the search page (below the search box) to select the language without the need to go to an extra page. I already disabled all unrequired locales. I tried to add lang:de, lang:en and lang:all to the query, but it does not work well, as it does not consider the language specific word stemmings (I hope it's the right word) etc. (they are clearly different in English and German). Kind regards, Harald
2020-11-03

-- Select language for query and option to search pages in all languages
Yioop does have a German stemmer, so that probably implies a bug in detecting whether to use it. Did you turn on the Query checkbox under the Configure activity. Scrolling down through Query Statistics this enables on SERP pages you can find a box with Phrase Query in it. This shows both what language Yioop was using and how terms were stemmed, and what additional terms were injected. Another place to check is under the Page Options activity under Test Options. There you can do test processing of individual web pages and see how Yioop would process them.
Best,
Chris
Yioop does have a German stemmer, so that probably implies a bug in detecting whether to use it. Did you turn on the Query checkbox under the Configure activity. Scrolling down through Query Statistics this enables on SERP pages you can find a box with Phrase Query in it. This shows both what language Yioop was using and how terms were stemmed, and what additional terms were injected. Another place to check is under the Page Options activity under Test Options. There you can do test processing of individual web pages and see how Yioop would process them. Best, Chris
X