java - Elasticsearch on Jhipster, Spring -


can give me example using elasticsearch in jhipster or in spring-boot?

i have generated entity using jhipster. there input placeholder :query !

/**      * search  /_search/samples/:query -> search sample corresponding      * query.      */     @requestmapping(value = "/_search/samples/{query}",         method = requestmethod.get,         produces = mediatype.application_json_value)     @timed     public list<sample> search(@pathvariable string query) {         return streamsupport             .stream(samplesearchrepository.search(querystring(query)).spliterator(), false)             .collect(collectors.tolist());     } 

how can use elasticsearch ?

here script found in generated entity!

i have tried placing object, q=field:value, array elastic format , got empty array.

sorry bad english!.

well, seems index empty. if add entities programmatically (i.e. not interface), sure save them in search repository well.

example :

sample sample = new sample(); sample.setname("bar"); sample = samplerepository.save(sample); samplesearchrepository.save(sample); 

you need reaffect sample id generated hibernate correctly indexed in elasticsearch.

update 10/02/2016

there jhipster module reindex elasticsearch repositories.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -