Doug, thanks for the quick reply!

I have a separate question:

The FieldType I was using when I ran into this happened to be a
PreAnalyzedField.  I tried to specify an alternate parser to be used
instead of the default JsonPreAnalyzedParser.  To do this, I added the
parameter parserImpl to my FieldType definition in schema.xml, but this
produced an "invalid arguments" exception to be thrown by the FieldType
class.  It seems that PreAnalyzedField reads the parserImpl arg, but
doesn't remove it from the args map.  Did I do something wrong here or is
this a bug?

Thanks,
Dan


On Fri, Mar 21, 2014 at 11:18 AM, Doug Turnbull <
dturnb...@opensourceconnections.com> wrote:

> Daniel, I had a similar issue. The option is not in the normal FieldType,
> so I had to create my own FieldType in a Solr plugin that enabled payloads
> in term vectors. This mostly involved extending TextField, copy pasting
> "createField" from FieldType (TextField's parent class) and adding the one
> line
>
> public class PayloadTextField extends TextField {
>     @Override
> public IndexableField createField(SchemaField field, Object value, float
> boost) {
>             // copy-paste from FieldType.createField
>             //...
>             // this is the one-and-only line we change from what we inherit
> newType.setStoreTermVectorPayloads(field.storeTermVector()); return
> createField(field.getName(), val, newType, boost);
>         }
>
> }
>
> Unfortunately there's no method to override to redifine the Lucene field
> type that's used (newType) so you have to copy-paste this whole thing.
>
>
> On Fri, Mar 21, 2014 at 9:53 AM, Daniel Jamrog <djamog2...@gmail.com>
> wrote:
>
> > I see properties to enable term vectors, positions and offsets, but
> didn't
> > find one for payloads?  Did I just miss it?   If not, is this something
> > that may be added in the future?
> >
> > Thanks
> >
>
>
>
> --
> Doug Turnbull
> Search & Big Data Architect
> OpenSource Connections <http://o19s.com>
>

Reply via email to