Grails/Compass question - How can I change the compqass Connection to point to a different directory

Posted by ombud on Stack Overflow See other posts from Stack Overflow or by ombud
Published on 2009-08-25T19:39:31Z Indexed on 2010/04/10 11:13 UTC
Read the original article Hit count: 405

Filed under:
|
|
|

Hi,

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")

  1. I don't know how I can get a reference to the config compass variable
  2. Am I right in assuming that I need to call setConnection(String) only, or is(are) there any other step(s) I need to take?

Really appreciate any help that I can get,

Shailen

© Stack Overflow or respective owner

Related posts about grails

Related posts about compass