Файлы, которые я хочу индексировать, хранятся на сервере (мне не нужно сканировать). /путь/к/файлам/ пример HTML-файла
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="product_id" content="11"/>
<meta name="assetid" content="10001"/>
<meta name="title" content="title of the article"/>
<meta name="type" content="0xyzb"/>
<meta name="category" content="article category"/>
<meta name="first" content="details of the article"/>
<h4>title of the article</h4>
<p class="link"><a href="#link">How cite the Article</a></p>
<p class="list">
<span class="listterm">Length: </span>13 to 15 feet<br>
<span class="listterm">Height to Top of Head: </span>up to 18 feet<br>
<span class="listterm">Weight: </span>1,200 to 4,300 pounds<br>
<span class="listterm">Diet: </span>leaves and branches of trees<br>
<span class="listterm">Number of Young: </span>1<br>
<span class="listterm">Home: </span>Sahara<br>
</p>
</p>
Я добавил обработчик запроса в файл solrconfing.xml.
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">/path/to/data-config.xml</str>
</lst>
My data-config.xml is look like this
<dataConfig>
<dataSource type="FileDataSource" />
<document>
<entity name="f" processor="FileListEntityProcessor" baseDir="/path/to html/files/" fileName=".*html" recursive="true" rootEntity="false" dataSource="null">
<field column="plainText" name="text"/>
</entity>
</document>
</dataConfig>
Я сохранил файл schema.xml по умолчанию и добавил следующий фрагмент кода в файл schema.xml.
<field name="product_id" type="string" indexed="true" stored="true"/>
<field name="assetid" type="string" indexed="true" stored="true" required="true" />
<field name="title" type="string" indexed="true" stored="true"/>
<field name="type" type="string" indexed="true" stored="true"/>
<field name="category" type="string" indexed="true" stored="true"/>
<field name="first" type="text_general" indexed="true" stored="true"/>
<uniqueKey>assetid</uniqueKey>
когда я попытался выполнить полный импорт после его настройки, он показывает, что все файлы html загружены. Но когда я искал в SOLR, это не дало мне никакого результата. Кто-нибудь знает, что может быть возможной причиной?
Насколько я понимаю, все файлы загружены правильно, но не проиндексированы в SOLR. Кто-нибудь знает, как я могу проиндексировать эти метатеги и содержимое HTML-файла в SOLR?
Ваш ответ будет оценен.