简体   繁体   中英

Running Lucene-based search on Grails application using MongoDB

Currently I am investigating in ways to implement a Lucene-based search on a Grails application using MongoDB.

Requirements include the following:

  • The data to index is stored in a MongoDB
  • Data only gets inserted (no updates, no deletions)
  • The application has to run on the CloudBees platform
  • The search should be implemented without any external services like Searchly or WebSolr

So far this does not seem to be very complicated as there are Grails plugins. However, the main problem I am facing is that my application uses dynamic MongoDB collections. So I do not have a domain class for each and every collection. Instead, the collections that should be indexed can have arbitrary names and schemas. As a result I cannot use Grails plugins like searchable as these seem to only work on fixed domain classes (or am I wrong about that?).

Does anybody have experience on how to implement a search in such a context? Any tips, links, hints, or recommendations?

You can use one index and multiple types for your dynamic MongoDB collections. However that logic should be coded by yourself since integration modules done within a mind set of domain model indexing.

For ElasticSearch you can use Jest via groovy for ElasticSearch https://github.com/searchbox-io/Jest

Searchly offers MongoDB integration out of the box unfortunately for a single collection. therefore for now you also need to query MongoDB(the collection you have created dynamically), index the data to index under new type and query it.

my old post is deleted due to not being related answer, well it is OK :)

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