Skip to content

Conversation

@indykoning
Copy link
Member

Previously adding an attribute to result_attributes wouldn't mean it would actually get indexed, only that if it is indexed it can be used.
This change makes it so result_attributes will always be added to indexable values.

@indykoning indykoning requested a review from royduin as a code owner January 20, 2026 10:56
...$indexableAttributeCodes,
...$this->superAttributeCodes,
]);
...config('rapidez.searchkit.result_attributes'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we were to skip wildcards this would be the only addition.
Adding wildcards makes it feature-complete though

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to support wildcards? I can imagine maybe you only want specific attributes indexed, but you can then use the wildcard in your result attributes to get all of the ones you've indexed?

Imagine I'm a lazy developer and I just set the result_attributes to * so I can get all of my indexed data. I probably wouldn't expect that change to also then cause literally everything to get indexed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already using it, see:

as it's supported by Elasticsearch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My question is not whether it works (I know it works), my question is: do we actually want to actually directly cause a wildcard in the result_attributes to result in indexing (and thus exposing) a bunch of values we might not have wanted. To me this seems like an easy way to accidentally get unexpected data leakage.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check, yes we want wildcards. As already used for all super attributes which should always be exposed. Creating a new one just works after a reindex; no need for a developer.

@royduin
Copy link
Member

royduin commented Jan 23, 2026

Please check the tests 😇

@royduin royduin merged commit df4b48a into master Jan 23, 2026
15 checks passed
@royduin royduin deleted the feature/result_attributtes-searchable branch January 23, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants