You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by markharw00d <ma...@yahoo.co.uk> on 2006/07/01 01:10:10 UTC

Re: Any existing query types that support equivalent of "-not interested" ?

>Maybe this:
>
>SpanNotQuery(interested, SpanNearQuery(not,interested))
>
>with a SpanTermQuery for each term?
>  
>

Thanks, Paul. This is working well for me and I can happily use multiple 
SpanTermQueries embedded in a SpanOrQuery in place of each of the single 
words in your example.

SpanNotQuery(
	SpanOrQuery(interested,curious...) 
	SpanNearQuery(
		SpanOrQuery(not,wasnt,isnt,...)
		SpanOrQuery(interested,curious...)
		)
	)




	
	
		
___________________________________________________________ 
All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use." - PC Magazine 
http://uk.docs.yahoo.com/nowyoucan.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Any existing query types that support equivalent of "-not interested" ?

Posted by Paul Elschot <pa...@xs4all.nl>.
On Saturday 01 July 2006 01:10, markharw00d wrote:
> 
> >Maybe this:
> >
> >SpanNotQuery(interested, SpanNearQuery(not,interested))
> >
> >with a SpanTermQuery for each term?
> >  
> >
> 
> Thanks, Paul. This is working well for me and I can happily use multiple 
> SpanTermQueries embedded in a SpanOrQuery in place of each of the single 
> words in your example.

I've never tried it myself, so it's good to hear that it actually works...

> 
> SpanNotQuery(
> 	SpanOrQuery(interested,curious...) 
> 	SpanNearQuery(
> 		SpanOrQuery(not,wasnt,isnt,...)
> 		SpanOrQuery(interested,curious...)
> 		)
> 	)

How about sth like this to get rid of the duplicates in there:

SpanNotNearQuery(includeSpanQuery, excludeSpanQuery, distance, ordered)

?
Writing the SpanScorer for that would be some work, though.

Regards,
Paul Elschot

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org