Skip to content

Request to change name of WrapperQueryBuilder (org.elasticsearch.index.query) #11591

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

Closed
MattFriedmanAfilias opened this issue Jun 10, 2015 · 3 comments
Assignees
Labels
:Core/Infra/Transport API Transport client API >docs General docs changes help wanted adoptme

Comments

@MattFriedmanAfilias
Copy link

I spent a considerable time today looking for a query builder that would accept a JSON string query (as per the REST API).

I wonder if the term JSON could be incorporated into the name i.e. JsonWrapperQueryBuilder?

Not a big deal but it wasn't obvious to me despite numerous Google searches and lots of hunting, forum posts etc...

Thanks.

@javanna
Copy link
Member

javanna commented Jun 11, 2015

I agree that the name is not the best... not sure I would associate it with json specifically though, given that it allows to wrap binary content in general, which could be json, yaml or smile. Maybe XContentQueryBuilder or something along those lines?

@MattFriedmanAfilias
Copy link
Author

Thanks for this. One idea is to create alias methods in QueryBuilders such as (or something like)

QueryBuilders.jsonWrapperQuery(String)
QueryBuilders.jsonWrapperQuery(bytes)
QueryBuilders.yamlWrapperQuery(String)
QueryBuilders.yamlWrapperQuery(bytes)

etc...

These methods would simply forward the input to the target method: wrapperQuery() so they would only exist for clarity.

If you can tolerate these extra convenience methods it might make it easier for someone to locate the method they need.

Or maybe there's a cleaner way someone will think of. Or maybe it is just a documentation thing; I found it hard to locate the method I needed.

Thanks very much,
Matt

@clintongormley
Copy link
Contributor

XContentQueryBuilder is probably no more meaningful than WrapperQuery. The aliases imply that eg they would convert JSON or YAML into the right format for including in a query, where really this method just injects the raw string...

Probably the best solution is to just document the query builder here: https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/query-dsl-queries.html

@clintongormley clintongormley added >docs General docs changes help wanted adoptme :Core/Infra/Transport API Transport client API and removed discuss labels Jun 12, 2015
@palecur palecur self-assigned this Dec 2, 2015
@clintongormley clintongormley assigned debadair and unassigned palecur Jan 15, 2016
martijnvg added a commit to martijnvg/elasticsearch that referenced this issue Mar 14, 2018
martijnvg added a commit that referenced this issue Mar 14, 2018
martijnvg added a commit that referenced this issue Mar 14, 2018
martijnvg added a commit that referenced this issue Mar 14, 2018
martijnvg added a commit that referenced this issue Mar 14, 2018
martijnvg added a commit that referenced this issue Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Transport API Transport client API >docs General docs changes help wanted adoptme
Projects
None yet
Development

No branches or pull requests

5 participants