Hi Christian,
thank you very much for your helpful answers, I will split my answer:
Zitat von Christian Grün christian.gruen@gmail.com:
A query could look as follows:
declare variable $mode := 'STRING'; declare variable $input := 'This is a c b text'; declare variable $terms := 'A B C';
if($mode = 'STRING') then $input contains text { $terms } phrase else if($mode = 'AND') then $input contains text { $terms } all words else error((), 'Unknown search mode')
In principle, this works very nicely. I chose to put together the query (i.e., the part starting with ft:mark) in perl and use the xquery for defining the result display.
There are two reasons: I will offer users to search by using stemming or by using fuzzy and for the "all words" using a certain distance, but for "phrase" this option would not be set. For me it is easier to handle these cases in perl :)
The second reason includes a further question:
I noticed, that it makes no difference for searching if the query is:
contains text {"A B C"} all words
or
contains text ("A" ftand "B" ftand "C")
However, applying ft:mark, the first (using "all words") results in marking only occurences of "C", whereas the second (using "ftand") results in marking occurences of "A", "B", and "C". Is this a feature/bug of ft:mark?
Best regards
Cerstin