I think this LuceneSerializer API needs a slight tweak. In order to
implement the proposed FlatFormatSerializer, the serializer needs access to
the index configuration to see what fields the user wants to index. We
should also pass the LuceneIndex to the serializer.

public interface LuceneSerializer {
  Collection<Document> toDocuments(Object value, *LuceneIndex index*);
}

On Thu, Jul 13, 2017 at 2:19 PM, Dan Smith <dsm...@pivotal.io> wrote:

> On Thu, Jul 13, 2017 at 11:26 AM, Jacob Barrett <jbarr...@pivotal.io>
> wrote:
>
>> Collections are really tough in Lucene because you have to flatten the
>> document. I struggled against it for some time on a project a few years ago
>> and ultimately decided to index the relationships separately and then merge
>> the results.
>>
>
> Yeah, this is part of the motivation for providing the LuceneSerializer
> API. We can provide a built in serializer that just flattens all nested
> collections into a single field, but users could also write their own
> implementation that converts the nested objects into separate lucene
> documents and use some of query classes in org.apache.lucene.search.join if
> they really need to.
>
> It's not part of the goal here, but I think this LuceneSerializer API
> could also make it easier to do spatial indexing, because users could
> create a serializer that converts their gemfire object into a Lucene
> document with GeoPointFields.
>
> -Dan
>
>

Reply via email to