Sometimes it's not practical to explicitly list all the fields one wants to target when searching. Maybe there are lots of them, maybe you just want to target all fields that can be targeted, ...
Some related discussions on the forums:
* https://discourse.hibernate.org/t/hibernate-search-6-0-0-beta6-simplequerydsl-breaking/3977/6 * https://discourse.hibernate.org/t/support-for-copy-to-mapping-on-fields/415
Elasticsearch offers several solutions to that problem; we should investigate and pick the most appropriate. In particular:
* Some queries implicitly target all relevant fields when we don't pass a field name (simple query string in particular) * The {{copy_to}} attribute in the mapping allows copying the content of a field to another at indexing time : https://www.elastic.co/guide/en/elasticsearch/reference/current/copy-to.html * I remember seeing something about an {{_all}} field whose content is the content of all other fields? Though I believe it was disabled by default.
Alternatively, we could use our own concept of groups in Hibernate Search:
* Assign one or more groups to each field. * When searching, specify the group name instead of the field name, which will select all fields with that name.
We already need that concept of groups for other features, and will most likely introduce it in HSEARCH-3903, so... two birds with one stone? |
|