-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Enhance Search bar with autosuggestion and pagination from client based to server based #9879
Comments
To reduce notifications, issues are locked until they are
🏁 status: ready for dev
|
@Hayat4144 Thanks that's a great description on the issue. Can you explain how the auto suggestions work will it make network request to the server on every @eddiejaoude What are your thought on this. |
Let me explain the how we achieve it . When we building features like auto suggestion, one thing makes into mind is performance and I am agree with it. The search page is combination of different components, we will create a separate components for search which will prevents re-render of the parent component.We will not making server request on every And on the Backend side , we will create two index in mongodb atlas first one is for search and second one is for autosuggestion . we will create a new api route for autosuggestion called |
This sounds great 👍 awesome collaboration 💪 I have a question, will this also working on a local version of mongo? So dev (local) will be the same as prod (Atlas)? I heard this is now possible with recent changes by mongo |
According to my current knowledge ,the autosuggestion and full text search is only available in Cloud Atlas . I don't know autosuggestion and full text search feature exist or not in recent version of mongodb . I will check it and informed you if I get any information related to it. |
I don't think so the autosuggestion is available in mongodb in Os. It is only exist in cloud. |
How would this affect developing locally? Would it break or return no results or something else? |
It throw error in local development , but we can prevent it from error. Here is the solution for it. Here is basic code how it will be done : ```js
const SeachLogic= ()=>{
if(!development){
// here is production logic
}else{
// development login
}
}
|
We can use concept of tries to autocomplete the words that user trying to enter, just like google search. |
I am not keen on this because it will create not only extra code but also when we get bugs and we won't know about them |
We have to just create the database in cloud add search index. |
It looks like Atlas features are available locally now https://www.mongodb.com/blog/post/introducing-local-development-experience-atlas-search-vector-search-atlas-cli ℹ️ eddiejaoude has some opened assigned issues: 🔧View assigned issues |
if Mongodb Atlas search is available in the local version it's good . we just need mongodbUrl connection which support atlas search either in cloud or locally. Now, Atlas search exist in local database, we should implement this feature. |
We can also take it step by step, breaking it up more. Firstly, let's create an api for auto suggestions as suggested by @Hayat4144 and test is rigorously on both local and production. If we are satisfied with the results, then we can integrate this api in frontend. Coming to frontend, currently we are able to see the results after the user clicks on |
The suggestion will appear as users type in the search bar and a popover will be open just below the search bar. see the below image |
Ok and when we click on suggestions, we will be redirected to view the full information of the user, correct? I have one other suggestion, instead of adding a new feature to get suggestions, how about we remove the search button all-together. What we can do is, merge this suggestion and search feature. As mentioned by @Hayat4144 we will use
|
The existing search functionality is something like the below steps:-
Here is what i suggest
Using either if use name we will fetch the user having similar name, but not with similar tags. |
Is this a unique feature?
Is your feature request related to a problem/unavailable functionality? Please describe.
The current implementation of the search bar employs a client-side pagination strategy, leading to suboptimal performance, especially when dealing with large datasets. One major concern is that the entire document is loaded into the client's memory, resulting in increased latency and potential performance bottlenecks.
The current approach may cause delays in rendering search results, leading to a suboptimal user experience. Users may experience laggy interactions and slower page loads, affecting the usability of the search functionality.
Proposed Solution
I propose enhancing the current search functionality by adding an autosuggestion feature to the existing search bar and optimizing pagination from client-based to backend-based for improved performance.
Feature 1: Autosuggestion in Search Bar
Implementing autosuggestion in the search bar can significantly improve the user experience by providing real-time suggestions as users type. This feature can help users refine their search queries, discover relevant content faster, and reduce the likelihood of typos or errors in their input.
Feature 2: Backend Pagination for Improved Performance
Currently, pagination is handled on the client side, which may lead to suboptimal performance, especially when dealing with a large dataset. By transitioning to backend pagination, we can improve the efficiency of data retrieval and reduce the load on the client. This change can result in faster page load times and a smoother overall user experience.
Proposed Changes:
Autosuggestion in Search Bar
Backend Pagination:
Screenshots
Here is the some of the screen shot how the ui will looks after the changes.
Do you want to work on this issue?
Yes
If "yes" to above, please explain how you would technically implement this
I already solve this problem with mongodb search index and aggregation . if you agree with this features i will make a pull request.
The text was updated successfully, but these errors were encountered: