Asynchronous Search

I am currently working on creating evidence to solve the search concept for my company using Lucene and Hibernate Search. I created separate components that work great. Now I am considering creating a single API that will allow the user to receive search results from different sources (domain + data). What I would like to achieve is something like a search manager that starts search queries to various search components asynchronously and when one set of results is processed, it returns the result that the user receives when processing the rest. Once the search result has been processed, notify the customer of the availability of more search results.

I am wondering if I have a search manager that creates separate threads to search for individual search components and maintains a list of search results. After the list is filled with one return, returning to the user. Any additional search results would add a search manager that pushed the results to the user.

I am not looking for any example code (any would be appreciated), but I was wondering if I could get any guidance on how to solve this problem. Do I use event processing technologies (GigaSpaces, Spring, JMS) or use standard Java parallel libraries. What will be an effective way to manage the list and display updated results.

Greetings

+3
3

+1

, . Lucene, , "" Java.

:

(, ) , , . .

run, - , . - , , , .

. , , .

( -) .

, .

0

Scatter-Gather: JMS ( - ), - , .

The advantage of using JMS or the like is that you avoid linking multiple threads waiting for reponses, and you have a mechanism for handling the responses that come after the first result set is returned to the user.

You might want to learn about Solr , the Lucene-based open source search server, and how they deal with these problems.

0
source

Source: https://habr.com/ru/post/1708954/


All Articles