01023: Include PTVs and values and PVs and values in pageindex

Summary: Include PTVs and values and PVs and values in pageindex
Created: 2008-04-19 13:39
Status: Open
Category: CoreCandidate
Assigned:
Priority: 43332X
Version: 2.2.0-beta65
OS:

Description: Currently searches on terms or pagenames are fairly quick but searches on PTVs or PVs (especially the relatively commonly desired feature of searching by title) require the long process of opening each page individually.

Could the .pageindex definition be expanded to include a PTV and/or PV section? Multi-line values would be awkward but presumably could be truncated or something...

It seems like it could speed up searches significantly.

Another option would be to put some hooks into scripts/pagelist.php for recipes to work off of. Currently as far as I can see the only option to make modifications to this functionality is to modify the core source with all the attendant difficulties.

Perhaps a recipe could be put together with existing hooks/capability (even just register_shutdown_function()) to add an additional .pageindex (perhaps .titleindex? .ptvindex? .varindex?) which would cache values. However, are the hooks available in (:pagelist ...:) to use a cache like this?

Granted the code in scripts/pagelist.php is tight and optimized and adding features might work against this -- I just know there are a lot of sites & recipes that do a lot of searching against PTVs or PVs and they would be helped in a big way.

HansB: I can see the desirability having PTVs in pageindex, but doing so could lead to a huge bloating of the index, since PTVs can be defined in many ways and their values are not restricted to single words, nor necessarily to single lines. I don't think we want whole blocks of text being put in the index. If indexing PTVs/values is implememted, then perhaps the values need to be limited to some first words only?

Not only PTVs can be defined in many ways, they can be redefined after pages are saved, for example, the (::var:value::) format. Then, the .pageindex will obviously be useless. --Petko July 09, 2009, at 03:19 AM

i vote for it. it could be turned off by default, with a switch and a stern warning about PTV .pageindex bloating. other possibilities might include:

  • ability to turn it on only for certain groups/pages
  • perhaps there's some way to enable a markup scheme that one can use to indicate which PTVs get indexed, and which ones don't?

overtones99 July 24, 2009, at 12:31 PM

I like the idea of being able to add PTVs selectively. Perhaps only add those that are explicitly specified in some config setting. That would prevent bloat at least. -- DaveG September 21, 2009

Perhaps only adding to the index those defined with (:ptv:value:) markup? simon September 22, 2009, at 05:39 PM