Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7535829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:24:25+00:00 2026-05-30T06:24:25+00:00

(this is in a Java project) I’m using a search engine in parallel with

  • 0

(this is in a Java project)

I’m using a search engine in parallel with a relational database. The main object of interest is a ‘listing’. It has approximately 5 other entities in a composition style structure. One is location, another is a complex time and date definition.

From my experience, and from research, searching is WAY faster on Solr,Lucene, Elastic SEarch than any database with full text and geographical indexes added. So, that’s why I wish to use a search engine on the data that is in the data base. Also, the search engine will contain more granular time entries than the database, more concrete vs. formualaic.

So, in reference to a design pattern: The goal is to have CRUD happen from the API to both the database contents on an entity and also on all the time and geographical permutations instantiated in the search engine index.

I have had discussions with a partner and I believe he is right when he says
To keep coupling low, that the ‘Listing’ class, (again, the top of the data hierarchy in the data), should NOT know about the search engine and NOT have static functions added to it that do search on the search engine. He stated that a ‘Chain of Responsibility’ design pattern might be appropriate way to allow the CRUD of the API to act both on the database and the search engine contents. My read on that is that’s not correct.

I have been looking on http://sourcemaking.com/design_patterns and I think that the Facade pattern, http://sourcemaking.com/design_patterns/facade, might be best. But I’d like to hear other opinions.

Thank you in advance.

PS. I am developing an osem layer (http://en.wikipedia.org/wiki/Compass_Project) capable of being injected into a Spring IOC. This layer is custom made for ElasticSearch. As of yet, it doesn’t support transactions or foreign keys (and may never do so). But it will have annotation hooks to develop those later. You may want to look at it. It’s at https://github.com/kwince/osemManager . There are currently two branches of it underway. I’ll decide which one to merger in the next week.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:24:26+00:00Added an answer on May 30, 2026 at 6:24 am

    Facade patter is more suitable for hiding some comlicated sub-system behind a relatively simple interface.

    From what I can understand you have 2 different systems and you want to send the same request to both. You need to know what’s the relationship between these 2 systems:

    • If there is some form of preference of one system over another you’d use the Chain of responsibility: you’d send a request, if the first system can handle it, you get the result, if not, the request goes to the next system in chain, and so on.
    • If there is some form of augmenation or enhancement of a result from one system by results from another, you’d use Decorator, so the request goes to the “outer” system first, it calls to the “inner” system, gets some results then decorates them with its own data and returns decorated results;
    • If you just have 2 independent system you want to query in parallel, then use “just do it” pattern =) Use some parralel primitives from your framework, send 2 requests, wait for both results, submit them to a merge function.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a java project in eclipse which are using tomcat. This project has
I am using Netbeans IDE for a java project. In this project i need
I want to add a .java file into my project. But this .java has
I have a Java project that builds using Apache Ant to a website. This
I have a Java project that is using Cucumber for BDD. This morning the
I am working on a Java project in Eclipse. In this I am using
My Java project structure in Eclipse looks like this: myproject src/main/java com.mypackage.mysubpackage1 com.mypackage.mysubpackage2 com.mypackage.mysubpackage3
I have a Java project which has this file structure (shown in Eclipse): ProjectName
In our java project, We decided to use ORM object/relational mapping technique in objects'
I'm porting parts of Java project to C# and came across this constant Constant.NamespaceSpecNS.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.