[nodebb-plugin-solr] Solr search plugin


  • Admin

    Solr Search for NodeBB

    From Wikipedia:

    Solr (pronounced "solar") is an open source enterprise search platform from the Apache Lucene project. Its major features include full-text search, hit highlighting, faceted search, dynamic clustering, database integration, and rich document (e.g., Word, PDF) handling.

    This plugin extends NodeBB to utilise an installation of Apache Solr as a search backend.

    Configuration

    1. Install this plugin via npm: npm install nodebb-plugin-solr
    2. Activate it in the Plugins page
    3. Restart NodeBB
    4. Check that the plugin has successfully connected to the search engine. If not, adjust as necessary.
    5. Enable indexing and re-index the existing posts in your forum.

    Installation

    npm install nodebb-plugin-solr
    

    Version History

    • v0.1.0 Initial version (search indexing and querying)
    • v0.1.1
      • Search result caching (repeated searches return cached results)
      • Support for Basic HTTP Authentication
      • Ability to turn on and off indexing
      • Support for inline-topic searching (which relies on a feature in NodeBB Core that hasn't been built yet!)
      • Adds notices into the home page of the ACP
    • v0.1.4
      • Added support for specification of custom fields (if added into Solr's schema.xml) instead of using the assumed title_t and description_t

    Notes

    • This plugin requires Solr to be installed separately (either on the same server as your NodeBB, or somewhere else that is publically accessible)
    • This plugin conflicts with nodebb-plugin-dbsearch! If Solr detects that dbsearch is active, it will not return search queries (but will continue to index new posts if enabled)


  • Just tried searching some Chinese words in this forum, it does work! Wow!


  • Admin

    Thanks @Bin! One of the aims from this plugin is to allow non-latin language forums to have search, since dbsearch is phonetics based. Glad to hear it's working :)



  • @julian Wow, we will try it very soon. Thanks a lot.



  • Btw does this plugin work with 0.4.3(the latest release)?


  • Admin

    @Bin, this plugin works with the latest commits of NodeBB, so it is not compatible with v0.4.3. If you're on the master branch, a git pull is sufficient to bring you up to date.

    Edit: This commit: https://github.com/NodeBB/NodeBB/commit/b2ece27263fffbd603f219a7c3258a06dc329a89#diff-ed75d775004d7f6bf533c07c815c33ab

    So if you've pulled within the past 7 days, you're good :)




  • Global Moderator

    Will be keeping an eye on this, was a pain setting up db search once I'd imported my forum, so will have to see how this one copes with the initial indexing. :p


  • Admin

    For reference, it indexed this forum (about 12k posts) in about 4 seconds.



  • I was thinking about it for long time Solr, Elastic search. Is this forum now using solr ?


  • Admin

    Yes, @kinderjaje, when v0.1.0 was released (yesterday afternoon), I implemented it onto this forum, you can test it right now.


  • Gamers

    @julian I want to use this plugin and I have updated lastest NodeBB and Solr, but when I run ./nodebb dev, I got these warns:

    warn: [plugins/nodebb-plugin-solr] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.
    warn: [plugins/nodebb-plugin-solr] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset plugin="nodebb-plugin-solr".

    And when I use this I got some other errors. So what shoud I do to make this work?


  • Global Moderator

    Pylon can safely ignore warns about plugin incompatibility, this usually means that at some point in the future, a hook will be removed in favour for another one.

    What are the errors you see when trying to actually run solr?


  • Plugin & Theme Dev

    So we have to install Solr first, correct?

    ...then install the plugin?

    Can't wait for the inline-topic searching!
    -_-
    Installation Problem:
    When I try accessing the Solr page via ACP, it gives me a 404 error. Any thoughts?


  • Plugin & Theme Dev

    This post is deleted!

  • Gamers

    @julian said:

    npm install nodebb-plugin-solr

    Maybe you should upgrade NodeBB to the latest.


  • Plugin & Theme Dev

    @main It is updated to latest.


  • Gamers

    I have the same problem before, but after update NodeBB and Solr plugin, it's gone. Have you updated all of that?


  • Plugin & Theme Dev

    This is the error I'm getting:

    warn: Plugin: /home/c/node_modules/nodebb-plugin-solr is corrupted or invalid. Please check plugin.json for errors.

    I disabled all plugins @_@

    I noticed theres a version difference in NPM and on Github.


  • Gamers

    @a_5mith I can't build index and when I search got this error:

    TypeError: Cannot read property 'response' of null
        at /var/local/swift/node_modules/nodebb-plugin-solr/library.js:173:11
        at ClientRequest.<anonymous> (/var/local/swift/node_modules/nodebb-plugin-solr/node_modules/solr-client/lib/solr.js:576:21)
        at ClientRequest.EventEmitter.emit (events.js:95:17)
        at Socket.socketErrorListener (http.js:1547:9)
        at Socket.EventEmitter.emit (events.js:95:17)
        at net.js:441:14
        at process._tickCallback (node.js:415:13)
    

Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.