[Namazu-users-ja 1236] Re: 複数の条件の検索

小田切亘 wotagiri @ nifty.com
2011年 8月 10日 (水) 10:37:37 JST


$B>.ED @ Z$h$j<+8J%l%9$G!"$=$N8e$N7P2a$H!"5?Ld$N;v$*?R$M$$$?$7$^$9!#(B
8$B7n(B15$BF|$K$O8x3+$7$?$$$H9M$($F$$$^$9$N$G$h$m$7$/$*4j$$$$$?$7$^$9!#(B

7$B7n(B27$BF|$K=q$-9~$_$7$?!"Kv5-$N(B4$B$D$N<ALdCf(B
$B-!$O9M$(J}$NLdBj$G$9$,!"0l1~LdBj$J$/F0:n$7$F$$$k$h$&$G$9!#(B
$B-"$O8=:_$N(Bpre_namazu$B$N=hM}$G!"0l1~LdBj$J$/F0:n$7$F$$$k$h$&$G$9!#(B
$B-#$OEvLL!":GBg$N4X?4;v$K$F!":#2s$5$i$K:F<ALd$7$^$9!#$*5$$E$-$NE@$"$i$P$4;XF3(B
$B$/$@$5$$!#(B
$B-$$O<+NO$G2r7h$G$-$^$7$?!#(B

$B0J>e$N7k2L$rF'$^$($F!"8=:_(B
http://www.net1.jway.ne.jp/hsgjs/groups/index.html
$B$N$h$&$J$H$3$m$^$G$-$^$7$?!#I=Bj$NJ#?t$N>r7o$N8!:w$O!"Ev=i;{@>$5$^$+$i$465<((B
$B$$$?$@$$$?(B
$B8!:w8l(B +genre:g01 +place:p02
$B$N$h$&$JJ8;zNs$r(B$query$B$KM?$($kJ}K!$O!"0l$D$NJ8=q$,J#?t>l=j$r4^$`>l9g$KE,MQ:$(B
$BFq$J$3$H$,H=L@$7$^$7$?!#(B

$B=>$C$F8=:_$O!"2<CJ$N(B4$B$D$N>r7o$G8!:w$9$kItJ,$O!"A4ItFC<l$N%3!<%I$rEv$F$O$a$F(B
$B%$%s%G%C%/%9$r:n @ .$7!"A0=hM}$G(B
$B8!:w8l(B g01 p02
$B$N$h$&$K!"C1=c$J(BAND$B7k9g$G8!:w$9$kJ}K!$G2r7h$7$^$7$?!#L^O@!">r7o$,!V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query ="query=";
	foreach $i (0 .. $#qs) {
		($fname, $fvalue) = split(/=/,$qs[$i],2);
		if ($fname eq "keywd") {
			if ($fvalue ne ""){
				$query  .=
$fvalue;
				$keywd_out = $fvalue;   ###$B!!!!!!!!!!!!!!!!(B
$B!!!!!!!!!!!!!!!!!!!!!!(B
				$keywd_out =~ tr/+/ /;   ###
				$keywd_out =~
s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;   ###
				$keywd_out =~ s/&/&amp;/g;   ###
				$keywd_out =~ s/</&lt;/g;   ###
				$keywd_out =~ s/>/&gt;/g;   ###
				$keywd_out =~ s/"/&quot;/g;   ###
			} else	{
				$query  .= "whole"; } #$B%-!<%o!<%I$,L5$$$H$-(B
$B$OA4It$K4^$^$l$k!V(Bwhole$B!W(B
			}
		elsif (($fname eq "genre") and ($fvalue ne "g00"))
			 { $query .= "+".$fvalue; $genre =
$h_genre{$fvalue}; }
		elsif (($fname eq "place") and ($fvalue ne "p00"))
			 { $query .= "+".$fvalue; $place =
$h_place{$fvalue}; }
		elsif (($fname eq "area") and ($fvalue ne "a00"))
			 { $query .= "+".$fvalue; $area = $h_area{$fvalue};
}
		elsif (($fname eq "recruit") and ($fvalue ne "r00"))
			 { $query .= "+".$fvalue; $reqruit =
$h_reqruit{$fvalue}; }
	}
	$ENV{'QUERY_STRING'} = $query."&".$qs;
}
$B!&8!:w7k2L2hLL$K8!:w>r7o$rI=<($9$k$?$a!"%+%9%?%^%$%:$7$?FbMF!!(B(<font>$B%?%0$r(B
$B>JN,$7$F0zMQ(B)
&output("<p><b>($B%R%C%H?t(B)&nbsp;&nbsp; $Keys </b> ($B8!:w8l(B)" )
&prn($keywd_out);
&output(" ($BJ,N`(B) $genre ($B>l=j(B) $place ($BBP>](B) $area ($BJg=8(B) $reqruit </p>\n");

-----Original Message-----
From: $B>.ED @ ZOK(B [mailto:wotagiri @ nifty.com]
Sent: Wednesday, July 27, 2011 8:23 AM
To: 'namazu-users-ja @ namazu.org'
4.$B3NG'$7$?$$;v9`(B
$B-!%$%s%G%C%/%9:n @ .$O(Bnmz2.0.20$B!"%5%$%H$N(Bperl$B$O(Bpnamazu-2006.12.23$B$NAH9g$;$N@'(B
$BHs(B
$B-"J#?t>r7o8!:w$r$3$N$h$&$K(Bpre_namazu$B$G9T$o$:!"4J0W$J(Bnamazu$B$N;H$$J}$,$"$j$=$&(B
$B$K;W$&$N$G!"$b$7$"$l$P$4>R2p$$$?$@$-$?$/!#(B
$B-#(Bsub pre_namazu$B$NCf$NF|K\8l%3!<%I$N9M$(J}!":#2s$O @ 52r$,JL$JF~NOJ}K!$G3NG'$G(B
$B$-$?$N$G$=$l$K9g$o$;$?$,!":G=i$N!V(Bquery =$B!W$N$H$3$m$@$1$O!"(B%3D$B$r;H$o$J$$$G:Q(B
$B$s$@!#(B
$B-$%F%s%W%l!<%H$NCf$G!"(B{summary}{from}{date}{to}$B$J$I!"J8=q0MB8$N%G!<%?!<$rM=(B
$B$a%U%!%$%k2=$7$F$*$-!"8!:w7k2L$K0zMQ$7$F$$$k!#(Bmeta$BJ8$GM?$($F!"(B
NMZ.field.genre$B$J$I$K%j%9%H$5$l$F$$$k>pJs$r%F%s%W%l!<%HCf$KKd$a9~$`J}K!$O$"(B
$B$j$^$;$s$+!#(B




Namazu-users-ja メーリングリストの案内