analyzer - how to analyze text in elasticsearch using java api? -


i use elasticsearch 1.7.4 , java api.currently, want count top 10 high frequency searching words user. have record words of query text user type search, , before recording words have analyze query text. find restful way analyze text link says, can't find api in transportclient.

do know how analyze text in elasticsearch using java api or other way rather requesting restful api?

thanks might ideas, tips, resources, etc.

using example documentation (where text "this test" being analyzed using standard analyzer), here example of how 1 might accomplish same analysis using java api:

transportclient client = new transportclient(); analyzerequest request = (new analyzerequest("this test")).analyzer("standard"); list<analyzeresponse.analyzetoken> tokens = client.admin().indices().analyze(request).actionget().gettokens(); (analyzeresponse.analyzetoken token : tokens) {     // each token... } 

hope helps!


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -