On Wed, May 27, 2009 at 5:41 PM, Kir4 <silv...@gmail.com> wrote: > > Hi guys!! > I have started studying Solr, and I was wondering if anyone would be so kind > as to help me understand a couple of things. > > I have XML data that looks like this: > <doc> > <field name="id">ID-0</field> > <field name="post"> > Cheap hotels in Paris? > </field> > </doc> > > I want to search the data based on a location hierarchy, so I must modify > the XML data to obtain something like this: > > <doc> > <field name="id">ID-0</field> > <field name="city">Paris</field> > <field name="country">France</field> > <field name="continent">Europe</field> > <field name="post"> > Cheap hotels in Paris? > </field> > </doc> > > I intend to create a plugin to do this using Geonames data (I will use > Geonames hierarchy and resource codes, not "Paris", "city", etc...) at index > time. I will have to parse the text in the "post" field, check for each word > a database (or XML files) to see if they are names of places, obtain the > elements of the hierarchy, and place them in each field. > > My questions: > 1) am I forcing Solr to do things it wasn't made for? would it be better to > process the XML data BEFORE feeding it to Solr? I guess this is best done outside of Solr > 2) could you suggest a function I could modify? I was considering rewriting > copyField; If you wish to plugin your code try this http://wiki.apache.org/solr/UpdateRequestProcessor > 3) if I rewrite an analyzer to create these fields, is there any way to > display the output? (the tokens) > > Thanks in advance!!! > Kir4. =) > -- > View this message in context: > http://www.nabble.com/creating-new-fields-at-index-time---is-it-possible--tp23741267p23741267.html > Sent from the Solr - User mailing list archive at Nabble.com. > >
-- ----------------------------------------------------- Noble Paul | Principal Engineer| AOL | http://aol.com