Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 71466 invoked from network); 17 Apr 2009 07:07:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Apr 2009 07:07:49 -0000 Received: (qmail 80742 invoked by uid 500); 17 Apr 2009 07:07:47 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 80665 invoked by uid 500); 17 Apr 2009 07:07:46 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 80655 invoked by uid 99); 17 Apr 2009 07:07:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2009 07:07:46 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [122.98.10.33] (HELO KECGATE08.infosys.com) (122.98.10.33) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Apr 2009 07:07:38 +0000 X-TM-IMSS-Message-ID: <2331042a0002029e@KECGATE08.infosys.com> Received: from blrkechub04.ad.infosys.com ([10.66.236.44]) by KECGATE08.infosys.com ([122.98.10.33]) with ESMTP (TREND IMSS SMTP Service 7.0; TLS: TLSv1/SSLv3,128bits,RC4-MD5) id 2331042a0002029e ; Fri, 17 Apr 2009 12:37:41 +0530 Received: from BLRKECMBX09.ad.infosys.com ([10.66.236.82]) by blrkechub04.ad.infosys.com ([10.66.236.44]) with mapi; Fri, 17 Apr 2009 12:37:15 +0530 From: "Radhalakshmi Sreedharan" To: "java-user@lucene.apache.org" Date: Fri, 17 Apr 2009 12:37:10 +0530 Subject: RE: Need help : SpanNearQuery Thread-Topic: Need help : SpanNearQuery Thread-Index: Acm+iNF1pm27j7zFQguuTqAOr5YfMAABtBKwAAgjfKAAHoBJYA== Message-ID: <5CDA3DC1F80BBB42BD0B48FABC128B5114EC9C012D@BLRKECMBX09.ad.infosys.com> References: <5CDA3DC1F80BBB42BD0B48FABC128B5114EC9BFE30@BLRKECMBX09.ad.infosys.com> <2D127F11DC79714E9B6A43AC9458147F13FCA3C7@suex07-mbx-03.ad.syr.edu> In-Reply-To: <2D127F11DC79714E9B6A43AC9458147F13FCA3C7@suex07-mbx-03.ad.syr.edu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org Hi=20Steven, Thanks=20for=20your=20reply. I=20tried=20out=20your=20approach=20and=20the=20problem=20got=20solved=20= to=20an=20extent=20but=20still=20it=20remains. The=20problem=20is=20the=20score=20reduces=20quite=20a=20bit=20even=20now= =20as=20bc=20is=20not=20found=20in=20the=20combinations =20(=20bc,cd)=20(=20bc,ef)=20and=20(=20ab,bc,cd,ef)=20etc.=20 The=20boosting=20infact=20has=20a=20negative=20impact=20and=20reduces=20t= he=20score=20further=20:( The=20factor=20which=20is=20affected=20by=20boosting=20is=20the=20queryNo= rm=20. With=20a=20boost=20of=206=20=20-=20 0.015559823=20=3D=20(MATCH)=20max=20of: =20=200.015559823=20=3D=20(MATCH)=20weight(spanNear([SearchField:cd,=20Se= archField:ef],=2010,=20false)^6.0=20in=200),=20product=20of: =20=20=20=200.07606166=20=3D=20queryWeight(spanNear([SearchField:cd,=20Se= archField:ef],=2010,=20false)^6.0),=20product=20of: =20=20=20=20=20=206.0=20=3D=20boost =20=20=20=20=20=200.61370564=20=3D=20idf(SearchField:=20cd=3D1=20ef=3D1) =20=20=20=20=20=200.02065639=20=3D=20queryNorm =20=20=20=200.20456855=20=3D=20(MATCH)=20fieldWeight(SearchField:spanNear= ([cd,=20ef],=2010,=20false)^6.0=20in=200),=20product=20of: =20=20=20=20=20=200.33333334=20=3D=20tf(phraseFreq=3D0.33333334) =20=20=20=20=20=200.61370564=20=3D=20idf(SearchField:=20cd=3D1=20ef=3D1) =20=20=20=20=20=201.0=20=3D=20fieldNorm(field=3DSearchField,=20doc=3D0) Without=20a=20boost=20=20-=20 0.07779912=20=3D=20(MATCH)=20max=20of: =20=200.07779912=20=3D=20(MATCH)=20weight(spanNear([SearchField:cd,=20Sea= rchField:ef],=2010,=20false)=20in=200),=20product=20of: =20=20=20=200.3803083=20=3D=20queryWeight(spanNear([SearchField:cd,=20Sea= rchField:ef],=2010,=20false)),=20product=20of: =20=20=20=20=20=200.61370564=20=3D=20idf(SearchField:=20cd=3D1=20ef=3D1) =20=20=20=20=20=200.6196917=20=3D=20queryNorm =20=20=20=200.20456855=20=3D=20(MATCH)=20fieldWeight(SearchField:spanNear= ([cd,=20ef],=2010,=20false)=20in=200),=20product=20of: =20=20=20=20=20=200.33333334=20=3D=20tf(phraseFreq=3D0.33333334) =20=20=20=20=20=200.61370564=20=3D=20idf(SearchField:=20cd=3D1=20ef=3D1) =20=20=20=20=20=201.0=20=3D=20fieldNorm(field=3DSearchField,=20doc=3D0) Regards, Radha -----Original=20Message----- From:=20Steven=20A=20Rowe=20[mailto:sarowe@syr.edu]=20 Sent:=20Thursday,=20April=2016,=202009=2010:35=20PM To:=20java-user@lucene.apache.org Subject:=20RE:=20Need=20help=20:=20SpanNearQuery Hi=20Radha, On=204/16/2009=20at=208:35=20AM,=20Radhalakshmi=20Sredharan=20wrote: >=20I=20have=20a=20question=20related=20to=20SpanNearQuery. >=20 >=20I=20need=20a=20hit=20even=20if=20there=20are=202/3=20terms=20found=20= with=20the=20span=20being >=20applied=20for=20those=202=20terms. >=20 >=20Is=20there=20any=20custom=20implementation=20in=20place=20for=20this?= =20I=20checked >=20SrndQuery=20but=20that=20also=20doesn't=20work. >=20 >=20This=20is=20my=20workaround=20currently: >=20 >=201)=20=20=20=20=20=20For=20a=20list=20of=20terms=20(=20ab,bc,=20cd,ef)= =20,=20make=20a=20set=20like=20(=20ab,bc) >=20,=20(=20bc,cd)=20(=20ab,cd)=20(bc,ef)=20(=20ab,bc,cd)=20(=20ab,bc,cd,= ef).....=20and=20so=20on. >=20 >=202)=20=20=20=20=20=20Create=20a=20spanNearQuery=20for=20=20each=20of= =20these=20terms >=20 >=203)=20=20=20=20=20=20Add=20it=20to=20the=20booleanQuery=20with=20a=20= =20SHOULD=20clause. >=20 >=20However=20this=20approach=20gives=20me=20puzzling=20scores >=20=20eg=20If=20my=20document=20has=20=20only=20(=20ab,bc,cd)=20the=20pe= nalty=20for=20the=20missing=20ef >=20is=20very=20high=20and=20my=20score=20comes=20down=20quite=20a=20bit. Do=20you=20know=20about=20the=20scoring=20documentation=20on=20the=20Luce= ne=20site:=20=20?=20=20= In=20particular,=20see=20the=20link=20from=20there=20to=20the=20Searcher.= explain()=20javadocs=20-=20this=20functionality=20will=20help=20you=20und= erstand=20what's=20happening=20with=20your=20queries. I=20suspect=20that=20the=20penalty=20is=20due=20to=20fewer=20sub-queries= =20matching;=20that=20is,=20not=20only=20does=20(ab,bc,cd,ef)=20fail=20to= =20match,=20but=20(ab,bc,ef),=20(ab,cd,ef),=20(ab,ef)=20etc.=20also=20fai= l=20to=20match,=20and=20since=20all=20of=20these=20contribute=20to=20the= =20final=20score,=20you=20will=20see=20a=20large=20drop=20off=20if=20you= =20don't=20get=20a=20full=20match. Instead=20of=20putting=20all=20of=20the=20alternatives=20together=20in=20= a=20single=20large=20disjunction,=20if=20you=20package=20them=20such=20th= at=20the=20shorter=20alternatives=20don't=20influence=20the=20final=20sco= re=20when=20larger=20ones=20match,=20you=20may=20get=20something=20more= =20like=20what=20you=20want.=20=20I=20think=20DisjunctionMaxQuery=20,=20along=20with=20judicious=20boosting,=20will=20do=20the= =20trick,=20e.g.: DMQ((ab,bc,cd,ef)^100, =20=20=20=20((ab,bc,cd)^10=20(ab,bc,ef)^10=20(ab,cd,ef)^10=20...), =20=20=20=20((ab,bc)=20(ab,cd)=20(ab,ef)=20...)) Steve --------------------------------------------------------------------- To=20unsubscribe,=20e-mail:=20java-user-unsubscribe@lucene.apache.org For=20additional=20commands,=20e-mail:=20java-user-help@lucene.apache.org ****************=20CAUTION=20-=20Disclaimer=20***************** This=20e-mail=20contains=20PRIVILEGED=20AND=20CONFIDENTIAL=20INFORMATION= =20intended=20solely=20 for=20the=20use=20of=20the=20addressee(s).=20If=20you=20are=20not=20the= =20intended=20recipient,=20please=20 notify=20the=20sender=20by=20e-mail=20and=20delete=20the=20original=20mes= sage.=20Further,=20you=20are=20not=20 to=20copy,=20disclose,=20or=20distribute=20this=20e-mail=20or=20its=20con= tents=20to=20any=20other=20person=20and=20 any=20such=20actions=20are=20unlawful.=20This=20e-mail=20may=20contain=20= viruses.=20Infosys=20has=20taken=20 every=20reasonable=20precaution=20to=20minimize=20this=20risk,=20but=20is= =20not=20liable=20for=20any=20damage=20 you=20may=20sustain=20as=20a=20result=20of=20any=20virus=20in=20this=20e-= mail.=20You=20should=20carry=20out=20your=20 own=20virus=20checks=20before=20opening=20the=20e-mail=20or=20attachment.= =20Infosys=20reserves=20the=20 right=20to=20monitor=20and=20review=20the=20content=20of=20all=20messages= =20sent=20to=20or=20from=20this=20e-mail=20 address.=20Messages=20sent=20to=20or=20from=20this=20e-mail=20address=20m= ay=20be=20stored=20on=20the=20 Infosys=20e-mail=20system. ***INFOSYS********=20End=20of=20Disclaimer=20********INFOSYS*** --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org