barisusakli / nodebb-plugin-dbsearch

A plugin that uses the database for search
16 stars 24 forks source link

search doesn't work due to "text score" not being available #28

Closed dwatley closed 7 years ago

dwatley commented 7 years ago

I searched for this error and found a recent commit to MongoDB with the text string here: https://github.com/mongodb/mongo/commit/a8414a21ef6594b2e786652e4823687cd1b3ec72

I could be wrong but this seems to be due to a code change in MongoDB. Basically searching is completely non functional, though it does appear to be indexing according to the admin panel. Attempting to search from the sidebar produces an "Internal Error", and searching from the top bar near the notifications/chats returns no results.

Logs

Jan 03 21:09:07 nodebb nodebb[13804]: 3/1 21:09:07 [24951] - error: [plugins] filter:search.query, pipeline requires text score metadata, but there is no text score available Jan 03 21:09:07 nodebb nodebb[13804]: 3/1 21:09:07 [24951] - error: /api/search Jan 03 21:09:07 nodebb nodebb[13804]: MongoError: pipeline requires text score metadata, but there is no text score available Jan 03 21:09:07 nodebb nodebb[13804]: at Function.MongoError.create (/opt/nodebb/node_modules/mongodb-core/lib/error.js:31:11) Jan 03 21:09:07 nodebb nodebb[13804]: at queryCallback (/opt/nodebb/node_modules/mongodb-core/lib/cursor.js:212:36) Jan 03 21:09:07 nodebb nodebb[13804]: at /opt/nodebb/node_modules/mongodb-core/lib/connection/pool.js:455:18 Jan 03 21:09:07 nodebb nodebb[13804]: at _combinedTickCallback (internal/process/next_tick.js:67:7) Jan 03 21:09:07 nodebb nodebb[13804]: at process._tickCallback (internal/process/next_tick.js:98:9)

Version Information

MongoDB version: 3.4.1 NodeBB version: 1.4.2 (d5fb6dac38e4fb102dcd0a0256238019da1e84cf) nodebb-plugin-dbsearch version: nodebb-plugin-dbsearch@1.0.4

dwatley commented 7 years ago

Downgrading the MongoDB version to 3.2.11 per the downgrade instructions including:

  1. setting feature compatibility level to 3.2
  2. re-indexing to v: 1
  3. in the dbsearch plugin clearing the index and re-indexing.

Search now works as expected. So this seems to be an issue of compatibility with the new release of MongoDB.

barisusakli commented 7 years ago

Is this reproducible on a fresh install with mongodb 3.4.1?

dwatley commented 7 years ago

Yes, it was a completely fresh install in the first place. I figured since I was doing a fresh install I'd use the most up to date production releases of related software. Based on the MongoDB commit the error text was added to version 3.3.10.