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 Ninad Raut <hb...@gmail.com> on 2009/08/10 07:28:55 UTC

storing pair in Solr document

Hi,
I have a Entitiy and a Value associated with it. I want to store this value
as a <key,value> pair in Solr.
I have a Java Object which I am mapping to Solr Doc using
org.apache.solr.client.solrj.beans.Field . Can I also store a Map? and how
can I do so?
This is how I want it to be done:
@Field
 Map<String,String> entity;

Re: storing pair in Solr document

Posted by Avlesh Singh <av...@gmail.com>.
>
> Can we use SimpleOrderedMap?
>
No, Ninad that wouldn't work.

Cheers
Avlesh

On Mon, Aug 10, 2009 at 11:46 AM, Ninad Raut <hb...@gmail.com>wrote:

> Hi Avlesh,
> Can we use SimpleOrderedMap? It seems deprecated. Is it safe to use , and
> how is going to be mapped to the field?
> @Field("ne")
>  SimpleOrderedMap<String> ne = new SimpleOrderedMap<String>();
> wont work right??
>
> On Mon, Aug 10, 2009 at 11:36 AM, Avlesh Singh <av...@gmail.com> wrote:
>
> > You can have a dynamicField in your schema called "entity_*" and map it
> to
> > the your corresponding data structure in this way:
> > @Field ("entity_*")
> > Map<String,String> entity;
> > The key would be your fieldName (other than the "entity_").
> >
> > SOLR-1129 <https://issues.apache.org/jira/browse/SOLR-1129> will give
> you
> > more insights.
> >
> > Cheers
> > Avlesh
> >
> > On Mon, Aug 10, 2009 at 10:58 AM, Ninad Raut <hbase.user.ninad@gmail.com
> > >wrote:
> >
> > > Hi,
> > > I have a Entitiy and a Value associated with it. I want to store this
> > value
> > > as a <key,value> pair in Solr.
> > > I have a Java Object which I am mapping to Solr Doc using
> > > org.apache.solr.client.solrj.beans.Field . Can I also store a Map? and
> > how
> > > can I do so?
> > > This is how I want it to be done:
> > > @Field
> > >  Map<String,String> entity;
> > >
> >
>

Re: storing pair in Solr document

Posted by Ninad Raut <hb...@gmail.com>.
Hi Avlesh,
Can we use SimpleOrderedMap? It seems deprecated. Is it safe to use , and
how is going to be mapped to the field?
@Field("ne")
  SimpleOrderedMap<String> ne = new SimpleOrderedMap<String>();
wont work right??

On Mon, Aug 10, 2009 at 11:36 AM, Avlesh Singh <av...@gmail.com> wrote:

> You can have a dynamicField in your schema called "entity_*" and map it to
> the your corresponding data structure in this way:
> @Field ("entity_*")
> Map<String,String> entity;
> The key would be your fieldName (other than the "entity_").
>
> SOLR-1129 <https://issues.apache.org/jira/browse/SOLR-1129> will give you
> more insights.
>
> Cheers
> Avlesh
>
> On Mon, Aug 10, 2009 at 10:58 AM, Ninad Raut <hbase.user.ninad@gmail.com
> >wrote:
>
> > Hi,
> > I have a Entitiy and a Value associated with it. I want to store this
> value
> > as a <key,value> pair in Solr.
> > I have a Java Object which I am mapping to Solr Doc using
> > org.apache.solr.client.solrj.beans.Field . Can I also store a Map? and
> how
> > can I do so?
> > This is how I want it to be done:
> > @Field
> >  Map<String,String> entity;
> >
>

Re: storing pair in Solr document

Posted by Avlesh Singh <av...@gmail.com>.
You can have a dynamicField in your schema called "entity_*" and map it to
the your corresponding data structure in this way:
@Field ("entity_*")
Map<String,String> entity;
The key would be your fieldName (other than the "entity_").

SOLR-1129 <https://issues.apache.org/jira/browse/SOLR-1129> will give you
more insights.

Cheers
Avlesh

On Mon, Aug 10, 2009 at 10:58 AM, Ninad Raut <hb...@gmail.com>wrote:

> Hi,
> I have a Entitiy and a Value associated with it. I want to store this value
> as a <key,value> pair in Solr.
> I have a Java Object which I am mapping to Solr Doc using
> org.apache.solr.client.solrj.beans.Field . Can I also store a Map? and how
> can I do so?
> This is how I want it to be done:
> @Field
>  Map<String,String> entity;
>