[Zope] can I use incremental search without managable Indexes ?
Dieter Maurer
dieter at handshake.de
Thu Mar 22 16:15:07 EDT 2007
joachim wrote at 2007-3-21 19:06 +0100:
> ...
>I want to use Dieter Maurers incremental search. Can I do this without
>using his managable indexes ?
You need to use indexes that are willing to use "IncrementalSearch"
(you should use "IncrementalSearch2" in fact, as the "or" is too
slow for "IncrementalSearch").
Usually, an index works like this:
It fetches the IITreeSet containing the set of documents ids
indexed under the search term.
In the simple case (just one search term), it returns the result.
In more complex cases (e.g. a range search or a set of search terms),
it combines the sets from several look ups via "intersection"
or "multi_union" and returns this result.
The catalog framework combines all these results with "intersection".
This behaviour needs to change in order for "IncrementalSearch2" to
have an effect:
The IITreeSet for a search term is
wrapped by an "IBTree". The "IBTree" behaves like an intelligent
cursor which can either use the tree like access structure
or the linkage of the leaf nodes to quickly move through the
tree able to skip large parts of it without loading from storage.
In case, that partial results need to be combined,
"IAnd" and "IOr" need to be used (rather than "intersection"
and "multi_union").
If you are interested in the final result, the "asSet" method
needs to be called.
As you see from the decription, it is not difficult for an
index (and the querying framework) to use "IncrementalSearch2"
but it must be done.
Up to now, I only know of "Managable Index" that they do this.
By the way: there is no need that all indexes are "Managable Index"es.
AdvancedQuery can use "IncrementalSearch[2]" with indexes that support
them and work as usual with other indexes. Of course, you will get
fewer gains when some indexes cannot work incrementally.
--
Dieter
More information about the Zope
mailing list