if ($q->param("e$i")) {
$pre = '"' if (! $pre);
$post = '"' if (! $post);
- $wc = ''; # don't use windcard in exact
+ # what about wildcards?
+ $wc = '';
+ $wc = '*' if ($q->param("e$i") & 4);
$exact = '_exact';
}
--- /dev/null
+How does exact match work?
+
+Well, it's quite stupid because swish-e doesn't allow you to make exact
+match to words. So, work-around is to add 'xxbxx' word at beginning of
+string and 'xxexx' word at end (think of it as xxb(egin)xx and xxe(nd)xxx)
+and then search for phrase (words in particular order).
+
+So, title "human" will be indexed as "xxbxx human xxexx" if you want full
+exact match. Then you can search it using (numbers are parameters to e[nr]
+field in html forms):
+
+1: exact match from beginning "xxbxx human"
+2: exact match from end "human xxexx" (not really useful)
+3: exact match begin and end "xxbxx human xxexx"
+
+add 4 to those values (numbers are really bit-masks :-) to produce wild-card
+match:
+
+5: exact from beginning with wild-card "xxbxx human*"
+6: exact from end with wild-card "human* xxexx"
+7: exact begin+end with wild-card "xxbxx human* xxexx"
+
+So, to define field which have to search using exact match with wild-card
+on TitleAndResponsibility, you would use:
+
+<input type="hidden" name="f1" value="TitleAndResponsiblity">
+<input type="text" name="v1">
+<input type="hidden" name="e1" value="5">
+