Adding new field before import- using post.jar

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

Adding new field before import- using post.jar

Rajinimaski
Hi all,

I have xmls in a folder in the standard solr xml format. I was simply using
SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
fields to each document in the xml before doing a post.

What can be the effective way for doing this?


Thanks & Regards
Rajani
Reply | Threaded
Open this post in threaded view
|

Re: Adding new field before import- using post.jar

Jack Krupansky-2
1. Google for "XSLT tools".
2. Write a script that loads the XML, adds the fields, and writes the
updated XML.
3. Same as #2, but using Java.
4. If the fields are constants, set default values in the schema and then
the documents will automatically get those values when added. Take the
default value attributes out of the schema once you have input documents
that actually have the new field values.
5. Hire a consultant.

-- Jack Krupansky

-----Original Message-----
From: Rajani Maski
Sent: Friday, August 03, 2012 5:37 AM
To: [hidden email]
Subject: Adding new field before import- using post.jar

Hi all,

I have xmls in a folder in the standard solr xml format. I was simply using
SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
fields to each document in the xml before doing a post.

What can be the effective way for doing this?


Thanks & Regards
Rajani

Reply | Threaded
Open this post in threaded view
|

Re: Adding new field before import- using post.jar

Erik Hatcher-4
I hate to also add:

  6. Use DataImportHandler

It can index Solr XML, and could add field values, either statically or by template glue if you need to combine multiple field values somehow.

And in 4.0 you'll be able to use:

  7: scripting update processor

        Erik


On Aug 3, 2012, at 10:51 , Jack Krupansky wrote:

> 1. Google for "XSLT tools".
> 2. Write a script that loads the XML, adds the fields, and writes the updated XML.
> 3. Same as #2, but using Java.
> 4. If the fields are constants, set default values in the schema and then the documents will automatically get those values when added. Take the default value attributes out of the schema once you have input documents that actually have the new field values.
> 5. Hire a consultant.
>
> -- Jack Krupansky
>
> -----Original Message----- From: Rajani Maski
> Sent: Friday, August 03, 2012 5:37 AM
> To: [hidden email]
> Subject: Adding new field before import- using post.jar
>
> Hi all,
>
> I have xmls in a folder in the standard solr xml format. I was simply using
> SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
> fields to each document in the xml before doing a post.
>
> What can be the effective way for doing this?
>
>
> Thanks & Regards
> Rajani

Reply | Threaded
Open this post in threaded view
|

Re: Adding new field before import- using post.jar

Rajinimaski
Thank you for the reply.

8.How about Extending class : XmlUpdateRequestHandler? Is it possible and
good method?


Regards
Rajani






On Fri, Aug 3, 2012 at 8:32 PM, Erik Hatcher <[hidden email]> wrote:

> I hate to also add:
>
>   6. Use DataImportHandler
>
> It can index Solr XML, and could add field values, either statically or by
> template glue if you need to combine multiple field values somehow.
>
> And in 4.0 you'll be able to use:
>
>   7: scripting update processor
>
>         Erik
>
>
> On Aug 3, 2012, at 10:51 , Jack Krupansky wrote:
>
> > 1. Google for "XSLT tools".
> > 2. Write a script that loads the XML, adds the fields, and writes the
> updated XML.
> > 3. Same as #2, but using Java.
> > 4. If the fields are constants, set default values in the schema and
> then the documents will automatically get those values when added. Take the
> default value attributes out of the schema once you have input documents
> that actually have the new field values.
> > 5. Hire a consultant.
> >
> > -- Jack Krupansky
> >
> > -----Original Message----- From: Rajani Maski
> > Sent: Friday, August 03, 2012 5:37 AM
> > To: [hidden email]
> > Subject: Adding new field before import- using post.jar
> >
> > Hi all,
> >
> > I have xmls in a folder in the standard solr xml format. I was simply
> using
> > SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
> > fields to each document in the xml before doing a post.
> >
> > What can be the effective way for doing this?
> >
> >
> > Thanks & Regards
> > Rajani
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding new field before import- using post.jar

Jack Krupansky-2
In reply to this post by Rajinimaski
Where are the values of the three new fields coming from?

Are they constant/default values?
Computed from other fields in the XML?
From other XML files?
From a text file?
From a database?
Or where?

So, given a specific Solr XML input document, how will you be accessing the
three field values to add?

This may guide the approach that you could/should take.

-- Jack Krupansky

-----Original Message-----
From: Rajani Maski
Sent: Friday, August 03, 2012 5:37 AM
To: [hidden email]
Subject: Adding new field before import- using post.jar

Hi all,

I have xmls in a folder in the standard solr xml format. I was simply using
SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
fields to each document in the xml before doing a post.

What can be the effective way for doing this?


Thanks & Regards
Rajani

Reply | Threaded
Open this post in threaded view
|

Re: Adding new field before import- using post.jar

Rajinimaski
They are coming from text file.

SolrXML input documents are xmls in folder location. (To import these xmls,
I was using simple post.jar) Now, for each xml there is need to add 3
external new fields reading values from text file.


Regards
Rajani

On Sat, Aug 4, 2012 at 10:59 PM, Jack Krupansky <[hidden email]>wrote:

> Where are the values of the three new fields coming from?
>
> Are they constant/default values?
> Computed from other fields in the XML?
> From other XML files?
> From a text file?
> From a database?
> Or where?
>
> So, given a specific Solr XML input document, how will you be accessing
> the three field values to add?
>
> This may guide the approach that you could/should take.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Rajani Maski
> Sent: Friday, August 03, 2012 5:37 AM
> To: [hidden email]
> Subject: Adding new field before import- using post.jar
>
> Hi all,
>
> I have xmls in a folder in the standard solr xml format. I was simply using
> SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
> fields to each document in the xml before doing a post.
>
> What can be the effective way for doing this?
>
>
> Thanks & Regards
> Rajani
>
Reply | Threaded
Open this post in threaded view
|

Re: Adding new field before import- using post.jar

Jack Krupansky-2
Sounds like a perl script would be sufficient.

-- Jack Krupansky

-----Original Message-----
From: Rajani Maski
Sent: Saturday, August 04, 2012 2:23 PM
To: [hidden email]
Subject: Re: Adding new field before import- using post.jar

They are coming from text file.

SolrXML input documents are xmls in folder location. (To import these xmls,
I was using simple post.jar) Now, for each xml there is need to add 3
external new fields reading values from text file.


Regards
Rajani

On Sat, Aug 4, 2012 at 10:59 PM, Jack Krupansky
<[hidden email]>wrote:

> Where are the values of the three new fields coming from?
>
> Are they constant/default values?
> Computed from other fields in the XML?
> From other XML files?
> From a text file?
> From a database?
> Or where?
>
> So, given a specific Solr XML input document, how will you be accessing
> the three field values to add?
>
> This may guide the approach that you could/should take.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Rajani Maski
> Sent: Friday, August 03, 2012 5:37 AM
> To: [hidden email]
> Subject: Adding new field before import- using post.jar
>
> Hi all,
>
> I have xmls in a folder in the standard solr xml format. I was simply
> using
> SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
> fields to each document in the xml before doing a post.
>
> What can be the effective way for doing this?
>
>
> Thanks & Regards
> Rajani
>

Reply | Threaded
Open this post in threaded view
|

Re: Adding new field before import- using post.jar

Lance Norskog-2
For a permanent solution, DataImportHandler and the scripting update
handler are the best choices- they are small files and live inside
Solr.

On Sat, Aug 4, 2012 at 12:02 PM, Jack Krupansky <[hidden email]> wrote:

> Sounds like a perl script would be sufficient.
>
>
> -- Jack Krupansky
>
> -----Original Message----- From: Rajani Maski
> Sent: Saturday, August 04, 2012 2:23 PM
> To: [hidden email]
> Subject: Re: Adding new field before import- using post.jar
>
>
> They are coming from text file.
>
> SolrXML input documents are xmls in folder location. (To import these xmls,
> I was using simple post.jar) Now, for each xml there is need to add 3
> external new fields reading values from text file.
>
>
> Regards
> Rajani
>
> On Sat, Aug 4, 2012 at 10:59 PM, Jack Krupansky
> <[hidden email]>wrote:
>
>> Where are the values of the three new fields coming from?
>>
>> Are they constant/default values?
>> Computed from other fields in the XML?
>> From other XML files?
>> From a text file?
>> From a database?
>> Or where?
>>
>> So, given a specific Solr XML input document, how will you be accessing
>> the three field values to add?
>>
>> This may guide the approach that you could/should take.
>>
>>
>> -- Jack Krupansky
>>
>> -----Original Message----- From: Rajani Maski
>> Sent: Friday, August 03, 2012 5:37 AM
>> To: [hidden email]
>> Subject: Adding new field before import- using post.jar
>>
>> Hi all,
>>
>> I have xmls in a folder in the standard solr xml format. I was simply
>> using
>> SimplePostTool.java to import these xmls to solr. Now I have to add 3 new
>> fields to each document in the xml before doing a post.
>>
>> What can be the effective way for doing this?
>>
>>
>> Thanks & Regards
>> Rajani
>>
>



--
Lance Norskog
[hidden email]