Changeset 1452


Ignore:
Timestamp:
Jan 27, 2011, 6:37:15 PM (12 years ago)
Author:
work@…
Message:
  • changed gdt imports
  • added default searchable config
  • did some debuggin on #227 but issue is still there... also if searchable is enabled the project becomes really slow... perhaps we need to get rid of searchable and implement search fnctionality in another way?
Location:
trunk/grails-app
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/conf/Searchable.groovy

    r1450 r1452  
    11/**
    2  * This  {@link groovy.util.ConfigObject} script provides Grails Searchable Plugin configuration.
     2 * This {@link groovy.util.ConfigObject} script provides Grails Searchable Plugin configuration.
    33 *
    44 * You can use the "environments" section at the end of the file to define per-environment
     
    2525searchable {
    2626
    27         /**
    28          * The location of the Compass index
    29          *
    30          * Examples: "/home/app/compassindex", "ram://app-index" or null to use the default
    31          *
    32          * The default is "${user.home}/.grails/projects/${app.name}/searchable-index/${grails.env}"
    33          */
    34         compassConnection = "~/.grails/projects/${app.name}/searchable-index/${grails.env}"
     27    /**
     28     * The location of the Compass index
     29     *
     30     * Examples: "/home/app/compassindex", "ram://app-index" or null to use the default
     31     *
     32     * The default is "${user.home}/.grails/projects/${app.name}/searchable-index/${grails.env}"
     33     */
     34    compassConnection = new File(
     35        "${userHome}/.grails/projects/${appName}/searchable-index/${grailsEnv}"
     36    ).absolutePath
    3537
    36         /**
    37          * Any settings you wish to pass to Compass
    38          *
    39          * Use this to configure custom/override default analyzers, query parsers, eg
    40          *
    41          *     Map compassSettings = [
    42          *         'compass.engine.analyzer.german.type': 'German'
    43          *     ]
    44          *
    45          * gives you an analyzer called "german" you can then use in mappings and queries, like
    46          *
    47          *    class Book {*        static searchable = { content analyzer: 'german' }*        String content
    48          *}*
    49          *    Book.search("unter", analyzer: 'german')
    50          *
    51          * Documentation for Compass settings is here: http://www.compass-project.org/docs/2.1.0M2/reference/html/core-settings.html
    52          */
    53         compassSettings = [:]
     38    /**
     39     * Any settings you wish to pass to Compass
     40     *
     41     * Use this to configure custom/override default analyzers, query parsers, eg
     42     *
     43     *     Map compassSettings = [
     44     *         'compass.engine.analyzer.german.type': 'German'
     45     *     ]
     46     *
     47     * gives you an analyzer called "german" you can then use in mappings and queries, like
     48     *
     49     *    class Book {
     50     *        static searchable = { content analyzer: 'german' }
     51     *        String content
     52     *    }
     53     *
     54     *    Book.search("unter", analyzer: 'german')
     55     *
     56     * Documentation for Compass settings is here: http://www.compass-project.org/docs/2.1.0M2/reference/html/core-settings.html
     57     */
     58    compassSettings = [:]
    5459
    55         /**
    56         * Default mapping property exclusions
    57         *
    58         * No properties matching the given names will be mapped by default
    59         * ie, when using "searchable = true"
    60         *
    61         * This does not apply for classes using "searchable = [only/except: [...]]"
    62         * or mapping by closure
    63         */
    64         defaultExcludedProperties = ["password"]
     60    /**
     61    * Default mapping property exclusions
     62    *
     63    * No properties matching the given names will be mapped by default
     64    * ie, when using "searchable = true"
     65    *
     66    * This does not apply for classes using "searchable = [only/except: [...]]"
     67    * or mapping by closure
     68    */
     69    defaultExcludedProperties = ["password"]
    6570
    66         /**
    67         * Default property formats
    68         *
    69         * Value is a Map between Class and format string, eg
    70         *
    71         *     [(Date): "yyyy-MM-dd'T'HH:mm:ss"]
    72         *
    73         * Only applies to class properties mapped as "searchable properties", which are typically
    74         * simple class types that can be represented as Strings (rather than references
    75         * or components) AND only required if overriding the built-in format.
    76         */
    77         defaultFormats = [:]
     71    /**
     72    * Default property formats
     73    *
     74    * Value is a Map between Class and format string, eg
     75    *
     76    *     [(Date): "yyyy-MM-dd'T'HH:mm:ss"]
     77    *
     78    * Only applies to class properties mapped as "searchable properties", which are typically
     79    * simple class types that can be represented as Strings (rather than references
     80    * or components) AND only required if overriding the built-in format.
     81    */
     82    defaultFormats = [:]
    7883
    79         /**
    80         * Set default options for each SearchableService/Domain-class method, by method name.
    81         *
    82         * These can be overriden on a per-query basis by passing the method a Map of options
    83         * containing those you want to override.
    84         *
    85         * You may want to customise the options used by the search method, which are:
    86         *
    87          * @param reload whether to reload domain class instances from the DB: true|false
    88         *                        If true, the search  will be slower but objects will be associated
    89         *                        with the current Hibernate session
    90          * @param escape whether to escape special characters in string queries: true|false
    91          * @param offset the 0-based hit offset of the first page of results.
    92         *                        Normally you wouldn't change it from 0, it's only here because paging
    93         *                        works by using an offset + max combo for a specific page
    94          * @param max the page size, for paged search results
    95         * @param defaultOperator if the query does not otherwise indicate, then the default operator
    96         *                        applied: "or" or "and".
    97         *                        If "and" means all terms are required for a match, if "or" means
    98         *                        any term is required for a match
    99          * @param suggestQuery if true and search method is returning a search-result object
    100         *                        (rather than a domain class instance, list or count) then a
    101         *                        "suggestedQuery" property is also added to the search-result.
    102         *                        This can also be a Map of options as supported by the suggestQuery
    103         *                        method itself
    104         *
    105         * For the options supported by other methods, please see the documentation
    106         * http://grails.org/Searchable+Plugin
    107         */
    108         defaultMethodOptions = [
    109                 search: [reload: false, escape: false, offset: 0, max: 10, defaultOperator: "and"],
    110                 suggestQuery: [userFriendly: true]
    111         ]
     84    /**
     85    * Set default options for each SearchableService/Domain-class method, by method name.
     86    *
     87    * These can be overriden on a per-query basis by passing the method a Map of options
     88    * containing those you want to override.
     89    *
     90    * You may want to customise the options used by the search method, which are:
     91    *
     92     * @param reload          whether to reload domain class instances from the DB: true|false
     93    *                        If true, the search  will be slower but objects will be associated
     94    *                        with the current Hibernate session
     95     * @param escape          whether to escape special characters in string queries: true|false
     96     * @param offset          the 0-based hit offset of the first page of results.
     97    *                        Normally you wouldn't change it from 0, it's only here because paging
     98    *                        works by using an offset + max combo for a specific page
     99     * @param max            the page size, for paged search results
     100    * @param defaultOperator if the query does not otherwise indicate, then the default operator
     101    *                        applied: "or" or "and".
     102    *                        If "and" means all terms are required for a match, if "or" means
     103    *                        any term is required for a match
     104     * @param suggestQuery    if true and search method is returning a search-result object
     105    *                        (rather than a domain class instance, list or count) then a
     106    *                        "suggestedQuery" property is also added to the search-result.
     107    *                        This can also be a Map of options as supported by the suggestQuery
     108    *                        method itself
     109    *
     110    * For the options supported by other methods, please see the documentation
     111    * http://grails.org/Searchable+Plugin
     112    */
     113    defaultMethodOptions = [
     114        search: [reload: false, escape: false, offset: 0, max: 10, defaultOperator: "and"],
     115        suggestQuery: [userFriendly: true]
     116    ]
    112117
    113         /**
    114         * Should changes made through GORM/Hibernate be mirrored to the index
    115         * automatically (using Compass::GPS)?
    116         *
    117         * If false, you must manage the index manually using index/unindex/reindex
    118         */
    119         mirrorChanges = true
     118    /**
     119    * Should changes made through GORM/Hibernate be mirrored to the index
     120    * automatically (using Compass::GPS)?
     121    *
     122    * If false, you must manage the index manually using index/unindex/reindex
     123    */
     124    mirrorChanges = true
    120125
    121         /**
    122         * Should the database be indexed at startup (using Compass:GPS)?
    123         *
    124         * Possible values: true|false|"fork"
    125         *
    126         * The value may be a boolean true|false or a string "fork", which means true,
    127         * and fork a thread for it
    128         *
    129         * If you use BootStrap.groovy to insert your data then you should use "true",
    130         * which means do a non-forking, otherwise "fork" is recommended
    131         */
    132         bulkIndexOnStartup=true
     126    /**
     127    * Should the database be indexed at startup (using Compass:GPS)?
     128    *
     129    * Possible values: true|false|"fork"
     130    *
     131    * The value may be a boolean true|false or a string "fork", which means true,
     132    * and fork a thread for it
     133    *
     134    * If you use BootStrap.groovy to insert your data then you should use "true",
     135    * which means do a non-forking, otherwise "fork" is recommended
     136    */
     137    bulkIndexOnStartup = false
    133138
    134         /**
    135         * Should index locks be removed (if present) at startup?
    136         */
    137         releaseLocksOnStartup = true
     139    /**
     140    * Should index locks be removed (if present) at startup?
     141    */
     142    releaseLocksOnStartup = true
    138143}
  • trunk/grails-app/domain/dbnp/importer/ImportCell.groovy

    r1430 r1452  
    11package dbnp.importer
     2import nl.grails.plugins.gdt.*
    23
    34/**
     
    1617 */
    1718
    18 class ImportCell extends nl.grails.plugins.gdt.Identity implements Serializable {
     19class ImportCell extends Identity {
    1920    MappingColumn mappingcolumn
    2021    int entityidentifier
  • trunk/grails-app/domain/dbnp/importer/ImportRecord.groovy

    r1430 r1452  
    1414 */
    1515package dbnp.importer
     16import nl.grails.plugins.gdt.*
    1617
    17 class ImportRecord extends nl.grails.plugins.gdt.Identity implements Serializable {
     18class ImportRecord extends Identity {
    1819    static hasMany = [ importcells: ImportCell ]
    1920   
  • trunk/grails-app/domain/dbnp/studycapturing/Assay.groovy

    r1440 r1452  
    88 * this data can be found.
    99 */
    10 class Assay extends nl.grails.plugins.gdt.TemplateEntity {
     10class Assay extends TemplateEntity {
    1111        // The name of the assay, which should indicate the measurements represented in this assay to the user.
    1212        String name
  • trunk/grails-app/domain/dbnp/studycapturing/Event.groovy

    r1430 r1452  
    1313 * $Date$
    1414 */
    15 class Event extends nl.grails.plugins.gdt.TemplateEntity {
     15class Event extends TemplateEntity {
    1616
    1717        // uncommented due to searchable issue
    1818        // @see http://jira.codehaus.org/browse/GRAILSPLUGINS-1577
    1919        // Enabling this causes the error: Trying to marshall a null id [id] for alias [Event] in the study create wizard when you add events
    20         // static searchable = true
     20        //static searchable = true
    2121
    2222        static belongsTo = [parent : Study]     
  • trunk/grails-app/domain/dbnp/studycapturing/EventGroup.groovy

    r1430 r1452  
    11package dbnp.studycapturing
     2import nl.grails.plugins.gdt.*
    23
    34/**
     
    910 * $Date$
    1011 */
    11 class EventGroup extends nl.grails.plugins.gdt.Identity {
     12class EventGroup extends Identity {
    1213        String name
    1314
  • trunk/grails-app/domain/dbnp/studycapturing/Person.groovy

    r1430 r1452  
    11package dbnp.studycapturing
     2import nl.grails.plugins.gdt.*
    23
    34/**
     
    1112 * $Date$
    1213 */
    13 class Person extends nl.grails.plugins.gdt.Identity {
     14class Person extends Identity {
    1415        String title
    1516        String gender
  • trunk/grails-app/domain/dbnp/studycapturing/PersonAffiliation.groovy

    r1430 r1452  
    11package dbnp.studycapturing
     2import nl.grails.plugins.gdt.*
    23
    34/**
     
    1011 * $Date$
    1112 */
    12 class PersonAffiliation extends nl.grails.plugins.gdt.Identity {
     13class PersonAffiliation extends Identity {
    1314
    1415        String institute
  • trunk/grails-app/domain/dbnp/studycapturing/PersonRole.groovy

    r1430 r1452  
    11package dbnp.studycapturing
     2import nl.grails.plugins.gdt.*
    23
    34/**
     
    1112 * $Date$
    1213 */
    13 class PersonRole extends nl.grails.plugins.gdt.Identity {
     14class PersonRole extends Identity {
    1415
    1516        /** The name of the role, such as Project Leader or PI */
  • trunk/grails-app/domain/dbnp/studycapturing/Publication.groovy

    r1430 r1452  
    11package dbnp.studycapturing
     2import nl.grails.plugins.gdt.*
    23
    34/**
     
    1213 * $Date$
    1314 */
    14 class Publication extends nl.grails.plugins.gdt.Identity {
     15class Publication extends Identity {
    1516        String title
    1617        String pubMedID
  • trunk/grails-app/domain/dbnp/studycapturing/Sample.groovy

    r1440 r1452  
    1212 * $Date$
    1313 */
    14 class Sample extends nl.grails.plugins.gdt.TemplateEntity {
     14class Sample extends TemplateEntity {
    1515        // uncommented due to searchable issue
    1616        // @see http://jira.codehaus.org/browse/GRAILSPLUGINS-1577
  • trunk/grails-app/domain/dbnp/studycapturing/SamplingEvent.groovy

    r1430 r1452  
    1414 * $Date$
    1515 */
    16 class SamplingEvent extends nl.grails.plugins.gdt.TemplateEntity {
     16class SamplingEvent extends TemplateEntity {
    1717        // A SamplingEvent always belongs to one study.
    1818        // Although this is technically inherited from Event, we have to specify it here again.
  • trunk/grails-app/domain/dbnp/studycapturing/Study.groovy

    r1446 r1452  
    1414 * $Date$
    1515 */
    16 class Study extends nl.grails.plugins.gdt.TemplateEntity {
     16class Study extends TemplateEntity {
    1717        static searchable = true
    1818       
  • trunk/grails-app/domain/dbnp/studycapturing/StudyPerson.groovy

    r1430 r1452  
    11package dbnp.studycapturing
     2import nl.grails.plugins.gdt.*
    23
    34/**
     
    910 * $Date$
    1011 */
    11 class StudyPerson extends nl.grails.plugins.gdt.Identity {
     12class StudyPerson extends Identity {
    1213
    1314        // A StudyPerson relation always belongs to one study.
  • trunk/grails-app/domain/dbnp/studycapturing/Subject.groovy

    r1430 r1452  
    1111 * $Date$
    1212 */
    13 class Subject extends nl.grails.plugins.gdt.TemplateEntity {
     13class Subject extends TemplateEntity {
    1414        // uncommented due to searchable issue
    1515        // @see http://jira.codehaus.org/browse/GRAILSPLUGINS-1577
Note: See TracChangeset for help on using the changeset viewer.