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 Alexander Cougarman <ac...@bwc.org> on 2012/08/26 08:59:35 UTC

Two-dimensional array in Solr schema

Hi. We're using Solr 4.0 Beta. Is it possible to have a 2-dimensional array in Solr schema? For example, you want to store this information in a field:

  MyCustomField:
    - Text
    - FileName

So each text has a filename associated with it. Thanks.

Sincerely,
Alex 


Re: Two-dimensional array in Solr schema

Posted by Michael Della Bitta <mi...@appinions.com>.
Multivalued fields come back in the order you index them. So you could
have a field named "filenames" and another field named "filecontents",
and as long as you indexed them both in the same order, they'd appear
in the results in the same order. So iterating over them would be like
iterating over two parallel arrays.

Michael Della Bitta

------------------------------------------------
Appinions | 18 East 41st St., Suite 1806 | New York, NY 10017
www.appinions.com
Where Influence Isn’t a Game


On Sun, Aug 26, 2012 at 4:58 AM, Alexander Cougarman <ac...@bwc.org> wrote:
> More detail: So, when Solr returns results, we'd get XML that looks like this:
>
>   <doc>
>     <arr name="text">
>        <str filename="abcdef.docx">dkjfkjdfkjdkfj</str>
>        <str filename="ghijklm.docx">kdjfkjdkfj</str>
>     </arr>
>   </doc>
>
> Sincerely,
> Alex
>
>
> -----Original Message-----
> From: Alexander Cougarman [mailto:acougarm@bwc.org]
> Sent: 26 August 2012 10:00 AM
> To: solr-user@lucene.apache.org
> Subject: Two-dimensional array in Solr schema
>
> Hi. We're using Solr 4.0 Beta. Is it possible to have a 2-dimensional array in Solr schema? For example, you want to store this information in a field:
>
>   MyCustomField:
>     - Text
>     - FileName
>
> So each text has a filename associated with it. Thanks.
>
> Sincerely,
> Alex
>

RE: Two-dimensional array in Solr schema

Posted by Alexander Cougarman <ac...@bwc.org>.
More detail: So, when Solr returns results, we'd get XML that looks like this:

  <doc>
    <arr name="text">
       <str filename="abcdef.docx">dkjfkjdfkjdkfj</str>
       <str filename="ghijklm.docx">kdjfkjdkfj</str>
    </arr>
  </doc>

Sincerely,
Alex 


-----Original Message-----
From: Alexander Cougarman [mailto:acougarm@bwc.org] 
Sent: 26 August 2012 10:00 AM
To: solr-user@lucene.apache.org
Subject: Two-dimensional array in Solr schema

Hi. We're using Solr 4.0 Beta. Is it possible to have a 2-dimensional array in Solr schema? For example, you want to store this information in a field:

  MyCustomField:
    - Text
    - FileName

So each text has a filename associated with it. Thanks.

Sincerely,
Alex