How do I pick/ delete all the documents from Solr using the boolean NOT notion?
i.e. How do I delete all the documents from Solr who's id does NOT start with A59?
1)How to search solr for contains You can store data into string type of field or text type of field. In string field by wild card searching you can achieve the result (E.g field1:"John*"). Also you should look into different types of analyzers.
Standard solr queries use the "q" parameter in a request. Filter queries use the "fq" parameter. The primary difference is that filtered queries do not affect relevance scores; the query functions purely as a filter (docset intersection, essentially).
You can search for "solr" by loading the Admin UI Query tab, enter "solr" in the q param (replacing *:* , which matches all documents), and "Execute Query". See the Searching section below for more information. To index your own data, re-run the directory indexing command pointed to your own directory of documents.
Solr's standard query parser supports fuzzy searches based on the Damerau-Levenshtein Distance or Edit Distance algorithm. Fuzzy searches discover terms that are similar to a specified term without necessarily being an exact match. To perform a fuzzy search, use the tilde ~ symbol at the end of a single-word term.
Use -
to indicate NOT
.
For example, to query documents with id not starting with A59, the query would be: -id:A59*
, that is: /solr/select/?q=-id:A59*
To delete by query, post the query in a delete message to the update handler, as specified here.
EDIT: NOT
(all uppercase) can also be used as boolean operator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With