exact matches can now specify to include (or not) wildcard at end. Added
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 29 Nov 2003 19:11:23 +0000 (19:11 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 29 Nov 2003 19:11:23 +0000 (19:11 +0000)
also documentation about exact matching using swish-e

git-svn-id: file:///home/dpavlin/private/svn/webpac/trunk@190 13eb9ef6-21d5-0310-b721-a9d68796d827

WebPac.pm
doc/exact_match.txt [new file with mode: 0644]

index 8e32d93..ec8dbb8 100644 (file)
--- 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 (file)
index 0000000..1a42007
--- /dev/null
@@ -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:
+
+<input type="hidden" name="f1" value="TitleAndResponsiblity">
+<input type="text" name="v1">
+<input type="hidden" name="e1" value="5">
+