IT-Wissen/solr/README.md

1.5 KiB

Table of Contents

Solr

Home-Verzeichnis von Solr: /opt/solr-9.0.0/server/solr

Curl Commands

Select by updated (from to infinite)

curl -X GET "http://localhost:8983/solr/beispiel-core/select?q=updated_on:\[2020-04-02T15:13:30Z%20TO%20*\]"

Show Schema

curl -X GET -u solr:daspasswort "https://solr.beispiel-access-stage.whatever.info/solr/beispiel-access/schema"

Show Fields

curl -X GET -u solr:daspasswort "https://solr.beispiel-access-stage.whatever.info/solr/beispiel-access/schema/fields"

Update Field

curl -X POST -H 'Content-type:application/json' -u solr:daspasswort --data-binary '{
  "replace-field":{
    "name":"updated_on",
    "type":"pdate",
    "indexed":true }
}' "https://solr.beispiel-access-stage.whatever.info/solr/beispiel-access/schema"

Send documents

curl -X POST -H 'Content-Type: application/json' -u solr:<password> 'https://solr.beispiel-access-stage.whatever.info/solr/beispiel-access/update?commitWithin=1000' --data-binary @standardOutput.json

Delete document by id

curl -X POST -H 'Content-Type: text/xml' -u solr:<password> 'https://solr.beispiel-access-stage.whatever.info/solr/beispiel-access/update?commit=true' --data-binary '<delete><id>111-1</id></delete>'

Delete ALL documents (CAUTION

curl -X POST -H 'Content-Type: text/xml' -u solr:<password> 'https://solr.beispiel-access-stage.whatever.info/solr/beispiel-access/update?commit=true' --data-binary '<delete><query>*:*</query></delete>'