Grails-Plugin-Consortium / grails-filterpane

Filterpane plugin for grails.
Apache License 2.0
16 stars 44 forks source link

Improvement: Possibility to use full-text-search features of mongodb or mysql #48

Open PatrickHuetter opened 10 years ago

PatrickHuetter commented 10 years ago

Querying strings in mongodb can be slow on large datasets. If you create a text-index on the field you want to query and use the "text"-operator to query your dataset, it's extremly fast. I improved some queries from 30 seconds to under 1 second until response.

Example Query wich takes 0,095 seconds (same Query without using the text index takes 30 seconds on our database):

db.person.find({ $and: [{$text: { $search: "freddy" }}, {termCount: {$gte: 3}}] })

It seems that there is no fulltextsearch-operator in mongodb-gorm now: https://jira.grails.org/browse/GPMONGODB-396

I hope it will be build soon or i'll look for it. It would be fine if filterpane could build a flag controlled feature on that, so that users who have a text-index, can make use of the fast query option. (Maybe filterpane could get the information from the domain class, where the text-index is defined).

Similar features are also available in the mysql-environment.