Well there are multiple ways to do it.
Instead of using your own class (with annotated fields), you can directly
use an instance of SolrInputDocument for each document and call a
SolrServer.add(SolrInputDocument doc). For each SolrInputDocument, you can
use the addField(String name, Object value) to add data per field. For
dynamic fields, just pass in the full field name, "Germinait_ne" in your
case, as the first argument and 0.7 as the second one.

Search the way you were doing earlier.

Cheers
Avlesh

On Tue, Aug 11, 2009 at 11:20 AM, Ninad Raut <hbase.user.ni...@gmail.com>wrote:

> Hi Avlesh,
> Can you tell me a work around to this problem?? Till you have this
> resolved.:)
> Regards,
> Ninad.
>
> On Tue, Aug 11, 2009 at 11:16 AM, Avlesh Singh <avl...@gmail.com> wrote:
>
> > Ah! I guessed you were using it this way.
> >
> > I would need to reconfirm this, but there seems to be an inconsistency in
> > fetching data versus adding data via SolrJ w.r.t dynamic fields.
> > SOLR-1129<https://issues.apache.org/jira/browse/SOLR-1129>is
> > essentially about binding the response into a bean with a "Map" type
> > property. My guess is that SolrInputDocument is yet to "understand" the
> map
> > type property while firing update requests. I don't think it works in the
> > way you have used it :(
> >
> > Noble, can you please confirm this? If my guess turns out to be true,
> lets
> > open a JIRA issue asap.
> >
> > Cheers
> > Avlesh
> >
> > On Tue, Aug 11, 2009 at 10:45 AM, Ninad Raut <hbase.user.ni...@gmail.com
> > >wrote:
> >
> > > This is the POJO field mapping:
> > > @Field("*_ne")
> > > Map<String,String> ne = new HashMap<String,String>();
> > > this is how I set the value:
> > > Map<String,String> namedEntity = new HashMap<String,String>();
> > >  namedEntity.put("Germinait", "0.7");
> > >  ithursDocument.setNe(namedEntity);
> > >  server.addBean(ithursDocument);
> > >  server.commit();
> > > The schema had this dynamic field:
> > >  <dynamicField name="ne_*" type="string" indexed="true" stored="true"/>
> > > Let me know if something is missing. Thanks Avlesh.
> > > On Tue, Aug 11, 2009 at 10:34 AM, Avlesh Singh <avl...@gmail.com>
> wrote:
> > >
> > > > Weird that you get to see a field name like "ne_.*" in the response.
> I
> > am
> > > > afraid that you might be using the field in an incorrect way.
> > > > Can you share the field definition please? And a peek into how are
> you
> > > > populating these fields?
> > > >
> > > > Cheers
> > > > Avlesh
> > > >
> > > > On Tue, Aug 11, 2009 at 10:29 AM, Ninad Raut <
> > hbase.user.ni...@gmail.com
> > > > >wrote:
> > > >
> > > > > Hi,
> > > > > when I do a *:* query I can see the dynamic field as show below:
> > > > > <str name="ne_.*">{Germinait=0.7}</str>
> > > > > but when I try to query for the same like ne_Germinait:0.7 I get
> zero
> > > > > records.
> > > > > All the other field which are not dynamic can be easily queried.
> > > > > Can some one please tell me how to query for dynamic fields?
> > > > > Thanks.
> > > > > Ninad.
> > > > >
> > > >
> > >
> >
>

Reply via email to