Looking for a good implementation of Mongo’s Text search when using Meteor and a pub/sub configuration, I have tried a few ways but they are janky and not very solid. I am using the text search and text score aggregation (https://docs.mongodb.com/manual/text-search/) over pub/sub seems to be a one hit per page and doesn’t refresh results.
So I’m thinking about setup with a method and just wanted to check if there was any other ways besides this I may have overlooked? Doesn’t seem to be much on the topic to find out there.
Thanks in advance!
1 Like
The challenge here is to identify the documents that will be affected by inserts and mutations and where will those documents will end up in the score aggregation.
This can be done better through method or even in redis-oplog, but again, the key is identifying the mutations guaranteed to trigger the reactivity
1 Like
Hello it depens on your needs, I use GitHub - qualialabs/mapped-collection: Memory-mapped Mongo collections in Meteor in combination with GitHub - qualialabs/lasr: Lasr search. Pew pew! for searching inside the users collection.
It works pretty well.
But I have few users ( 8K )
4 Likes
Memory mapped sounds interesting, thank you
Yes it is more or less what algolia does, which leads to massive performance.
It is easy to setup at least ( few minutes )
Yeh I’m going to be compiling typesense tomorrow and feeding from my data, Sphinx is good but too old now. Typesense looks good. The built in mongo text just ain’t that powerful really it seems
1 Like
So to update: I got it working with typesense it was a PITA their manual is crazy the code examples are broken out the box with not config errors but actual syntax errors (like using undeclared variables wtf) The mongo integration doesn’t work either. So I had to make my own. The main annoyance is they want jsonl for import data, so if anyone is attempting this - just make an object and then concatenate to a string with a new line, and the world is yours. Don’t bother with the npm packages because they also suck and gave unparsable json from parseable json…
It was worth the battle though, typesense is giving me results in 1ms and they are insanely good. I got it running on shell with a script so now just gotta create a method for meteor to access it via and then hook that into Meteor subscription and give it to the the React components and we’re golden.
1 Like
I got it working as I wanted. Did not need a method and just ran the request directly inside of the meteor code as it’s all node. The only issue was with React but I got around that and have now got search predictions and very accurate hits coming into semantic ui within 1ms over 3.8mln record set. I highly recommend using this approach over Mongo text search.
3 Likes