There are some actions useful for the ordinary maintenance of an index, essential for testing it while we modify our configurations. Some of these commands should be saved for later reference, as they are commonly used.
Let's try to include some of them in a short list:
>> curl -X POST 'http://localhost:8983/solr/pdfs/update?commit=true&wt=json' -H 'Content-Type: text/xml' -d '<add><doc><field name='id'>ID01</field><field name='text'>Test Content</field></doc></add>'
>> curl -X POST 'http://localhost:8983/solr/pdfs/update?commit=true -H 'Content-Type: text/xml' --data-binary '<delete><query>uid:00000000</query></delete>'
>> curl -X POST 'http://localhost:8983/solr/pdfs/update/extract?extractOnly=true' -F '[email protected]'
>> curl -X POST 'http://localhost:8983/solr/pdfs/update/extract?commit=true' -F '[email protected]'
>> curl -X POST 'http://localhost:8983/solr/pdfs/update?commit=true' -H 'Content-Type: text/xml' --data-binary '<commit />'
>> curl -X POST 'http://localhost:8983/solr/pdfs/update?commit=true' -H 'Content-Type: text/xml' --data-binary '<rollback />'
>> curl -X POST 'http://localhost:8983/solr/pdfs/update?commit=true' -H 'Content-Type: text/xml' --data-binary '<optimize />'
>> curl -X POST 'http://localhost:8983/solr/pdfs/update?commit=true' -H 'Content-Type: text/xml' --data-binary '<delete><query>*:*</query></delete>'
This short list can be easily used as a quick cheat sheet for the most used operations when testing Solr; I'm sure you will use them many times while reading this book.
In further chapters we will move to more details, step by step, to explore the main parts of the two XML
files seen here.
Q1. Where is the data actually saved?
core/index
foldercore/index/data
foldercore/data/index
folderQ2. What are the differences between enabling a field to be stored or indexed?
Q3. How do we remove only the documents with a field author
containing the term Alighieri
from the index ?
<delete><query>*:*</query></delete>
<delete><query><field name='author'>alighieri</field></query></delete>
<delete><query>author:alighieri</query></delete>
Q4. What can we see with SimpleTextCodec
?
Q5. Disable tokenization, restart and look again at the index, then index some more data again. Take a look at the SimpleTextCodec
saved file; has the data been saved differently?
Q6. After cleaning or optimizing your Index with one of the recipes provided at the end of the Chapter, how does the index change?
core/data/index
directory changescore/data/index
directory get deletedQ7. How can we index more than one document?
XML
file containing multiple documents for indexing them at onceXML
files, one for each document to be indexedQ8. Is it possible to index a PDF
file, adding custom metadata to the corresponding generated Solr document?
/update
handler18.118.128.105