lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kenf_nc <>
Subject Re: optional nested queries
Date Fri, 01 Jul 2011 12:02:31 GMT
I don't use dismax, but do something similar with a regular query. I have a
field defined in my schema.xml called 'dummy' (not sure why its called that
actually) but it defaults to 1 on every document indexed. So say I want to
give a score bump to documents that have an image, I can do queries like:

q=Some+search+text+AND+(has_image:true^.5 OR dummy:1)

I'm doing that from memory haven't actually tested so my syntax may be off,
but i hope you get the idea. Basically the first part of the OR query in
parenthesis is your optional nested query, if it fails, or even if the
document doesn't have a field called has_image at all, the dummy:1 will
always pass.


View this message in context:
Sent from the Solr - User mailing list archive at

View raw message