Skip to content
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

Aggregation with $text match() is not possible on documents with discriminator map set #2455

Open
mposchl opened this issue Aug 25, 2022 · 1 comment
Labels
Hacktoberfest Good issue for participating in Hacktoberfest

Comments

@mposchl
Copy link

mposchl commented Aug 25, 2022

I wonder why it is not possible to match text index in documents, that have discriminator map set. ODM always prepends this discriminator map (via the filters) to the query and when you add a match stage in the pipeline, it always fails within the getAggregation() call as the $text stage has to be the first pipeline. Is this by design, is there some workaround or is it a bug?

@malarzm
Copy link
Member

malarzm commented Aug 25, 2022

From the top of my head it could have been done by an accident: we needed to add filter for the discriminator map and nobody thought about $text restrictions. As a proof of concept you could try forcing automatic discriminator-map-filter to be put as a second stage if $text was used (and only then). Using such approach we will not break any working functionality. If it works then cool, if not we can work from there. :)

@malarzm malarzm added the Hacktoberfest Good issue for participating in Hacktoberfest label Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Good issue for participating in Hacktoberfest
Projects
None yet
Development

No branches or pull requests

2 participants