Re: How could I set multi-value for a field in DataImporter
I found the answer from source code. Using a Collection as value. Thanks any way 2011/4/1 kun xiong > Stefan, > > Thanks very much for your quick reply. > > Actually I have to write a CustomDataImporter class to full-import data and > index them all. > > So it should be done in java code and schema.xml. > > When I write a CustomDataImporter, I have to implement a nextRow() method, > which return a map. And also schema,xml have a multiValued > label for each field. > > I am wondering how could I utilize it. > > I believe there must be several ways to make it multi-valued, using > analyzer or copyField. I am finding a efficient and easiest way that I don't > have to change data format. > > Kun > > 2011/3/31 Stefan Matheis > >> Kun, >> >> it should be enough to use the same field second time, like this: >> >> value2 >> >> Regards >> Stefan >> >> On Thu, Mar 31, 2011 at 11:39 AM, kun xiong wrote: >> > Since the interface of DataImporter return a Map, I can't put multi >> value >> > for a same field, right? >> > >> > Example: >> > >> > I write a class extending DataImporter, and want to index {"value1", >> > "value2"} for field "name". >> > >> > How should I do? >> > >> > Many thanks. >> > >> > Kun >> > >> > >
Re: How could I set multi-value for a field in DataImporter
Stefan, Thanks very much for your quick reply. Actually I have to write a CustomDataImporter class to full-import data and index them all. So it should be done in java code and schema.xml. When I write a CustomDataImporter, I have to implement a nextRow() method, which return a map. And also schema,xml have a multiValued label for each field. I am wondering how could I utilize it. I believe there must be several ways to make it multi-valued, using analyzer or copyField. I am finding a efficient and easiest way that I don't have to change data format. Kun 2011/3/31 Stefan Matheis > Kun, > > it should be enough to use the same field second time, like this: > > value2 > > Regards > Stefan > > On Thu, Mar 31, 2011 at 11:39 AM, kun xiong wrote: > > Since the interface of DataImporter return a Map, I can't put multi value > > for a same field, right? > > > > Example: > > > > I write a class extending DataImporter, and want to index {"value1", > > "value2"} for field "name". > > > > How should I do? > > > > Many thanks. > > > > Kun > > >
Re: How could I set multi-value for a field in DataImporter
Kun, it should be enough to use the same field second time, like this: value2 Regards Stefan On Thu, Mar 31, 2011 at 11:39 AM, kun xiong wrote: > Since the interface of DataImporter return a Map, I can't put multi value > for a same field, right? > > Example: > > I write a class extending DataImporter, and want to index {"value1", > "value2"} for field "name". > > How should I do? > > Many thanks. > > Kun >
How could I set multi-value for a field in DataImporter
Since the interface of DataImporter return a Map, I can't put multi value for a same field, right? Example: I write a class extending DataImporter, and want to index {"value1", "value2"} for field "name". How should I do? Many thanks. Kun