lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <>
Subject Re: MoreLikeThis from a field with a specific value
Date Tue, 15 Jul 2008 23:04:07 GMT
martinoleary wrote:
> Hi there... 
> im trying to get MoreLikeThis documents from my lucene index given a
> sentence... just one line of text lets say... but i also want to get the
> returned results only where a field has a specific value.... 
> so for example if i have my index and it contains a categoryId and
> content... i would like to get results where content is like blah blah blah
> and categoryId = 1 or 2.. etc... 
> my more like this like method is returning something like this:
> content:blah content:blah content:blah +categoryId:2
> but when this is run, its returning EVERYTHING from this category....

Not surprising at all.  This is what you actually want:

+(content:blah content:blah content:blah) +categoryId:2

Your original query's only REQUIRED constraint was that it match the 


Daniel Noll

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message