Hello,
not sure if this is the right category. If not, please move this (if possible; or I can re-post this).
For several of our applications we have the requirement to implement a “global search bar”. Right now, it is only possible to search in a specific overview. So if I have vehicles and drivers in my application and I want to search for specific vehicle, I have to first navigate to my vehicle overview and then use the search bar there. What I want instead, is a search bar that’s visible in all contexts and will allow me to search in all entities. So I will enter my search term into this “global search bar” and this will give me results from all entities in the application (so in my example both vehicles and drivers that match my search term).
Or as another example, this “global search bar” should work like the search bar here in Discourse. Regardless of in which category I am right now, I can enter a search term into the search bar and will see posts from any category in the whole discourse.
Are there any similar requirements from other projects that you know of? Would that make sense as a general feature?
Best,
Lea
Hi @lea-clear-clover,
Currently, Data Services requires a target document model because the result of the overview must be mappable to the model selected. The fields of the overview are defined in the super type DM and selected by Overview engine for a table and filters. All queries for LIST_DOCUMENTS will automatically select all subtypes of document model which the current user can see (security is applied).
There are 2 main features when it comes to search in Data Services:
- Filtering
- Fulltext search.
For filtering, the values for specific fields must be set in order for a filter to match. For this option it does not make sense to support search in all documents because it would only match the documents where the fields are existing.
In case of fulltext search, this requirement would make sense from the business point of view, but the overview will still require a document model in order to display results. Search functionality is bound to an engine that will render results. Furthermore, client projects are often having “system documents” or documents that are not directly visible to users and those should never be displayed to users and there is no way how to remove them from the results.
Data Services does not plan to change this behavior in the foreseeable future because there are options how to achieve this behavior via modelling. Please create one Document Model which will contain all the fields that you want to search for in “global search” and make sure that this document model is a supermodel of all models which should be supported in a “global search”. There are no changes needed in any of our components to achieve this functionality.
This reply is valid for DS version: 36.0.0 - 37.0.0
Hi @lea-clear-clover
Just to make it clear, @tomas-thin-gale is recommending a Heteroeneous superType Document Model.
Here are the links to the Documentation and Tutorial.
Thanks for the feedback @tomas-thin-gale !
Is the global search in the SME also based on a supertype document model?
Hi @lea-clear-clover,
I have forwarded your question to the SME team. Unfortunately the responsible person is on vacation this week, but he will get back to you with more information when he is back.
If you already want to take a first look yourself at the feature, it was implemented in A12SME-3520.
Best,
Denise from the Discourse moderation team
Hi @lea-clear-clover, @denise-narrow-token,
the SME doesn’t use Data Services, so we have our custom implementation in the frontend