How are multivalued fields used?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How are multivalued fields used?

ristretto
How does one use of this field type.
Forums, wiki, Lucene in Action, all coming up empty.
If there's a doc somewhere please point me there.

I use pysolr to index. But, that's not a requirement.

I'm not sure how one adds multivalues to a document.  And once added,
if you want to remove one
 how do you specify?  Based on
http://wiki.apache.org/solr/FieldOptionsByUseCase, it says to use
it to "add multiple values, maintaining order "  Is the order for
indexing/searching  or for storing/returning?


thanks
gene
Reply | Threaded
Open this post in threaded view
|

Re: How are multivalued fields used?

bigdaddy_
Hello Gene,

Am Montag, den 13.10.2008, 23:32 +1300 schrieb ristretto.rb:
> How does one use of this field type.
> Forums, wiki, Lucene in Action, all coming up empty.
> If there's a doc somewhere please point me there.
>
> I use pysolr to index. But, that's not a requirement.
>
> I'm not sure how one adds multivalues to a document.

You add multiple fields with the same name to a document, say keywords.

<doc>
<field name=keywords>solr<field/>
<field name=keywords>lucene<field/>
<field name=keywords>seach<field/>
</doc>

If have configured the the field keyword in the index to be multivalued,
then solr will dump the values of each field in your document into the
field keywords. When you request that solr return the value in the field
keywords, then you get a coma seperated list of the keywords.
"solr,lucene,search"

>  And once added,
> if you want to remove one
>  how do you specify?
You cannot remove a field from a document, documents are read only, you
have to reindex the document with the same unique id and the new
information.  

>   Based on
> http://wiki.apache.org/solr/FieldOptionsByUseCase, it says to use
> it to "add multiple values, maintaining order "  Is the order for
> indexing/searching  or for storing/returning?
Not sure, but I would assume that the values are stored in the field in
the order that the fields are specified in the document.

Brian

Reply | Threaded
Open this post in threaded view
|

Re: How are multivalued fields used?

Otis Gospodnetic-2
In reply to this post by ristretto
Gene, I think you can think of multi-valued fields as just regular fields with multiple values concatenated together.  There is nothing super magical about them.

Otis
--
Sematext -- http://sematext.com/ -- Lucene - Solr - Nutch



----- Original Message ----

> From: ristretto.rb <[hidden email]>
> To: [hidden email]
> Sent: Monday, October 13, 2008 6:32:03 AM
> Subject: How are multivalued fields used?
>
> How does one use of this field type.
> Forums, wiki, Lucene in Action, all coming up empty.
> If there's a doc somewhere please point me there.
>
> I use pysolr to index. But, that's not a requirement.
>
> I'm not sure how one adds multivalues to a document.  And once added,
> if you want to remove one
> how do you specify?  Based on
> http://wiki.apache.org/solr/FieldOptionsByUseCase, it says to use
> it to "add multiple values, maintaining order "  Is the order for
> indexing/searching  or for storing/returning?
>
>
> thanks
> gene