Skip to content

Conversation

carlosdelest
Copy link
Member

@carlosdelest carlosdelest commented Jan 21, 2025

Match is both a function and an operator. This caused some problems rendering docs as functions are not expected to be both.

This PR creates a new MatchOperator class that contains the updated FunctionInfo annotation for the operator, thus separating the Match function and the operator.

MatchOperatorTests have been modified so the new MatchOperator class is used to generate the docs.

LIKE and RLIKE operators are marked as such as well in this PR

@carlosdelest carlosdelest added >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) auto-backport Automatically create backport pull requests when merged :Analytics/ES|QL AKA ESQL ES|QL-ui Impacts ES|QL UI v9.0.0 v8.17.0 v8.18.0 labels Jan 21, 2025
Copy link
Contributor

Documentation preview:

@stratoula stratoula marked this pull request as ready for review January 21, 2025 09:18
@stratoula stratoula marked this pull request as draft January 21, 2025 09:18
@carlosdelest carlosdelest changed the title Match operator improved docs Match, Like and RLike operators improved docs Jan 21, 2025
@carlosdelest carlosdelest marked this pull request as ready for review January 21, 2025 16:22
@carlosdelest carlosdelest requested a review from a team January 21, 2025 16:22
@elasticsearchmachine elasticsearchmachine added the Team:Docs Meta label for docs team label Jan 21, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/kibana-esql (ES|QL-ui)

* Unlike other ESQL functions, Match is both a function and an operator. This class provides implementation for both,
* but the operator documentation is generated in {@link MatchOperator}.
*/
public class Match extends FullTextFunction implements PostOptimizationVerificationAware {
Copy link
Contributor

Choose a reason for hiding this comment

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

I do wonder if Match should be abstract, with a MatchFunction and MatchOperator subclasses? Which would make the distinction between them more obvious.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's something we didn't do back in the day, mostly because there were fewer differences. I think it makes sense now.

I implemented that separation in ed10886. @fang-xing-esql @ChrisHegarty , do you think it makes sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense to me.

Copy link
Member

@fang-xing-esql fang-xing-esql left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@carlosdelest carlosdelest merged commit f61f139 into elastic:main Jan 24, 2025
15 checks passed
carlosdelest added a commit to carlosdelest/elasticsearch that referenced this pull request Jan 24, 2025
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.17 Commit could not be cherrypicked due to conflicts
8.x

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 120504

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged backport pending >docs General docs changes ES|QL-ui Impacts ES|QL UI Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Docs Meta label for docs team v8.17.0 v8.18.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants