source: gs3-extensions/solr/trunk/src/conf/velocity/head.vm@ 24500

Last change on this file since 24500 was 24446, checked in by davidb, 13 years ago

Start of Solr extension for Greenstone3

File size: 2.0 KB
Line 
1
2 ## An example of using an arbitrary request parameter
3 <!--
4 Licensed to the Apache Software Foundation (ASF) under one or more
5 contributor license agreements. See the NOTICE file distributed with
6 this work for additional information regarding copyright ownership.
7 The ASF licenses this file to You under the Apache License, Version 2.0
8 (the "License"); you may not use this file except in compliance with
9 the License. You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 -->
19
20<title>#param('title')</title>
21 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
22
23<script type="text/javascript" src="#{url_for_solr}/admin/jquery-1.4.3.min.js"></script>
24 <link rel="stylesheet" type="text/css" href="#{url_for_solr}/admin/file?file=/velocity/main.css&contentType=text/css"/>
25 <link rel="stylesheet" href="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.css&contentType=text/css" type="text/css" />
26 <script type="text/javascript" src="#{url_for_solr}/admin/file?file=/velocity/jquery.autocomplete.js&contentType=text/javascript"></script>
27
28
29 <script>
30 $(document).ready(function(){
31 $("\#q").autocomplete('#{url_for_solr}/terms', { ## backslash escaped #q as that is a macro defined in VM_global_library.vm
32 extraParams:{
33 'terms.prefix': function() { return $("\#q").val();},
34 'terms.sort': 'count',
35 'terms.fl': 'name',
36 'wt': 'velocity',
37 'v.template': 'suggest'
38 }
39 }
40 );
41
42 // http://localhost:8983/solr/terms?terms.fl=name&terms.prefix=i&terms.sort=count
43 });
44
45 </script>
Note: See TracBrowser for help on using the repository browser.