Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. From the solr directory
    1. bin/solr start
    2. bin/solr create -c tika-example && bin/solr config -c tika-example -p 8983 -action set-user-property -property update.autoCreateFields -value false
  2. From the tika-pipes-tutorial directory

    1. Set the schema in Solr: curl -F 'data=@configs/solr/solr-parent-child-schema.json' http://localhost:8983/solr/tika-example/schema

    2. Configure the basePath element in FileSystemPipesIterator and FileSystemFetcher in configs/solr/tika-config-solr.xml

      Code Block
      languagexml
      titleFileSystemPipesIterator
      collapsetrue
          <fetcher class="org.apache.tika.pipes.fetcher.fs.FileSystemFetcher">
            <params>
              <name>fsf</name>
              <basePath>/Users/allison/Desktop/tika-pipes-tutorial-20221202/docs</basePath>
            </params>
          </fetcher>
      ...
        <pipesIterator class="org.apache.tika.pipes.pipesiterator.fs.FileSystemPipesIterator">
          <params>
            <fetcherName>fsf</fetcherName>
            <emitterName>solr1</emitterName>
            <basePath>/Users/allison/Desktop/tika-pipes-tutorial-20221202/docs</basePath>
          </params>
        </pipesIterator>


    3. java -cp "app-bin/*" org.apache.tika.cli.TikaCLI -a --config=configs/solr/tika-config-solr.xml

OpenSearch/Elasticsearch Example (fileshare to OpenSearch/ElasticSearch)

  1. Start opensearch via Docker:
    1. docker pull opensearchproject/opensearch:1.2.0
    2. docker run -p 9200:9200 -p 9600:9600 -e"discovery.type=single-node" opensearchproject/opensearch:1.2.0
  2. Curl schema to opensearch: 

    curl -k -T configs/opensearch/opensearch-parent-child-mappings.json -u admin:admin -H "Content-Type:application/json" https://localhost:9200/tika-test

  3. Configure the basePath element in FileSystemPipesIterator in configs/opensearch/tika-config-opensearch.xml

    Code Block
    languagexml
    titleFileSystemPipesIterator
    collapsetrue
          <fetcher class="org.apache.tika.pipes.fetcher.fs.FileSystemFetcher">
          <params>
            <name>fsf</name>
            <basePath>/Users/allison/Desktop/tika-pipes-tutorial-20221202/docs</basePath>
          </params>
        </fetcher>
    ....
      <pipesIterator class="org.apache.tika.pipes.pipesiterator.fs.FileSystemPipesIterator">
        <params>
          <fetcherName>fsf</fetcherName>
          <emitterName>ose</emitterName>
          <basePath>/Users/allison/Desktop/tika-pipes-tutorial-20221202/docs</basePath>
        </params>
      </pipesIterator>


...

  1. delete a collection in solr: 

    bin/solr

    delete

    -c

    collection_name

  2. Show all docs in OpenSearch/Elasticsearch: https://localhost:9200/tika-test/_search?pretty=true&q=*:*