Well, what is "a document on the filesystem"? Solr deals
with well-formed XML documents of a specific format. You
can't just stream a random file to Solr. Specifically
documents look like:
<doc>
  <field name="blah">value for field </field>
.
.
.
<doc>

perhaps with an <add></add>.

There are ways for structured documents to be added using the
Tika libraries etc.

But before we go there, what is it you want to do? What is the
nature of your document?

Best
Erick

On Sat, Apr 2, 2011 at 12:35 PM, michael.i <michael.i...@gmail.com> wrote:

> Hi,
> I am new to solr so please excuse me if my question sounds basic.
>
> I would like to use the EmbeddedSolrServer.
> It happens that all examples I've found on the web use documents that have
> been generated dynamically such as:
>
>
> SolrServer solrServer = new EmbeddedSolrServer(container, "core");
> SolrInputDocument doc = new SolrInputDocument();
> doc.addField("docText", "This is a sample file");
> solrServer.add(doc);
> solrServer.commit();
>
>
> I would like to be able to load a document that is stored on the
> filesystem.
> Ideally, I would have liked to do something such as:
> SolrInputDocument doc = new SolrInputDocument("path/myDoc.txt");
> solrServer.add(doc);
> solrServer.commit();
>
> It does not seem possible to do such thing. Am I missing something? Are
> there some best practices with regards to referring to a document on the
> filesystem?
>
> Thanx!
> Michael.
>
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Using-EmbeddedSolrServer-with-static-documents-tp2767614p2767614.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Reply via email to