I'm using omega for a sitesearch and currently having a problem trying
to filter $field(sample). At the moment it returns text from the page
header and navigation within the sample, ideally I'd like it to return
only the page content. I've been trying various omegascript commands to
trim the output or seperate the fields and also looking at scriptindex
to control how the xhtml is parsed.
I'm still new to omega so I'd be grateful for any input on the proper
method to use.
---omindex command
~/omega/bin/omindex --db ~/omega/data/default --mime-type
xhtml:text/html --url / ~/site
---index.xhtml
<form method="get"
action="http://localhost/cgi-bin/omega.cgi">
<div id="search">
<input type="hidden" name="DB"
value="default" />
<input type="hidden" name="DEFAULTOP"
value="AND" />
<input type="text" name="P" value=""
/>
</div>
</form>
---query
<p>Searched $nice{$dbsize} document in $time seconds, $msize match
found.</p>
$hitlist{}
<p>
<a
href="$field{url}">$html{$or{$field{caption},$field{url}}}</a>
</p>
<div id="fieldsample">
<p>$field{sample}</p>
</div>
---output
> Searched 1 document in 0.000277 seconds, 1 match found.
Lashni: Home
lashni ~/ About Projects Stories Linux Links Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Sed malesuada porttitor nunc. Vestibulum
leo erat, pretium id, ornare sed, malesuada sodales, pede. Sed laoreet
eleifend augue. Fusce malesuada. Pellentesque habitant morbi tristique
senectus e ...