wiki icon indicating copy to clipboard operation
wiki copied to clipboard

search

Open devp01 opened this issue 7 years ago • 14 comments

Question Search functionality is not working.

Host Info (please complete the following information): OS: Ubuntu 18.04 Wiki.js version: [e.g. 2.0.0-beta.115] Database engine: mysql Ver 8.0.17

The error is displayed below. image

devp01 avatar Aug 19 '19 13:08 devp01

I was just trying to search a page. Tried home page and the error message is as above. I am using mysql Ver 8.0.17. Search engine selected is the default Database- Basic

devp01 avatar Aug 19 '19 13:08 devp01

I'm experiencing the same, but with ElasticSearch as backend. The nodes aren't being indexed, even with manual indexing from the admin

diabeeto076 avatar Aug 23 '19 12:08 diabeeto076

Please update to the latest version of wiki.js first. If the bug still occurs, we'll troubleshoot.

NGPixel avatar Aug 23 '19 12:08 NGPixel

Not sure if it is related but, I cannot search either Japanese or English in 2.0.0-beta.268, installed via docker compose.

RickCogley avatar Aug 26 '19 05:08 RickCogley

Not working here either!

To Reproduce Type anything in search input and the error "An unexpected error occured" shows up.

Expected behavior Return search results OR message "An unexpected error occured" should be "An unexpected error occurred".

Screenshots image

Host Info (please complete the following information): OS: Ubuntu 18.04.2 LTS Wiki.js version: 2.0.0-beta.275 Database engine: MySQL 5.7.26

Extra Information GraphQL request response:

[{"errors":[{"message":"select `id`, `title`, `description`, `path`, `localeCode` as `locale` from `pages` where (`isPublished` = true and (title LIKE '%'Mark'%' COLLATE utf8_general_ci or description LIKE '%'Mark'%' COLLATE utf8_general_ci)) limit 100 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Mark'%' COLLATE utf8_general_ci or description LIKE '%'Mark'%' COLLATE utf8_gene' at line 1","locations":[{"line":3,"column":5}],"path":["pages","search"],"extensions":{"code":"INTERNAL_SERVER_ERROR","exception":{"code":"ER_PARSE_ERROR","errno":1064,"sqlState":"42000","sqlMessage":"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Mark'%' COLLATE utf8_general_ci or description LIKE '%'Mark'%' COLLATE utf8_gene' at line 1"}}}],"data":{"pages":null}}]

joseantonnio avatar Aug 30 '19 20:08 joseantonnio

@NGPixel Faced the same issue. This is how knex escapes strings. Raw queries like this one will cause such behavior because knex wraps strings with quotes when binding string values. You might consider replacing it with something like this:

builder.whereRaw(`title LIKE ? COLLATE utf8_general_ci`, [`%${q}%`]) 

tverdohleb avatar Sep 05 '19 17:09 tverdohleb

Updated to 2.0.0-beta.303 and still occuring.

joseantonnio avatar Sep 24 '19 11:09 joseantonnio

Today I've configured CloudSearch and this bug was gone! Looks like @tverdohleb is really right. Problem is related to knex query and local database.

joseantonnio avatar Sep 25 '19 16:09 joseantonnio

I have the same issue on 2.0.0-beta.303

Host Info: OS: Windows_NT (win32) 10.0.14393 x64 Wiki.js version: 2.0.0-beta.303 Node.js: 10.16.3 Database engine: MySQL 8.0.11

mattbryce avatar Oct 15 '19 13:10 mattbryce

Still an issue on 2.0.0-rc.1

Host Info: OS: Windows_NT (win32) 10.0.14393 x64 Wiki.js version: 2.0.0-rc.1 Node.js: 10.16.3 Database engine: MySQL 8.0.11

Issue appears linked to #842 #909

mattbryce avatar Oct 21 '19 12:10 mattbryce

I have the same issue on wiki.js 2.0.0-rc.1

Host info:

OS: Ubuntu 18.04.3 LTS
Wiki.js: 2.0.0-rc.1
Node.js: v12.13.0
Database engine: mysql  Ver 15.1 Distrib 10.3.18-MariaDB, for debian-linux-gnu (x86_64) 

centell avatar Oct 24 '19 07:10 centell

Fixed by d69dde1df5c2db74c10fe86ead50a63528c4487d

NGPixel avatar Nov 02 '19 20:11 NGPixel

I have the same issue... OS: Centos 7/8 Wiki.js: 2.0.0-rc.17 Doker: image: requarks/wiki:dev image: postgres:12.0-alpine

image

anibal-aguila avatar Nov 09 '19 15:11 anibal-aguila

I still have the same issue too OS: Debian 10 Buster Wiki.js: 2.2.51 Node.js: 10.15.2 PostgreSQL: 11.7 @anibal-aguila i think your version is too old the bugfix comes with the version https://github.com/Requarks/wiki/releases/tag/2.0.1

s1rauch avatar Apr 17 '20 08:04 s1rauch