Skip to content

Conversation

colings86
Copy link
Contributor

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

Relates to #10217

PR goes against the query-refactoring branch

@@ -42,6 +43,8 @@

/** Default for boost to apply to resulting Lucene query. Defaults to 1.0*/
public static final float DEFAULT_BOOST = 1.0f;
public static final ParseField NAME_FIELD = new ParseField("_name");
public static final ParseField BOOST_FIELD = new ParseField("boost");
Copy link
Member

Choose a reason for hiding this comment

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

I think we have to decide whether ParseFields should be in query builders or query parsers. Good to share these two though given that they are always the same. They should indeed be in some base class.

@javanna
Copy link
Member

javanna commented Sep 8, 2015

left a few minor comments, looks good

@colings86
Copy link
Contributor Author

@javanna I pushed a commit which addresses your comments

private String geohash;
private int levels = -1;
private Integer levels = null;
private boolean neighbors;
Copy link
Member

Choose a reason for hiding this comment

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

don't we have sensible defaults for levels and neighbors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add a default of false for neighbors but null is actually the sensible default for levels as it means 'do not truncate the given geohash'. The levels parameter is only there to truncate the precision of the given geohash if required

Copy link
Member

Choose a reason for hiding this comment

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

sounds good, thanks

@javanna
Copy link
Member

javanna commented Sep 9, 2015

left one tiny comment around default values in the builder, LGTM besides that

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

Relates to #10217

PR goes against the query-refactoring branch
@colings86 colings86 merged commit 4f0ae05 into elastic:feature/query-refactoring Sep 9, 2015
@colings86 colings86 deleted the refactor/geohash-cell-query branch September 9, 2015 12:34
@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
: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