Skip to content

Add support for named parameters in string queries #2183

Closed
@diamondT

Description

@diamondT

hi,

it would be nice to have support for named parameters in @Query queries, similarly to e.g. spring-data-jpa:

@Query("{\"match\": {\"name\": {\"query\": \":name\"}}}")
Page<Book> findByName(String name,Pageable pageable);

instead of

@Query("{\"match\": {\"name\": {\"query\": \"?0\"}}}")
Page<Book> findByName(String name,Pageable pageable);

looking for patterns with : would be tricky because of the ES query syntax so we could make that behavior explicit instead; let the user define if a query is using positional or named parameters with a new flag.

created a WIP here: diamondT@cd3d2cc
if this is something worth pursuing i can polish a bit more and send a PR.

thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions