[hibernate-dev] [Search] Elasticsearch - Thoughts about analyzers and fieldbridges

Guillaume Smet guillaume.smet at gmail.com
Thu Feb 25 12:16:11 EST 2016


Running the DSLTest is quite interesting as it runs a lot of different
queries with different configurations.

Here are some thoughts while working on it.

1/ Analyzers

Gunnar, I was wondering what you had in mind for analyzers: a) deal with
them in Hibernate Search or b) let Elasticsearch do the analyze thingy.

I'm not sure we can get a/ to work correctly (see below) and for b) we're
going to need a way to disable the analyzers in Search for the entities
managed by Elasticsearch.

Take a phrase query "colder and whitening" extracted from DSLTest. As "and"
is considered a stopword, the resulting PhraseQuery only contains colder &
whitening so it's not possible to rebuild the phrase before sending it to
Elasticsearch. We could try to use span queries but I'm not sure we'll be
able to get it right with synonyms and so on.

2/ FieldBridges

Currently, the conversion from Date to JSON string is managed by a
fieldbridge specific to the Elasticsearch backend (and it's not that easy
to plug it in as we have seen it in a ticket).

I'm wondering if it's a good fit and if we should not invent an entirely
new thing to deal with the transformation between a given Java type and
what a backend is waiting for.

What made me think of it is that a test from DSLTest is using
ignoreFieldBridge() on a date field and it disables the Date -> JSON string
conversion entirely.

Comments, thoughts?


More information about the hibernate-dev mailing list