Fix tree node search indexing
Fix tree node search indexing

The code had several problems:
- the group by query broke when default ordering was added to the
model
- it was assumed that only level 0 nodes had
null ontologyword_references

City-of-Helsinki/smbackend,City-of-Helsinki/smbackend