wiki icon indicating copy to clipboard operation
wiki copied to clipboard

PostgreSQL search doesn't produce the expected results

Open FelixSFD opened this issue 6 years ago • 4 comments

Actual behavior

Searching for some words don't produce the expected results. Search engine: Database - PostgreSQL Laguage: German The index has been rebuilt.

Example: This is a page in our wiki:

# Godmode im APManager zum setzen von default Einstellungen

Möchte man zum Beispiel die Datei `sysconf_values_default.xml` bearbeiten wollen, weil man einen neuen SysConf-Kenner hinzugefügt hat, kann man den God-Mode aktivieren anstatt die Datei von Hand bearbeiten zu müssen.
Hierfür muss lediglich im Manager die Tastenkombination STRG + ALT + SHIFT + G gedrückt werden.

Im Header sieht man dann, dass der God-Mode aktiviert ist.

![APplus Manager God Mode aktiv](/uploads/screenshots/god-mode.png "APplus Manager God Mode aktiv")

**WICHTIG: Nicht vergessen, den Modus nach den Änderungen direkt wieder zu deaktivieren!**

When searching for "Einstellungen", the page doesn't show up in the search results. Same for "Änderungen". Both querys result in 0 search results. If you search for "sysconf_values_default" the page shows up in the results.

In some cases, it even doesn't work for words that occur several times in the same page.

Expected behavior

If a word from the search query exists in the page, the page should show up in the results. Especially when whe word is proposed by the search engine.

Steps to reproduce the behavior

see sample page above.

Environment

image

FelixSFD avatar Jan 07 '20 12:01 FelixSFD

I have the same problem, I believe this has worked before

Setup: docker on ubuntu 18.04

  • wikijs image: id=033143eb5c54 (6 weeks old, we automatically follow the latest image)
  • postgres image: postgres:9-alpine id=9cf4cb60e463

Search engine: basic Language set to English but a mix of English and Dutch Page encoding: markdown

Page extract

# SMB shares
Mount weergeven: `mount | grep /mnt`
Mappen moeten bestaan in het lokale (`/mnt`) bestandssysteem vooraleer ze gemount kunnen worden
Bestand `etc/fstab` editeren + `sudo mount -a -v` uitvoeren.
Verwijderen met `sudo umount <locale map>`
Te testen met `smbclient`

Search for 'mount' gives 'no results'

stefaanMLB avatar Jan 09 '20 10:01 stefaanMLB

@stefaanMLB Use the DB - PostgreSQL search engine instead. The basic only searches in title and description, as explained in the docs.

NGPixel avatar Jan 10 '20 20:01 NGPixel

The install docs need updated. You need: sudo apt install postgresql-contrib

Then: psql -U <DB_USERNAME>

Then switch to your wiki.js DB: \c <DB_NAME>

Then install the pg_trgm extension: CREATE EXTENSION pg_trgm;

I had previously added the extension globally, but it appears you must enable it specifically for the database.

brewerc1 avatar Jan 24 '20 21:01 brewerc1

The issue seems to be fixed in Version 2.1.113. Probably related to #1269

FelixSFD avatar Feb 18 '20 12:02 FelixSFD