ezsystems/ezpublish-kernel — pull request #1100 by andrerom (2014-11-23 13:36:29+00:00)
Title: [Research][Solr] Implement Location Search using block join

*!!! Not for code review !!!*

This is just a bit of research to facilitate further offline design discussions around search in generally, and solr data modeling specifically.

## Modeling
Locations are indexed as childs of content, which affects queries in the following way:
- For content queries {!parent} is added to location specific criteria.
- For location queries, {!child} is added on content criteria, and for partial content sort support some content attributes are also indexed on location document.

## Solr requirements
Uses block join(solr 4.5), including json support(solr 4.8), and also uses child doc transformer (solr 4.9) but only for detecting which index to delete/update on deleteLocation().

## Design issues with this approach:
- Only way to get sorting to work asis is to do normalization across parent and child
-- Maybe copyField or other approaches can be used to
- Alternative would be to always query content, and use "fl" to query which "location" child to include in result
-- However then you probably won't be able to sort on data on the location "hit"
-- And Content will only show up once even if having several location hits
-- This will need the to know the "context" aka witch root location to use (so LocationQuery->rootLocation is needed)

## Current Integration test failures:
- Errors: Caused by Solr and parent/child issues in some queries
- Failures: Repo isn't properly removing subtrees from index on subtree operations
-- This should also be an issue with ElasticSearch unless @pspanja does some tricks ;)