Hylke Witjens
2008-Oct-21 14:21 UTC
[Xapian-discuss] problem with empty field in omegascript 1.0.7
Hi list, I'm currently busy trying to get our article database in omega for which I use the following omegascript: example="$highlight{$htmlstrip{$if{$field{lead},$field{text}, $field{lead}}},$terms,<span class="highlight">}" My scriptindex script looks like this: leadtekst : unhtml index=XL weight=2 index field=lead text : unhtml index truncate=500 field=text What I'm trying is: if lead is empty, I want to see an excerpt of the field text because the lead isn't always filled but text is. But for some reason I only get example filled when I have a lead. So I must be doing something wrong, but me and my college Arjen van der Meijden can't seem to find what, maybe you can help us? Thank! Greetings, Hylke Witjens Tweakers.net
Olly Betts
2008-Oct-21 21:03 UTC
[Xapian-discuss] problem with empty field in omegascript 1.0.7
On Tue, Oct 21, 2008 at 04:21:03PM +0200, Hylke Witjens wrote:> $if{$field{lead},$field{text},$field{lead}}}This is backwards - if field "lead" contains something, it expands to field "text"; otherwise it expands to the empty field "lead"! Cheers, Olly
Hylke Witjens
2008-Oct-22 06:55 UTC
[Xapian-discuss] problem with empty field in omegascript 1.0.7
On Tue, 2008-10-21 at 22:03 +0100, Olly Betts wrote:> On Tue, Oct 21, 2008 at 04:21:03PM +0200, Hylke Witjens wrote:Hi,> > $if{$field{lead},$field{text},$field{lead}}} > > This is backwards - if field "lead" contains something, it expands to > field "text"; otherwise it expands to the empty field "lead"!It works! Thanks :) Greetings, Hylke Witjens