tanish
February 22, 2023, 10:29am
1
Hello guys, I’m trying to implement elasticsearch in my node.js backend but I am seeing this error. I am unsure where this is originating, and I believe it is specific to Liana.
My package.json
"forest-express-mongoose": "^9.2.0",
"forest-express-sequelize": "^9.2.6",
"@elastic/elasticsearch": "^8.6.0",
“express”: “~4.17.1”,
Please assist.
Hello @tanish ,
Can you explain in which circonstances the error occurs? Is it when the server is launched? When it receives a specific request?
Is it a new project? Can you please share with us the name of the project?
Can you also explain what you changed? Did it work before your changes?
tanish
February 22, 2023, 12:58pm
3
I am currently using mongodb for my primary db.
But as I said, I’m trying to use elasticsearch for read only purposes.
In my routes folder, I created a file and added this code. It seems this line
const {
RecordSerializer,
Schemas,
parseFilter,
} = require(‘forest-express-sequelize’)
causes the issue.
Hello,
Are you accessing any SQL databases?
tanish
February 22, 2023, 6:59pm
5
I am not. I am trying to access an elasticsearch database to improve read performance. I have set up a client. According to the documentations, the queries use sql right? or am I incorrect about that?
Ok, thanks.
Then you don’t need the dependency forest-express-sequelize
which is meant to be used with SQL databases.
In your case, you need to add a smart collection to your project declared with forest-express-mongoose
We have a documentation here with an example: Another example - Woodshop
In your case, you have to replace references to forest-express-sequelize
by references to forest-express-mongoose
.