source: trunk/grails-app/controllers/dbnp/query/QueryController.groovy @ 1430

Last change on this file since 1430 was 1430, checked in by work@…, 10 years ago
  • set keyword expansion
  • Property svn:keywords set to Rev Author Date
File size: 1.4 KB
Line 
1package dbnp.query
2
3import org.compass.core.engine.SearchEngineQueryParseException
4import java.io.PrintWriter;
5import java.io.StringWriter;
6
7
8/*
9 * Copyright 2007 the original author or authors.
10 *
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
14 *
15 *      http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
22 */
23
24
25/**
26 * Basic web interface for Grails Searchable Plugin
27 *
28 * @author Adem and Jahn
29 */
30class QueryController {
31
32    def searchableService
33
34    def index = {
35        render( view:'index' )
36    }
37
38
39    def success = {
40            try {
41                println params
42                render searchableService.search(params['bla'])
43            } catch( SearchEngineQueryParseException e) { println "SEQPE: " + e.printStackTrace }
44            catch( Exception ex) { 
45                                StringWriter sw = new StringWriter();
46                                ex.printStackTrace(new PrintWriter(sw));
47                                String stacktrace = sw.toString();
48                                System.out.println("stacktrace = " + stacktrace);
49                        }
50            render "test" 
51    }
52
53}
Note: See TracBrowser for help on using the repository browser.