设计模式 - Java怎么做到实时展示查询结果?
大家讲道理
大家讲道理 2017-04-17 11:25:16
0
3
829

我们做的是Java客户端程序,想实现类似于ajax的实时、动态展示的效果。
比如一个查询,输入查询条件,根据输入的内容,动态的展示相关的结果。
有哪些好的解决方案?
开始我们设想的是 所有的字段都like一遍输入的内容,但是这样效率肯定会非常的差。
有没有高效的方法?

谢谢。

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(3)
小葫芦

If you want to implement search, you can use Lucene, which is faster than sql like.

迷茫
  1. Lucene
  2. Database full-text index
  3. Memory query
阿神

There may be a problem with this question itself. Ajax does not solve the performance problem, but the page is not refreshed. The specific response speed of the found results is the processing speed of the background. If you use a java application, you can communicate directly.

I think we can improve the query speed from two aspects.
1. If there are not many query conditions, for example, just search by title. Then, similar conditions can be placed in memory.
2. If the query conditions are relatively large, use full-text search. Similar to Lucene mentioned above, of course, if you don’t have time to study too deeply, you can use
solr, or sphinx, etc.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template