Re: Custom handler/content stream loader
I did start start with this but it's a limited approach since it only works with text fields. Right now I'm using this with a bunch of custom fields extended to support payloads but that is expensive to maintain between versions, especially when APIs change so I'm looking for a less invasive way of supporting the same capability. I believe I have a Lucene solution for handling any field type, though i will obviously need to test it, if I can figure out the best way to do the custom building of the document and how to marshal it to the server and from the client. On Aug 23, 2016 11:05 PM, "Alexandre Rafalovitch"wrote: > Have you tried starting with the DelimitedPayloadTokenFilterFactory? > There is a sample configuration in the shipped examples: > https://github.com/apache/lucene-solr/blob/releases/ > lucene-solr/6.1.0/solr/example/example-DIH/solr/db/ > conf/managed-schema#L625 > > Regards, > Alex. > > Newsletter and resources for Solr beginners and intermediates: > http://www.solr-start.com/ > > > On 24 August 2016 at 04:22, Jamie Johnson wrote: > > I have a need to build custom field types that store additional metadata > at > > the field level in a payload. I was thinking that I could satisfy this > by > > building a custom UpdateRequest that captured this additional information > > in XML, but I am not really sure how to get at this additional > information > > on the server side. Would I need to implement a custom RequestHandler to > > handle the update, could I add a custom ContentStreamLoader to parse the > > XML, how do I customize the creation of the lucene document once I have > the > > XML? Any help/direction would really be appreciated. > > > > -Jamie >
Re: Custom handler/content stream loader
Have you tried starting with the DelimitedPayloadTokenFilterFactory? There is a sample configuration in the shipped examples: https://github.com/apache/lucene-solr/blob/releases/lucene-solr/6.1.0/solr/example/example-DIH/solr/db/conf/managed-schema#L625 Regards, Alex. Newsletter and resources for Solr beginners and intermediates: http://www.solr-start.com/ On 24 August 2016 at 04:22, Jamie Johnsonwrote: > I have a need to build custom field types that store additional metadata at > the field level in a payload. I was thinking that I could satisfy this by > building a custom UpdateRequest that captured this additional information > in XML, but I am not really sure how to get at this additional information > on the server side. Would I need to implement a custom RequestHandler to > handle the update, could I add a custom ContentStreamLoader to parse the > XML, how do I customize the creation of the lucene document once I have the > XML? Any help/direction would really be appreciated. > > -Jamie
Re: Custom handler/content stream loader
Ok, did a bit more digging. It looks like if I build a custom ContentStreamLoader I can create a custom AddOrUpdateCommand that is ultimately responsible for building the lucene document. So looks like if I build a custom UpdateRequestHandler I can register my custom ContentStreamLoader and I'll be set. Is this the appropriate course of action? Lastly, I always want to use my custom UpdateRequest when adding data to Solr from SolrJ but I don't see an easy way of doing this. Really what I need is to control the XML generated and being sent to the server and it looks like this is the best way, but I wonder given the inability to plugin a custom request writer (or something similar). Am I barking up the wrong tree? On Aug 23, 2016 5:22 PM, "Jamie Johnson"wrote: > I have a need to build custom field types that store additional metadata > at the field level in a payload. I was thinking that I could satisfy this > by building a custom UpdateRequest that captured this additional > information in XML, but I am not really sure how to get at this additional > information on the server side. Would I need to implement a custom > RequestHandler to handle the update, could I add a custom > ContentStreamLoader to parse the XML, how do I customize the creation of > the lucene document once I have the XML? Any help/direction would really > be appreciated. > > -Jamie >
Custom handler/content stream loader
I have a need to build custom field types that store additional metadata at the field level in a payload. I was thinking that I could satisfy this by building a custom UpdateRequest that captured this additional information in XML, but I am not really sure how to get at this additional information on the server side. Would I need to implement a custom RequestHandler to handle the update, could I add a custom ContentStreamLoader to parse the XML, how do I customize the creation of the lucene document once I have the XML? Any help/direction would really be appreciated. -Jamie