Support
Quality
Security
License
Reuse
kandi has reviewed solr-researcher and discovered the below as its top functions. This is intended to give you an instant insight into solr-researcher implemented functionality, and help decide if they suit your requirements.
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
Solr SearchComponent for altering and re-executing queries that product poor results
See all related Code Snippets
QUESTION
How do I create a search engine that find similar results in case it does not find a specific match? (mongoDB)
Asked 2022-Feb-25 at 01:25I am building a question function in my website where a user can search up a question
for example:
"how do I cook a cake?"
and get a link to the question someone else asked before of whom title is:
"how do I make a cake?"
the question is almost the same yet the writing is different and for now a user cant find question 2 if they search for question 1 search i just input the search bar into collection.find({})
how do I fix this? is there an API who can maybe generate similar and same meaning sentences to search for?
Thanks!
ANSWER
Answered 2022-Feb-25 at 01:25I dont think this answer is a search engine tat you want but it is the best that mongodb can do.
Use $text
db.articles.createIndex( { subject: "text" } )
db.articles.insertMany( [
{ _id: 1, subject: "coffee", author: "xyz", views: 50 },
{ _id: 2, subject: "Coffee Shopping", author: "efg", views: 5 },
{ _id: 3, subject: "Baking a cake", author: "abc", views: 90 },
{ _id: 4, subject: "baking", author: "xyz", views: 100 },
{ _id: 5, subject: "Café Con Leche", author: "abc", views: 200 },
{ _id: 6, subject: "Сырники", author: "jkl", views: 80 },
{ _id: 7, subject: "coffee and cream", author: "efg", views: 10 },
{ _id: 8, subject: "Cafe con Leche", author: "xyz", views: 10 }
] )
db.articles.find( { $text: { $search: "coffee" } } )
{ _id: 1, subject: 'coffee', author: 'xyz', views: 50 },
{ _id: 7, subject: 'coffee and cream', author: 'efg', views: 10 },
{ _id: 2, subject: 'Coffee Shopping', author: 'efg', views: 5 }
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
See Similar Libraries in
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source