A built-in
LuceneSerializer
to parse user's nested object into a flat format, i.e. a
single document. Each nested object will become a set of fields, with field name in format of
contacts.name, contacts.homepage.title.
Here is a example of usage:
User needs to explicitly setLuceneSerializer with an instance of this class, and specify nested
objects' indexed fields in following format:
luceneService.createIndexFactory().setLuceneSerializer(new FlatFormatSerializer())
.addField("name").addField("contacts.name").addField("contacts.email", new KeywordAnalyzer())
.addField("contacts.address").addField("contacts.homepage.content") .create(INDEX_NAME,
REGION_NAME);
Region region = createRegion(REGION_NAME, RegionShortcut.PARTITION);
When querying, use the same dot-separated index field name, such as contacts.homepage.content
LuceneQuery query = luceneService.createLuceneQueryFactory().create(INDEX_NAME, REGION_NAME,
"contacts.homepage.content:Hello*", "name");
results = query.findPages();