Search unreliable
-
@baris said in Search unreliable:
@tlinden what does the following query return?
db.searchtopic.find({id: 178});
@baris this::
> db.searchtopic.find({id: 178}) { "_id" : ObjectId("5a9d818cd19a243c1a362c1c"), "id" : 178, "content" : "Semmelknödel ala Tom", "cid" : "24", "uid" : "3" }
-
@tlinden ok so it is in the
searchtopic
collection, does searching for it like this find it?db.searchtopic.find( { $text: { $search: "Semmelknödel" }}
I don't think full text search supports partial word matches right now. https://stackoverflow.com/questions/44833817/mongodb-full-and-partial-text-search?rq=1
I will hopefully add language support to dbsearch plugin if mongodb is used https://github.com/barisusakli/nodebb-plugin-dbsearch/issues/33
-
Ah, that explains it! Searching for
Semmelknödel
reveals 1 topic and 2 posts (which is correct). So, we have to seach for whole words until partial matches are supported sometime.Ok, still a little annoying for the girls, but I'm going to blame you
However, thanks for clarifying @baris !
best,
Tom -
You can also try Solr search for NodeBB.
First install solr-jetty (jetty is lighter and has better performance than tomcat):
sudo apt-get install solr-jetty
(This also automatically installs the many needed dependencies, basically Java packages).
Optional: Temporarily open port 8080 if you want to see Solr admin (not needed):
(Port 8080 worked for me; if not, try 8983).
Then install NodeBB's Solr plugin:
NodeBB Admin > Extend > Plugins > Find Plugins > nodebb-plugin-solr > Install
Then activate the plugin, restart NodeBB, reload admin page, and go to:
Plugins > Apache Solr
Configuration:
Host: localhost
Port: 8080
Path: /solrSave Settings
Reload NodeBB and admin page.
Connected
Indexing Enabled
Rebuild Search Index
Disable port 8080 (or 8983) on firewall for security.
It works well.