Index types by resource ID for exact type searches without type name escaping problems
Currently, there will be problems in type-based index searches, if the name of the searched type contains whitespace, such as Shut-off valve actuator@1
. The searches will not return any results. Of course we could/should fix query quoting/escaping so that also such queries would work, but there is a better alternative for type searches.
We should add the resource IDs of each resource's type hierarchy into the index as long numbers. Those longs can then be searched for in exact fashion without problems caused by whitespaces and query term parsing.
Lucene supports adding a single Field
multiple times to a document and that would actually be the cleanest way of indexing e.g. this type information: as N
TypeId
fields with Long
values. However, to support this kind "multi-field"-indexing, the existing indexing code would need quite a lot of changes so it is just simpler to add the type resource id as a single Text(String)-type field which concatenates type resource ids as strings joined together by one whitespace. None of the existing index fields will be touched to keep backwards compatible. However, any code using Types:....
query strings should be checked and considered for migration to use TypeId:...
queries.
This might be a bit related to #21 (closed). However, those changes were already a major improvement over the previous way of working so these changes are still needed and there's nothing to revert.