in Education by
I am trying to determine the best method of collecting a large list from a database and then displaying and filtering the results on the client side. Let me give a quick example: Example: I've got a database with customer data and currently it contains around 2000 records. This number is constantly increasing. On my website I have a page that I want to be able to query said database based on information such as name, email, phone number etc. and of course display the results (when a user types in Smith it returns all records containing the name Smith). I am planning on using AJAX so that I can query the database and display the results on the fly similar to how google does it. When a user begins searching, results will start showing up on the page as they are found. Possible Solutions: Unfortunately I am stumped on how to go about implementing something like this. I am considering using a ValueList pattern. When the user first loads the page, should I be querying the database and storing every record in a collection and then searching that collection list and displaying the results on my jsp page? Essentially creating a java database. The thing I like about the ValueList pattern is that I take one huge hit on page load and dump the entire database in objects stored in a list. What if the database is larger though, say 2,000,000 records? Or should I be using a simple DOA pattern without the ValueList and query the database for each individual search? This would result in a LOT of database queries, especially considering that I plan on returning results as the user types in the search box. Edit: The more I think about this, the more it is an AJAX question. My biggest concern should be how to query my database while the user is typing. Do I set some sort of listener to listen for the user to stop typing and then perform the query? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I would use Solr for this type of task. Fields, which you are going to use for searching should be indexed with Solr. Then you do an ajax query to Solr and get the result. You can set the order, number of items per page and show results only for current page. Solr has a lot of other features that can be useful for you.

Related questions

0 votes
    drop cap feature allows to display the first word of the paragraph in a large capital say true or false Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    Write a basic SQL query that lists all orders with customer information....
asked Apr 27, 2021 in Technology by JackTerrance
0 votes
    This is my code that displays output that I would like to alter: import json from collections import OrderedDict ... find anything. Select the correct answer from above options...
asked Jan 19, 2022 in Education by JackTerrance
0 votes
    ______________________ lists all the available database objects.Single choice. Tabs Title bar Navigation pane Groups Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    What is the best way to represent the attributes in a large database? (a) Relational-and (b) ... from Database Design Process in portion Normalization of Database Management...
asked Oct 10, 2021 in Education by JackTerrance
0 votes
    a query to display all the employee details of salesman and manager Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    I have a couple of MySQL queries that take a really long time and I'd like to display a progress ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I have a couple of MySQL queries that take a really long time and I'd like to display a progress ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    write a query to display the numeric of employees with same job? Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    I have this table where columns correspond to names: i.e. 11 = first, 12 = second, 13 = third.. ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jan 15, 2022 in Education by JackTerrance
0 votes
    here is my code. var http=require("http"); var fs = require("fs"); var express = require(" ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 19, 2022 in Education by JackTerrance
0 votes
    I have already tried to make a login form and I also want to display the user login profile that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have already tried to make a login form and I also want to display the user login profile that ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    After reading the chapter, I know these points: I know that data gets highlighted after being selected. I know ... entry and editing. Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
...