Exclude certain documents from all search results in Solr? -


i newbie in solr , have task block documents result search queries.

i searched , found few ways in results can blocked.

  1. elevate.xml (https://wiki.apache.org/solr/queryelevationcomponent)
  2. using "excludeids" parameter in query (http://localhost:8983/solr/elevate?q=:&elevatedids=doc3,doc4&excludeids=doc6,doc8)
  3. using following :

 <lst name="appends">    <str name="excludeids">doc_id_1,doc_id_2</str>   </lst>

but there limitations 3 solutions above.

  1. elevate.xml works static keywords/search, won't work searches.

  2. appending exculdeids in query increase length of post request java code.

  3. updating solrconfig.xml append exculdeids give expected result have restart solr everytime there change in list of ids need block.

so there way block list of document ids in solr dynamically searches ?

an answer question add new field , storing "status" (to displayed or should not) there , use in solr filter query. e.g. have string field name "remove" , documents should not shown in result, add "remove" field value "true". can query "q=abc&fq=-remove:true"

note:

  1. this have multiple usage in long run. if document needs shown in queries, can remove fq filter.
  2. you can add number of documents have field "remove=true" , there wont change in search query. document not displayed in result.
  3. you can add filter in "solrconfig" since there wont need change everytime.

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -