How do you _know_ when something is English or Spanish? You didn't
describe your logic. Or do you need language auto-detect?

One place you could start looking is UpdateRequestProcessors, they go
between your handler's work and the schema level processing and you
can insert auto-detect, field renaming, duplication, etc. Lots of
options. You can see the full list for Solr 4.7 (I didn't do 4.6) at:
http://www.solr-start.com/info/update-request-processors/archive/urp_470.html

Regards,
   Alex.
----
Sign up for my Solr resources newsletter at http://www.solr-start.com/


On 17 December 2014 at 08:02, Gabi <g...@idieikon.com> wrote:
> Following the sample in
> <http://wiki.apache.org/solr/ContentStreamUpdateRequestExample>
> http://wiki.apache.org/solr/ContentStreamUpdateRequestExample I'm able to
> insert a PDF and search words, etc.
>
>
>
> ContentStreamUpdateRequest up = new
> ContentStreamUpdateRequest("/update/extract");
> up.addFile(new File(fileName), "application/pdf");
> up.setParam("literal.id", solrId);
> up.setParam("uprefix", "attr_");
> up.setParam("fmap.content", "attr_content");
>
>
>
> My problem is that I have created some fields for a document (in
> schema.xml), for example
>
> <field name="docName" type="text_es" indexed="true" stored="true"/>
> <field name="description" type="text_es" indexed="true" stored="true"/>
>
> They use the text_es definition, for spanish text, and if I insert data
> directly into this fields it works nice (plural, etc...)
>
> But if I want to add data from PDF (or other) files directly to them, what I
> have to change in the code? Can I change the attributes in the
> ContentStreamUpdateRequest to do it? What do I have to write in these lines
> of code to insert into description the PDF file content?
>
> up.setParam("literal.id", solrId); //I suppose this line does not change
> up.setParam("uprefix", "attr_");
> up.setParam("fmap.content", "attr_content");
>
> And what I have to add to enter the other fields like put a docName? So when
> I search for a word in the document I get "SolrDocument{id= ...,
> attr_content=[ ... ], version_=... But I want to add some attributes like
> docName or other with my values inserted in my code.
>
> By the way I'm using Solr version 4.6.0 and SolrJ in Java for the code.
>
> Regards.
>
>
>
>
>
> ---
> Este mensaje no contiene virus ni malware porque la protección de avast! 
> Antivirus está activa.
> http://www.avast.com

Reply via email to