Closed (fixed)
Project:
Facets
Version:
8.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Feb 2017 at 12:32 UTC
Updated:
13 Oct 2017 at 14:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
borisson_This is a first shot at it, we need to figure out a way to do this for core search still. Just uploading progress for now as it's too late to continue for today.
Comment #3
borisson_@fago: is the path in #2 what you wanted to achieve here? I'd like to get approval before I start implementing this in other places.
Comment #4
borisson_Rerolled + converted TranslateEntityProcessor. I'm really liking this as this makes the processor so much easier.
Comment #6
borisson_Fixes the unit test, which is now also a little bit simpler.
Comment #7
fagoOh, awesome to see this getting implemented! :-)
The approach taken looks generally good, however it (needlessly?) restricts it to field definitions. A search is not necessarily about a content entity with fields, i.e. with search API any data could be indexed and searched. Thus, the API should have getDataDefinition(). In the case of indexed entities, it then can return the field definition. So could it just be getDataDefinition() and getDataDefinitions() instead?
Comment #8
borisson_I forgot to commit on my local branch, so the interdiff includes the interdiff in #6.
This makes the change suggested in #7 and adds a kernel test to test basic functionality of the new methods as well.
Comment #9
borisson_This is a first stab at an implementation for core search + a small improvement of the ListItemProcessor but not yet an implementation of the new api there (I don't really know how to do that... that processor has become a beast of complexity that we should improve) + extra comments in the kernel test.
So what's next now?
Comment #10
borisson_Adds more docs on the interface.
Comment #11
borisson_Also fixed the list item processor, now all we need to do is make sure that the implementation for core works.
Comment #13
fagoThat looks great! A few remarks below:
The $config object is already the field definition, which is a typed data definition also. Thus, just returning $config / $configs should be fine here.
Even more generic would be if you loop over the item definitions and check them for being of type "entity", or if you require the entity type to be known: "entity:some-type".
All core references use "entity" though, but strictly speaking field types could have properties named "entity" which are something completely different, e.g. some html entity character string.
Comment #14
borisson_I don't understand .2
Comment #17
borisson_Can't get the list item processor to work with the new getters, but I think we can commit this and open a follow-up for the list item processor. #2851845: List item processor does not work with language references is already changing that processor so that sounds like a better place to refactor the whole thing.
Comment #18
borisson_Doing this will break the API, so we should do this before we tag the first beta.
Comment #19
albertski commentedFYI once I apply this patch it breaks the core_views_facets module. I get the following error:
Comment #20
borisson_@albertski: Yeah, that's why it's an api break. Sorry about that but we since we're still in alpha we can break API's still and this is an improvement for all other code.
Comment #22
edurenye commentedRebased.
Comment #24
borisson_Those 2 fails are unrelated and fixed as a part of #2877989: Module depends on a search api service and it shouldn't
Comment #25
edurenye commentedThe test passes again.
Comment #26
edurenye commentedRebased again.
Comment #27
joachim commentedThis is just an eyeball review. Mostly nitpicks:
I'm not sure annotations like line breaks like that.
This looks like an unrelated change.
Should be 'Search API' for the module name.
'its' should have no apostrophe.
Name of a method should have a () after it.
Though I'm not sure implementation details should go on the interface -- I would move these to inline comments in the implementations.
Unrelated change.
Unrelated whitespace changes.
(Yes, I'm being a stickler for these, but when you're doing archaeology in the git log in six month's time to work out when and why something changed, it really helps if commits are as simple as possible!)
Comment #28
borisson_#27.3: I know that's an implementation detail, but it's also a great example to show what this method should do. Not sure if we should remove that. I prefer putting such docs in the interface, so we don't have to copy the rest of the docs to the implementation. (As inheritdoc and doc comments can't be mixed.)
The other points are all valid, so we should change those.
Comment #29
joachim commented> #27.3: I know that's an implementation detail, but it's also a great example to show what this method should do. Not sure if we should remove that.
Fair enough :)
Comment #30
borisson_I couldn't find the original changes for .4 and .5. Reroll attached.
Comment #31
borisson_Comment #33
borisson_Reroll because of removing core search.
Comment #35
borisson_This should fix the failing test.
Comment #36
strykaizerCan we move the getDataDefenition to the Facet instead of the Facet source?
I dont think there is any need in requesting the entire data definition at once (and if so, we can always add an extra method looping over all fields for this).
Working on this
Comment #37
strykaizerWIP, tests need to be fixed.
Comment #39
borisson_Comment #40
strykaizerComment #42
strykaizer