Solr - How to add meta data to indexed binary files that were indexed through Solr Cell?

StackOverflow https://stackoverflow.com/questions/13051658

  •  14-07-2021
  •  | 
  •  

質問

I'm creating an PHP app that allows the user to search for files using Solr to power the search. This is mainly because the app requires content searching of Word Docs and PDFs. The app also uses a MySql database to keep track of the files.

I'm thinking the best way to intially index all of the files (probably around 20,000) is to write a PHP script that loops through all the files in a particular directory adding each one to the Solr index and creating a record for it in my database.

The problem is the files themselves don't contain all of the data that needs to be indexed. Once the file name, content, author etc has been indexed using Solr Cell I need users of the app to be able to add extra meta data such as tags and categories.

I understand that if the users were to add this data to the MySql database I couldn't then update Solr with the extra data without overwriting the data that was already indexed (content etc..).

So my question is once a file has been indexed by Solr how can I add extra meta data to the index that couldn't be retrieved from the file itself by the Solr Cell extractor?

役に立ちましたか?

解決

If you are using Solr 4.0 you can use the partial document update feature in which you can add just the updated fields instead of having to provide all the fields.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top