Reputation: 197
I use the Searchable plugin with Grails I have the need to change the directory to which Compass points to, depending upon a UI choice by the user.
Normally, this value is set in the compassConnection variable of the searchable map in grails-app/conf/Searchable.groovy, like so, and gets called at app startup time:
searchable { compassConnection = new File( "/path/to/index/file/directory" ).absolutePath
...
}
To do what I need to do, I think that I need to get a handle into the compass config variable and then call config.setConnection("/new/path/to/index/dir")
Really appreciate any help that I can get,
Shailen
Upvotes: 0
Views: 604
Reputation: 5147
Well, sorry I was not careful reading your question. I guess this class must be your starting point: http://www.compass-project.org/docs/2.2.0/api/
Upvotes: 0
Reputation: 5147
In Searchable.groovy
file, within searchable { }
closure use this:
compassConnection = new File(
"${userHome}/.grails/projects/${appName}/searchable-index/${grailsEnv}").absolutePath
Upvotes: 0