Uploaded image for project: 'Hibernate Search'
  1. Hibernate Search
  2. HSEARCH-2750

Move Elasticsearch query building (ToElasticsearch, parts of ElasticsearchHSQueryImpl) to a non-static object in ElasticsearchService

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 6
    • Component/s: elasticsearch
    • Labels:
      None
    • Last commented by a user?:
      true

      Description

      Rationale:

      1. There's way too much code in ElasticsearchHSQueryImpl, we should split it into smaller class to make it easier to understand/maintain
      2. I'm pretty sure that changes related to HSEARCH-2055 Open will force us to streamline a bit more how we build Elasticsearch queries (most notably to handle projections in a more generic and extensible way).
      3. And even more importantly, we'll need to implement parts of Elasticsearch queries differently depending on the Elasticsearch version we're targeting eventually.
        Actually we already do in HSEARCH-2603 Closed , but that ticket is too insignificant to justify such a massive refactoring (I'll probably just introduce the Façade with only one simple method, leaving the actual refactoring for later). Still, it's only a matter of time before we really need it.

      Some examples of what should probably be moved out of ElasticsearchHSQuery:

      • projection handling (creation of FieldProjection objects while populating the JsonObject representing the Elasticsearch query)
      • facet request building
      • filtering
      • sorts
      • ...

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                yrodiere Yoann Rodière
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: