Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

payload in the development of lucene plugin pipelines #33

Closed
ziqizhang opened this issue Jan 12, 2017 · 0 comments
Closed

payload in the development of lucene plugin pipelines #33

ziqizhang opened this issue Jan 12, 2017 · 0 comments

Comments

@ziqizhang
Copy link
Owner

Lucene supports attaching information to a token produced in the plugin pipeline. This information is attached in a payload attribute, which takes a BytesRef object that is constructed on a byte[] or string.

The best way to attach such information, based on experience so far, is to create a BytesRef object from a String (which can be a JSON string and using Gson library to convert between objects and strings), then convert the BytesRef object by calling BytesRef.utf8tostring.

DO NOT using serialisation or custom byte[] to construct BytesRef objects. This has caused many inconsistent write/read time data that are inexplicable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant