-
-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Re)-inroduce userland control of includeSubclasses #162
Comments
In the meantime I have simply made it an exclusion which seems to work OK, but feels a little bit like a workaround:
Then in
|
Do I understand the feature request correctly if I say:
Or
This could be more easily solved at indexing time than at query time, e.g. the latter. Thoughts @marczhermo ? |
As you say @Firesphere - there's no point indexing and storing data that I know my project won't use. Sure, I can exclude subclasses at runtime, but then why is my indedx full up with stuff I'm never going to use. So sure: Some way of declaring in YML config that I want to use baseClass X, but not its subclasses. |
So... Option 2? |
@marczhermo I'm thinking to index everything, including subclasses, but at query time, apply the filter at query time. But, explicitly ignored classes, in this case, subclasses that are excluded from the index, if possible, don't index them, but index them if it's an easier approach. It would make the implementation a lot easier and flexible. Thoughts? TL;DR: Index if it is easier, exclude at query time where possible. |
Instead of using the Although I understand @phptek his argument, I feel it's better to require explicit exclusion. A global application might have unwanted side effects. That gives a finer level of control, I think. This is a next-release issue though, to me. The "workaround" posted above is an easier implementation right now. And we can document that. |
Hi @Firesphere,
If that is the case I have no strong opinion against it because it might be a little bit of rewiring in order to connect the configuration to existing method. A PR is welcome here :) Also agree about a somewhat a global variable might have unwanted side effects. However, if this is properly documented and with an example edge case below in excluding child classes as a whole: We also have @Firesphere Does having a data extension for |
@marczhermo No, because the check for ShowInSearch is on the database field, not a method... I just looked at the old module, and it has a todo (probably from about 20 years ago), to remove the feature |
I gave this a thought and I honestly feel, it should be dealt with within the search query excludes and not as part of the indexing. For multiple reasons:
|
I'm re-opening this issue, because I do feel it has added value as a submodule. My thoughts for the submodule:
This would mean an extension to both BaseQuery and BaseIndex to actively exclude things, but it would make things easier for the developers. |
@marczhermo Thoughs? ^^ Pushed to the NtH pipeline, low priority, as the workaround does it's job for now |
Is your feature request related to a problem? Please describe.
As the title says, I would like to have control over whether or not the module uses, or not, all subclasses of a base class.
The old FTS module allowed classes to be passed directly into a
SearchQuery
instance as an array, with a child value of'includeSubclasses' => true|false,
.Describe the solution you'd like
Something like this (using valid YML!)
The underlying issues (AFAICT) is that
CoreServiceTrait::getClassesInHierarchy()
bakes-in the 2nd param toFieldResolver::getHierarchy($class, true)
making it alwaystrue
.[UPDATE] I set this to false and images were still indexed.
Describe alternatives you've considered
In PageController.php::results():
...but with the above option, I never liked it TBH. Could never tell whether it was overriding what you had built in your
SolrIndex
subclass defs...or notThe text was updated successfully, but these errors were encountered: