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

Search 6 groundwork - Use "builder factories" consistently for DSL builders in backends

    Details

      Description

      The idea is to have one "builder factory" instance for each field and each DSL (predicate/sort/projection). See org.hibernate.search.backend.lucene.document.model.impl.LuceneIndexSchemaFieldNode#predicateBuilderFactory for example.

      In HSEARCH-3222 Closed Guillaume is working on taking this path for projections as well, and I think it's the more future-proof choice.

      Currently we use this pattern rather inconsistently; for Lucene it's mostly used everywhere, but not for Elasticsearch.

      Also, we have some issues with the "factory" interfaces:

      1. I think the equals/hashCode on the LuceneFieldPredicateBuilderFactory interface doesn't serve any purpose. In fact, it's only implemented in a single factory, and according to Coveralls it's never called in our tests. I think we can safely remove these methods from both the interface and implementations, I must have forgotten to do it when I introduced isDSLCompatibleWith.
      2. Ultimately we should do the same for SortContributors (declare an isXXXCompatible method instead of equals/hashCode).
      3. https://github.com/hibernate/hibernate-search/pull/1759#discussion_r227247517

        Attachments

          Activity

            People

            • Assignee:
              gsmet Guillaume Smet
              Reporter:
              yrodiere Yoann Rodière
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: