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

Query refactoring: SpanNearQueryBuilder and Parser #12156

Conversation

cbuescher
Copy link
Member

Moving the query building functionality from the parser to the builders
new toQuery() method analogous to other recent query refactorings.

Relates to #10217

This PR is agains the query refactoring branch.

public class SpanNearQueryBuilder extends AbstractQueryBuilder<SpanNearQueryBuilder> implements SpanQueryBuilder<SpanNearQueryBuilder> {

public static final String NAME = "span_near";

private ArrayList<SpanQueryBuilder> clauses = new ArrayList<>();
static boolean DEFAULT_IN_ORDER = true;
static boolean DEFAULT_COLLECT_PAYLOADS = true;
Copy link
Member

Choose a reason for hiding this comment

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

shouldnt these constant be public?

Copy link
Member Author

Choose a reason for hiding this comment

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

Can do. btw. collectPayloads was lacking any documentation, also deep down in lucene land. Any idea where else to look, since when I make this public I'd like to have javadocs with it.

Copy link
Member

Choose a reason for hiding this comment

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

you mean that our public getter for it has no javadocs either? :) you can have a look at NearSpansPayloadOrdered in lucene but you won't find much more javadocs, we can simply state that the flag controls whether we collect payloads or not :)

@javanna
Copy link
Member

javanna commented Jul 9, 2015

looks good left a few minor comments

@cbuescher
Copy link
Member Author

@javanna left a few comments regarding your questions.

@cbuescher cbuescher force-pushed the feature/query-refactoring-spannear branch from 7a19916 to c9dbd7a Compare July 9, 2015 15:00
@cbuescher
Copy link
Member Author

@javanna Added the comments and made default settings for flags public.

/** Default for flag controlling whether matches are required to be in-order */
public static boolean DEFAULT_IN_ORDER = true;

/** Default for flag controlling whether payload is collected */
Copy link
Member

Choose a reason for hiding this comment

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

s/payload is/payloads are

@javanna
Copy link
Member

javanna commented Jul 9, 2015

LGTM besides the minor comment I left

@cbuescher cbuescher force-pushed the feature/query-refactoring-spannear branch from c9dbd7a to 7efca09 Compare July 9, 2015 15:14
Moving the query building functionality from the parser to the builders
new toQuery() method analogous to other recent query refactorings.

Relates to elastic#10217
@cbuescher cbuescher force-pushed the feature/query-refactoring-spannear branch from 7efca09 to c689e89 Compare July 9, 2015 15:35
cbuescher added a commit that referenced this pull request Jul 9, 2015
…annear

Query refactoring: SpanNearQueryBuilder and Parser
@cbuescher cbuescher merged commit 76e9a17 into elastic:feature/query-refactoring Jul 9, 2015
mute pushed a commit to mute/elasticsearch that referenced this pull request Jul 29, 2015
…ring-spannear

Query refactoring: SpanNearQueryBuilder and Parser
@javanna
Copy link
Member

javanna commented Aug 28, 2015

This change is breaking for the java api as it removes setter for mandatory slop parameter which needs to be set in the constructor instead.

@cbuescher cbuescher deleted the feature/query-refactoring-spannear branch March 11, 2016 11:51
@clintongormley clintongormley added :Search/Search Search-related issues that do not fall into other categories and removed :Query Refactoring labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Search/Search Search-related issues that do not fall into other categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants