Is this a correct query to find all current articles that contain a given string?
SELECT p.page_namespace ,p.page_title FROM page p INNER JOIN revision r ON p.page_latest = r.rev_id INNER JOIN text t ON t.old_id = r.rev_text_id WHERE t.old_text like '%STRING%'
Thanks, DanB
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Daniel Barrett wrote:
Is this a correct query to find all current articles that contain a given string?
[snip]
WHERE t.old_text like '%STRING%'
In a default installation, most of the time, it will work, but you can't rely on it in general.
The value of old_text may be compressed, in an alternate encoding, or may contain a serialized PHP object which references an external blob or another text table entry or contains multiple text entries batch-compressed together.
- -- brion vibber (brion @ wikimedia.org)
Brion,
Would you recommend grabbing a SearchEngine object for the purpose he described instead? Does SearchEngine take the flags (external/compressed) into account?
-- Jim R. Wilson (jimbojw)
On Fri, Mar 28, 2008 at 12:50 PM, Brion Vibber brion@wikimedia.org wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Daniel Barrett wrote:
Is this a correct query to find all current articles that contain a given string?
[snip]
WHERE t.old_text like '%STRING%'
In a default installation, most of the time, it will work, but you can't rely on it in general.
The value of old_text may be compressed, in an alternate encoding, or may contain a serialized PHP object which references an external blob or another text table entry or contains multiple text entries batch-compressed together.
- -- brion vibber (brion @ wikimedia.org)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkftL+wACgkQwRnhpk1wk44XtACgw+3Rb19hubD6/NYxIPbshfbt nFwAoLVo8rracnop9FrfMh7w7ZgTRxlX =UWyx -----END PGP SIGNATURE-----
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jim R. Wilson wrote:
Would you recommend grabbing a SearchEngine object for the purpose he described instead? Does SearchEngine take the flags (external/compressed) into account?
The search uses a separate index table. Note that you can do exact phrase searches, which in many cases will work. However, some markup may be transformed, etc, so not all possible substring matches are going to work.
- -- brion vibber (brion @ wikimedia.org)
mediawiki-l@lists.wikimedia.org