Giter VIP home page Giter VIP logo

grails-quick-search's Introduction

grails-quick-search

Grails plugin for quick search implementation. Supports search for domain class properties and adds utility functions and tag libraries for autocomplete functionality.

Version 0.7.x of this plugin has been upgraded to Grails 3.1.x.

See documentation for further information.

grails-quick-search's People

Contributors

kuceram avatar macrosak avatar dfrommi avatar zacharyklein avatar burtbeckwith avatar arunan-interlink avatar acrive82 avatar menilub avatar olivierkamers avatar

Stargazers

koji avatar Robert Felker avatar Evert Eti avatar  avatar  avatar

Watchers

 avatar Simon Dittlmann avatar José Leal Domingues Neto avatar  avatar  avatar James Cloos avatar Florian Hertnagel avatar Friedrich Mäckle avatar koji avatar  avatar Richard George avatar  avatar

grails-quick-search's Issues

No examples in the doc?

Hi,

unfortunatly this probably great plugin has a very light documentation. An example how to use it would a lot more people try it out. Please consider to post an example of usage.

Best regards
-Bio

Sort on multiple fields

Is it possible to sort on multiple fields (firstName and lastName) so that "aa bb" comes before "aa cc" ?

Thanks a lot!

Allow for more complex searches

If I have a model with a User object like this:

class User {
    String firstName
    String lastName
}

and I want to be able to search for users called John Smith (firstName=John lastName=Smith), it would be cool if I could express that query using quick search. At the moment if I search for the string - John Smith, I retrieve all users with John in any field and all users with Smith in any field. I think in a lot of real world scenarios (especially those with complex models and large data sets), it quickly becomes hard to find what you're looking for.

Perhaps a good way to do it would be to assume that for any search term in quotes (e.g. "John Smith"), the tokens should be 'anded' together rather than 'ored'.

Can not specify just a sort column on H2

Specifying a sort column without it in the distinct columns causes H2 to fail as it will not sort on a column not in the results.

Setting the sort column as a distinct column in the query would be wrong as that would return the list of distinct values rather than the sorted domain objects.

Example app

Would be really great to have a small example app

Total results count is incorrect

The totalCount property in QuickSearchService is incorrect - it is the total number of results with duplicates, whereas the results returned in the pagedResults collection has been filtered for duplicates.

This means that pagination is broken (the totalResults count is higher than the actual number of results returned).

CustomCriteria issue

Hi

I see that customCriteria closure doesn't work. Inspecting the code I found that key of settings map is wrong: customClosure instead customCriteria.

customCriteria closure has no aliases

If I try to use the customCriteria:

def customCriteria = { println it }

It prints an empty list: []

Is this a bug or am I using it wrong?

All code:

def searchParams = [sort: 'firstName', order: 'asc', max: MAX_SEARCH_RESULT, offset: offset * MAX_SEARCH_RESULT]
def searchProperties = [firstName: "firstName", lastName: "lastName"]
def customCriteria = { println it }
PagedResultList userList = (PagedResultList) quickSearchService.search(domainClass: User, searchParams: searchParams, searchProperties: searchProperties, query: query, customCriteria: customCriteria)

In a debugging attempt we found that the code is always going into this if: https://github.com/tadodotcom/grails-quick-search/blob/master/grails-app/services/org/grails/plugins/quickSearch/QuickSearchService.groovy#L186

Thanks for your help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.