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 Sebastian Hofmann <ho...@uni-jena.de> on 2012/11/20 16:08:22 UTC

Additional field informations?

Hello all,
We import xml documents to solr with solrj. We use xsl to proccess the 
"objects" to fields.
We got the language informations in our "objects".
After xsl out Documents look like this:
<add>
     <doc>
         ...
         <field name="title">german title</title>
         <field name="title">english title</title>
         <field name="title">french title</title>
         ...
     </doc>
</add>


Our schema.xml looks like this. (we use it as a filter too..)
...
<field name="title" type="string" indexed="true" stored="true" 
multiValued="true" />
...

Our results look like this. (we want to transform it directly to html 
with xsl)
<arr name="title">
<str>german title</str>
<str>english title</str>
<str>french title</str>
</arr>

Is there any possibillity to get a result like this:
<arr name="title">
     <str lang="de">german title</str>
     <str lang="en">english title</str>
     <str lang="fr">german title</str>
</arr>


Re: Additional field informations?

Posted by Daniel Rosher <ro...@gmail.com>.
Hi,

Have a look at DocTransformers

 http://wiki.apache.org/solr/DocTransformers and ExplainAugmenterFactory as
an example

Cheers,
Dan

On Tue, Nov 20, 2012 at 3:08 PM, Sebastian Hofmann <ho...@uni-jena.de>wrote:

> Hello all,
> We import xml documents to solr with solrj. We use xsl to proccess the
> "objects" to fields.
> We got the language informations in our "objects".
> After xsl out Documents look like this:
> <add>
>     <doc>
>         ...
>         <field name="title">german title</title>
>         <field name="title">english title</title>
>         <field name="title">french title</title>
>         ...
>     </doc>
> </add>
>
>
> Our schema.xml looks like this. (we use it as a filter too..)
> ...
> <field name="title" type="string" indexed="true" stored="true"
> multiValued="true" />
> ...
>
> Our results look like this. (we want to transform it directly to html with
> xsl)
> <arr name="title">
> <str>german title</str>
> <str>english title</str>
> <str>french title</str>
> </arr>
>
> Is there any possibillity to get a result like this:
> <arr name="title">
>     <str lang="de">german title</str>
>     <str lang="en">english title</str>
>     <str lang="fr">german title</str>
> </arr>
>
>

RE: Additional field informations?

Posted by Yorgos Mamakis <Yo...@KB.nl>.
You could use dynamicFields to map the language as well

 <field name="title.de">german title</field>
 <field name="title.en">english title</field>

etc...

Yorgos Mamakis
Backend Developer

www.europeana.eu

Email: Yorgos.Mamakis@kb.nl
Skype: fuabap



-----Original Message-----
From: Rafal Kuc [mailto:r.kuc@solr.pl]
Sent: Tue 11/20/2012 5:26 PM
To: solr-user@lucene.apache.org
Subject: Re: Additional field informations?
 
Hello!

I think that's not possible out of the box in Solr. 

-- 
Regards,
 Rafal Kuc
 Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch

> Hello all,
> We import xml documents to solr with solrj. We use xsl to proccess the
> "objects" to fields.
> We got the language informations in our "objects".
> After xsl out Documents look like this:
> <add>
>      <doc>
>          ...
>          <field name="title">german title</title>
>          <field name="title">english title</title>
>          <field name="title">french title</title>
>          ...
>      </doc>
> </add>


> Our schema.xml looks like this. (we use it as a filter too..)
> ...
> <field name="title" type="string" indexed="true" stored="true" 
> multiValued="true" />
> ...

> Our results look like this. (we want to transform it directly to html 
> with xsl)
> <arr name="title">
> <str>german title</str>
> <str>english title</str>
> <str>french title</str>
> </arr>

> Is there any possibillity to get a result like this:
> <arr name="title">
>      <str lang="de">german title</str>
>      <str lang="en">english title</str>
>      <str lang="fr">german title</str>
> </arr>


Re: Additional field informations?

Posted by Rafał Kuć <r....@solr.pl>.
Hello!

I think that's not possible out of the box in Solr. 

-- 
Regards,
 Rafał Kuć
 Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch - ElasticSearch

> Hello all,
> We import xml documents to solr with solrj. We use xsl to proccess the
> "objects" to fields.
> We got the language informations in our "objects".
> After xsl out Documents look like this:
> <add>
>      <doc>
>          ...
>          <field name="title">german title</title>
>          <field name="title">english title</title>
>          <field name="title">french title</title>
>          ...
>      </doc>
> </add>


> Our schema.xml looks like this. (we use it as a filter too..)
> ...
> <field name="title" type="string" indexed="true" stored="true" 
> multiValued="true" />
> ...

> Our results look like this. (we want to transform it directly to html 
> with xsl)
> <arr name="title">
> <str>german title</str>
> <str>english title</str>
> <str>french title</str>
> </arr>

> Is there any possibillity to get a result like this:
> <arr name="title">
>      <str lang="de">german title</str>
>      <str lang="en">english title</str>
>      <str lang="fr">german title</str>
> </arr>