package org.infinispan.protostream.sampledomain;

import org.infinispan.protostream.annotations.ProtoField;

/**
 * An annotated entity.
 *
 * @author anistor@redhat.com
 * @since 3.0
 */
public class Note {

   private String text;

   private User author;

   @ProtoField(number = 1)
   public String getText() {
      return text;
   }

   public void setText(String text) {
      this.text = text;
   }

   @ProtoField(number = 2)
   public User getAuthor() {
      return author;
   }

   public void setAuthor(User author) {
      this.author = author;
   }

   @Override
   public String toString() {
      return "Note{" +
            "text='" + text + '\'' +
            ", author=" + author +
            '}';
   }
}

@@ -43,16 +43,72 @@
 omain;%0A%0A
+import org.infinispan.protostream.annotations.ProtoDoc;%0A
 import o
@@ -157,16 +157,16 @@
 oField;%0A
-
 %0A/**%0A * 
@@ -237,16 +237,38 @@
 3.0%0A */%0A
+@ProtoDoc(%22@Indexed%22)%0A
 public c
@@ -330,16 +330,46 @@
 uthor;%0A%0A
+   @ProtoDoc(%22@IndexedField%22)%0A
    @Prot
@@ -505,24 +505,54 @@
 text;%0A   %7D%0A%0A
+   @ProtoDoc(%22@IndexedField%22)%0A
    @ProtoFie

Use selective field indexing in Note sample class