From: Dobrica Pavlinusic Date: Sat, 29 Nov 2003 19:11:23 +0000 (+0000) Subject: exact matches can now specify to include (or not) wildcard at end. Added X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=4073341f02dfe61c9cb2d1c07e8cb69688d63b5c;p=webpac exact matches can now specify to include (or not) wildcard at end. Added also documentation about exact matching using swish-e git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@190 13eb9ef6-21d5-0310-b721-a9d68796d827 --- diff --git a/WebPac.pm b/WebPac.pm index 8e32d93..ec8dbb8 100644 --- a/WebPac.pm +++ b/WebPac.pm @@ -142,7 +142,9 @@ sub show_results_list { 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'; } diff --git a/doc/exact_match.txt b/doc/exact_match.txt new file mode 100644 index 0000000..1a42007 --- /dev/null +++ b/doc/exact_match.txt @@ -0,0 +1,29 @@ +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: + + + + +