English 中文(简体)
彩票、显示器和过滤器大型数据库清单
原标题:Query, Display, and Filter Large Database Lists

我正试图确定从数据库中收集大量名单的最佳方法,然后在客户方面展示和过滤结果。 让我举一个例子:

<>>Example: 我用客户数据检索一个数据库,目前它包含大约2000年的记录。 这一数字在不断增加。 在我的网站上,我有一页希望能够根据姓名、电子邮件、电话号码等信息查询该数据库,当然也显示结果(Smith的用户类别将包含Smith的所有记录归来)。 我正计划使用非洲宇宙航空研究开发机构,以便我能够查询数据库,并展示类似于“角”的飞行结果。 当用户开始搜索时,结果将随着发现而开始在网页上展示。

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?

最佳回答

I would use Solr for this type of task.

你们将用来搜索的田地,应当与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.

问题回答

暂无回答




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签