You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by tacno <re...@gmail.com> on 2015/03/02 20:02:40 UTC

How can I index a "dictionary"?

Hello guys.

I'm indexing any fields in solr without any problems.
Ex:

<doc>
<field name="identifier">http://192.168.1.27:8000/event/xml/2/solr</field>
<field name="pk_i">2</field>
<field name="title">Title</field>
<field name="type">text</field>
<field name="created">2015-03-02T15:53:01.435232Z</field>
<field name="creator">user that create</field>
........
</doc>

But now, i have pictures in this data, and I want to put an "array" of
fields with different values.

Example:

<photos>
<element>
<field name="path_s">http://localhost:8000/images/first_file.jpg</field>
<field name="caption_pt">Minha foto</field>
<field name="caption_en">My Picture</field>
</element>
<element>
<field name="path_s">http://localhost:8000/images/second_file.png</field>
<field name="caption_pt">Minha foto</field>
<field name="caption_en">My Picture</field>
</element>
......
</photos>

But this doesn't insert in my solr. How can I do to index this data?

Thanks!!



--
View this message in context: http://lucene.472066.n3.nabble.com/How-can-I-index-a-dictionary-tp4190433.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How can I index a "dictionary"?

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.
Hi Tacno,

Sounds like material for block join : https://cwiki.apache.org/confluence/display/solr/Other+Parsers
 
Ahmet

On Monday, March 2, 2015 9:05 PM, tacno <re...@gmail.com> wrote:



Hello guys.

I'm indexing any fields in solr without any problems.
Ex:

<doc>
<field name="identifier">http://192.168.1.27:8000/event/xml/2/solr</field>
<field name="pk_i">2</field>
<field name="title">Title</field>
<field name="type">text</field>
<field name="created">2015-03-02T15:53:01.435232Z</field>
<field name="creator">user that create</field>
........
</doc>

But now, i have pictures in this data, and I want to put an "array" of
fields with different values.

Example:

<photos>
<element>
<field name="path_s">http://localhost:8000/images/first_file.jpg</field>
<field name="caption_pt">Minha foto</field>
<field name="caption_en">My Picture</field>
</element>
<element>
<field name="path_s">http://localhost:8000/images/second_file.png</field>
<field name="caption_pt">Minha foto</field>
<field name="caption_en">My Picture</field>
</element>
......
</photos>

But this doesn't insert in my solr. How can I do to index this data?

Thanks!!



--
View this message in context: http://lucene.472066.n3.nabble.com/How-can-I-index-a-dictionary-tp4190433.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How can I index a "dictionary"?

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
The question is what you want to find when you search for photo
information and what happens if you search for several keywords that
come from different pictures.

If you don't care and just want to get the common parent record, you
need to flatten that photo information into multivalue fields to be
searchable.

If each photo is a separate entity and "My Picture" should return two
results, you should index them as separate documents, perhaps with
block joins or other specialized merge searches as required.

Regards,
   Alex.
----
Solr Analyzers, Tokenizers, Filters, URPs and even a newsletter:
http://www.solr-start.com/


On 2 March 2015 at 14:02, tacno <re...@gmail.com> wrote:
> Hello guys.
>
> I'm indexing any fields in solr without any problems.
> Ex:
>
> <doc>
> <field name="identifier">http://192.168.1.27:8000/event/xml/2/solr</field>
> <field name="pk_i">2</field>
> <field name="title">Title</field>
> <field name="type">text</field>
> <field name="created">2015-03-02T15:53:01.435232Z</field>
> <field name="creator">user that create</field>
> ........
> </doc>
>
> But now, i have pictures in this data, and I want to put an "array" of
> fields with different values.
>
> Example:
>
> <photos>
> <element>
> <field name="path_s">http://localhost:8000/images/first_file.jpg</field>
> <field name="caption_pt">Minha foto</field>
> <field name="caption_en">My Picture</field>
> </element>
> <element>
> <field name="path_s">http://localhost:8000/images/second_file.png</field>
> <field name="caption_pt">Minha foto</field>
> <field name="caption_en">My Picture</field>
> </element>
> ......
> </photos>
>
> But this doesn't insert in my solr. How can I do to index this data?
>
> Thanks!!
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/How-can-I-index-a-dictionary-tp4190433.html
> Sent from the Solr - User mailing list archive at Nabble.com.