Index and search properties
The example currently indexes the title, content and date. But Mindbreeze offers the possibility to save as many properties per object as you want.
Properties are specified with indexable.putProperty
.
indexable.putProperty(NamedValue.newBuilder() .setName("name") .addValue(ValueHelper.newBuilder("value")) );
In order to map a list value you simply need to invoke addValue
multiple times:
indexable.putProperty(NamedValue.newBuilder() .setName("name") .addValue(ValueHelper.newBuilder("value")) .addValue(ValueHelper.newBuilder("value")) );
The added properties are already contained in the index and can also be searched through. You can, for example, carry out a search for name:value and receive only those objects that have value set as the name.
Display of properties in the Mindbreeze client
So that the properties are also displayed in the Mindbreeze client, they need to be entered in the CategoryDescriptor. Each property that should be displayed must be entered as metadatum
. You can specify the translation for the term via name
elements.
<metadatum id="name"> <name xml:lang="de">Name de</name> <name xml:lang="en">Name en</name> </metadatum>
After the CategoryDescriptor is changed the plug-in must be newly packaged and loaded.