lucene - Constant boost multivalued fields in Solr -
i have multivalued field storing strings need perform queries on. stores ids strings. so, field:
<field name="id" type="string" indexed="true" stored="true" multivalued="true" termvectors="true"/> and the query like
q: (id:'23' or id:'24')^2 this filters out documents field 23 or 24. documents have both of ids @ top, documents have either of ids below.
what want constant boost of 2. if @ least 1 id matches, give boost of 2. how achieve that?
one possible option convert query constantscorequery, replacing ^ ^=
q: (id:'23' or id:'24')^=2 in case, if document have both terms 23 , 24 or having either of them still have same score of 2.0
Comments
Post a Comment