Hi ,

I have a question related to SpanNearQuery.

As of now, the  SpanNearQuery has the constraint that all the terms need to 
present in the document.
Eg : If my SpanNearQuery terms  are ( ab,bc,cd) all of them need to be found 
within a span of "n" and unordered.

But my requirement is similar to  
<http://www.gossamer-threads.com/lists/lucene/java-user/67382#67382>

I need a hit even if there are 2/3 terms found with the span being applied for 
those 2 terms.

Is there any custom implementation in place for this? I checked SrndQuery but 
that also doesn't work.

This is my workaround currently:


1)      For a list of terms ( ab,bc, cd,ef) , make a set like ( ab,bc) , ( 
bc,cd) ( ab,cd) (bc,ef) ( ab,bc,cd) ( ab,bc,cd,ef)..... and so on.

2)      Create a spanNearQuery for  each of these terms

3)      Add it to the booleanQuery with a  SHOULD clause.


However this approach gives me puzzling scores
 eg If my document has  only ( ab,bc,cd) the penalty for the missing ef is very 
high and my score comes down quite a bit.

< the score value is  of importance as I am using it further down the line for 
other calculations>

It would be great if you can help me out with this.

Regards,
Radha

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are 
not 
to copy, disclose, or distribute this e-mail or its contents to any other 
person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has 
taken 
every reasonable precaution to minimize this risk, but is not liable for any 
damage 
you may sustain as a result of any virus in this e-mail. You should carry out 
your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this 
e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Reply via email to