internal package
Foswiki::Query::HoistREs Store/QueryAlgorithms/BruteForce.pm
for an example of usage.
Note that this hoisting is very crude. At this point of time the
functions don't attempt to do anything complicated, like re-ordering
the query. They simply hoist up expressions on either side of an AND,
where the expressions apply to a single domain.
The ideal would be to rewrite the query for AND/OR evaluation i.e. an
expression of the form (A and B) or (C and D). However this is
complicated by the fact that there are three search domains (the web
name, the topic name, and the topic text) that may be freely
intermixed in the query, but cannot be mixed in the generated search
expressions. The problem becomes one of rewriting the query to
separate these three sets. For example, a query such as:
name='Topic' OR Field='maes' OR web='Trash'
requires three searches. We have to filter on name='Topic', and
separately filter on Field='maes' and then union the sets.
This gets complicated when the sets are intermixed; for example,
(name='Topic' OR Field='maes') AND (web='Trash' OR Maes="field")
Because the Field= terms on each side of the AND could potentially
match any topic, we can't usefully hoist the name= or web= sub-terms.
We can, however, hoist the Field subqueries. Now, what happens when we
have an expression like this?
(name='Topic' OR Field='maes') AND (web='Trash')
Obviously we can pre-filter on the web='Trash' term, but we can't
filter on name="Topic" because it is part of an OR.
If you think I'm making this too complicated, please feel free to
implement your own superior heuristics!
StaticMethod
hoist($query) → \%regex_lists ![]() |
© 2025 D.Soost & D.Marxsen - All rights reserved © Of all articles by authors Trademarks are the property of their respective owners © Logo by Wikipedia, modified by Administrator | Impressum Disclaimer Datenschutzerklärung |