ezplatform-admin-ui-modules icon indicating copy to clipboard operation
ezplatform-admin-ui-modules copied to clipboard

Add the possibility to search by ContentId or LocationId in the searc…

Open ghost opened this issue 6 years ago • 9 comments

Add the possibility to search by ContentId or LocationId in the search tab of the browse feature in Universal Discovery Module. In the UDM, we have the need to find content directly by contentId or locationId. With a lot of contents, browsing is often not an option and search results are sometimes a bit weird. It becomes difficult to find the content we look for. This PR improves the ViewInput filter by reading the search query and searching something like "content:123" or "location:456". If such a pattern is found, replace the current FullTextCriterion with a LocationIdCriterion or ContentIdCriterion. Else keep the FullTextCriterion

ghost avatar Jun 18 '18 15:06 ghost

This is interesting, could build upon this kind of things with more expressions ala what was added to fulltext.

/cc @SylvainGuittard

andrerom avatar Jun 19 '18 06:06 andrerom

Thanks @NonoKaliop for the contribution. I think it's a interesting idea. If we had this new possibility to search, it should be implemented everywhere: UDW and the search page in ezplatform-admin-ui. If not, the user might be frustrated to have it only on one interface. This is my recommendation for adding this to the product.

Side question: does it make sense to also add remoteID? I don't have a use case, just asking.

SylvainGuittard avatar Jun 19 '18 19:06 SylvainGuittard

Side question: does it make sense to also add remoteID? I don't have a use case, just asking.

It's should at least be possible to add it.

Two people that might have interesting things to add here is:

  1. @bdunogier He worked on a query language to Query object mapper, it can be worth it to resurrect this as it was more or less done, and it can potentially be what you are asking for here, a common layer for all UI's to use, assuming the query language isn't to technical for editors for plain full text use.
  2. Possibly also @pspanja who worked on query parser for Full Text, as he might also have given queries beyond Fulltext a thought.

andrerom avatar Jun 19 '18 19:06 andrerom

@andrerom Query Translator would fit well here, you can cover these cases using the domain feature. And you can also customize the syntax and implement a generator that would convert AST to search criteria.

Implementing a language supporting basic subset of search API has been on my to do list for some time now.

pspanja avatar Jun 20 '18 09:06 pspanja

So maybe Query translator on top of @bdunogier's https://github.com/ezsystems/QueryBuilderBundle or something like it could be a possible approach then to expose a EZQL in search interfaces* :)

* And later allow those searches to be saved and used for views and filters across the system

andrerom avatar Jun 20 '18 11:06 andrerom

Well, depends :) Query Translator would be perfect for handling user input, but handling some more complex criteria like Field or MapLocationDistance could be a bit awkward. On the other hand if you want to have a text field for input, you probably also don't care for supporting stuff like that anyway.

But if you want to have some kind of query builder UI you might also want to go for a different language, one that would be formal and strict. It should not be too hard to implement since you would not need to worry about handling errors and Query is basically already an AST. So something that would more or less translate directly from the Query, like:

LogicalAnd(LogicalOr(ContentId(42), Field(title, eq, CMS)), MapLocationDistance(location, between, [25, 32], 42, 17))

That is still readable, but I think not too friendly for user input.

pspanja avatar Jun 20 '18 14:06 pspanja

Good input! 😃

Maybe there is enough initial info here to get PM team to aim to specify something soon on this, sounds like a plan @SylvainGuittard ?

andrerom avatar Jun 20 '18 18:06 andrerom

Happy to see that we are making some progress here. I will sync with @bdunogier for some specifications.

SylvainGuittard avatar Jun 20 '18 18:06 SylvainGuittard

@SylvainGuittard @andrerom @bdunogier what is the status here?

sunpietro avatar Jul 19 '18 08:07 sunpietro