I should be able to do an "inline search" from QL

(User Story, Closed -> Fixed, Priority: Critical, Test Status: Unit tested , Reported By Bad Link: Thing 3y284oe not found, )
Summary: That is, there should be a _search() function that happens synchronously inside a QL expression, and lets you process the results yourself.
This is the heart of Eric's custom-search use case.
This function should produce a list of the results, sorted in score order, with each one wrapped in a rich Type that provides information about the found element. This should include at least:
  • The Thing or Tag that was found
  • The Property that was matched
  • The position of the match within that Property's value
It should take roughly the following parameters:
  • query -- (required) the actual search string that we're looking for
  • models -- (optional) if provided, restricts the search to Instances and Tags of the specified Models
  • properties -- (optional) if provided, restricts the search to the specified Properties
  • searchTags -- (optional, default true) if true, include unreified Tags in the search
  • searchThings -- (optional, default true) if true, include concrete Things in the search