#%env/templates/metas.template%# #%env/templates/header.template%# #%env/templates/submenuPortalIntegration.template%#

Integration of Live Search with YaCy Search Widget

A 'Live-Search' input field that reacts as search-as-you-type in a pop-up window can easily be integrated in any web page. This is the same function as can be seen on all pages of the YaCy online-interface (look at the window in the upper right corner).

There are basically two methods for integrating the YaCy Search Widget with your web site.

  1. Static hosting of widget on own HTTP server
  2. Remote access through selected YaCy Peer

Static hosting of widget on own HTTP server

Advantages: Disadvantages: Installing:

Remote access through selected YaCy Peer

Advantages: Disadvantages: Installing:
<script src="http://#[ip]#:#[port]#/jquery/js/jquery-1.7.min.js" type="text/javascript" type="text/javascript"></script>
<script>			
	$(document).ready(function() {
		yconf = {
			url      : 'http://#[ip]#:#[port]#',
			title    : 'YaCy Search Widget',
			logo     : '/yacy/ui/img/yacy-logo.png',
			link     : 'http://www.yacy.net',
			global   : false,
			width    : 500,
			height   : 600,
			position : ['top',30],
			theme    : 'start'
		};
		$.getScript(yconf.url+'/portalsearch/yacy-portalsearch.js', function(){});
	});
</script>
<div id="yacylivesearch">
	<form id="ysearch" method="get" accept-charset="UTF-8" action="http://#[ip]#:#[port]#/yacysearch.html">
		Live Search <input name="query" id="yquery" class="fancy" type="text" size="15" maxlength="80" value=""/>
		<input type="hidden" name="verify" value="cacheonly" />
		<input type="hidden" name="maximumRecords" value="20" />
		<input type="hidden" name="resource" value="local" />
		<input type="hidden" name="urlmaskfilter" value=".*" />
		<input type="hidden" name="prefermaskfilter" value="" />
		<input type="hidden" name="display" value="2" />
		<input type="hidden" name="nav" value="all" />
		<input type="submit" name="Enter" value="Search" />
	</form>
</div>

Configuration options and defaults for 'yconf':

Defaults
url
http://localhost:8090
global
false
theme
'start'
title
'YaCy Search Widget'
logo
'/yacy/ui/img/yacy-logo.png'
link
'http://www.yacy.net'
width
640
height
640
position
[150,50]
modal
false
resizable
true
show
''
hide
''
load_js
true
load_css
true
Size and position (width | height | position)
Specifies where the dialog should be displayed. Possible values for position: 'center', 'left', 'right', 'top', 'bottom', or an array containing a coordinate pair (in pixel offset from top left of viewport) or the possible string values (e.g. ['right','top'] for top right corner).
Animation effects (show | hide)
The effect to be used. Possible values: 'blind', 'clip', 'drop', 'explode', 'fold', 'puff', 'slide', 'scale', 'size', 'pulsate'.
Interaction (modal | resizable)
If modal is set to true, the dialog will have modal behavior; other items on the page will be disabled (i.e. cannot be interacted with). Modal dialogs create an overlay below the dialog but above other page elements.

If resizable is set to true, the dialog will be resizeable.

Load JavaScript load_js (true | false)

This parameter is used for static hosting only.

Load Stylesheets load_css (true | false)

This parameter is used for static hosting only.

Themes

You can download standard jquery-ui themes or create your own custom themes on http://jqueryui.com/
Themes are installed in ./yacy/jquery/themes/ (static hosting) or in DATA/HTDOCS/jquery/themes/ on remote YaCy Peer. YaCy ships with 'start' and 'smoothness' themes pre-installed.

#%env/templates/footer.template%#