简体   繁体   中英

how to execute mongosearch query on elasticsearch in java?

I am working on elasticsearch.

The thing is the method I am implementing takes in a mongosearch query but I need to execute it on elasticsearch.

so far the mongosearch query will contain the criterias based on which i need to look.

is there any way to execute a mongosearch query on es? or some way to change it to es query?

Elasticsearch comes with its own DSL(Domain specific language), Hence MongoDB query will not work on the Elasticsearch, Although as Elasticsearch is built on top of Lucene, So for its query string it supports Lucene syntax. You can write your own converter to convert the mongoDB, although there are few failed attempts here and here ..

If you like to use the advanced queries of Elasticsearch than writing your converter for those queries might be challanging.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM