[
https://issues.jboss.org/browse/ISPN-3718?page=com.atlassian.jira.plugin....
]
Adrian Nistor commented on ISPN-3718:
-------------------------------------
Yes, we need those options to bear more complex values than just a boolean. A little known
aspect of protobuf options is they are very rich and can represent tuples and arrays also,
even arrays of tuples or tuples of arrays. You get the idea :) So it would be perfectly
doable even to completely emulate the whole HS indexing annotations.
Here's a valid protobuf example of a field being annotated with an option:
{code}
message User {
//...
required string name = 3 [
(infinispan.Field) = {
indexed : true,
analyzed : false,
some_array : [111, 222, 333], /* yes! even arrays of values */
}
];
//...
}
{code}
The stuff between [ ] that follows a field declaration is the list of options attached to
the field - its metadata/annotations. There can be multiple options, separated with comma.
Unfortunately the protobuf syntax is not very nice and requires you to surround the option
name in (). The value of the option is either a scalar value or a tuple surrounded by { }.
The structure of the option has to be defined in advance (not shown here), so its usage
can be validated by the protobuf schema compiler. Options values can have defaults, so the
verbosity can be drastically reduced.
So, would you consider this as a valid approach to define our indexing metadata?
Select which protobuf fields to index
-------------------------------------
Key: ISPN-3718
URL:
https://issues.jboss.org/browse/ISPN-3718
Project: Infinispan
Issue Type: Feature Request
Components: Embedded Querying
Reporter: Adrian Nistor
Assignee: Adrian Nistor
Currently we index all fields. An interesting idea is to use a custom protobuf Option
(see 'Custom Options' section here
https://developers.google.com/protocol-buffers/docs/proto) to indicate which message types
and specifically which fields should be indexed, similar to Hibernate Search annotations.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira