exp:expurlsuggest
Suggest new targets for the rows of a URL map that have none, by how alike their old address is to the addresses and names of this site's pages.
Script bin/php/expurlsuggest.php, code in kernel/private/classes/commands/expurlsuggest.php. Run it from the installation root, as the user the web server runs as:
./console exp:expurlsuggest --help
./console exp:url:suggest --help
php bin/php/expurlsuggest.php --helpHelp text
Suggest new targets for a URL map
For every row without a new_url, compares the old address (its last element most, without endings
such as .html, transliterated) with the URL aliases and names of the visible pages of the siteaccess
of -s and scores the best ones from 0 to 100. With --fill-above the best one is written into new_url
when it scores that much; the others are listed in the row's note. The map is written again, with
every row; nothing is imported.
./console exp:url:suggest var/tmp/old-site.csv --output=var/tmp/old-site-suggested.csv
./console exp:url:suggest var/tmp/old-site.csv -s site --fill-above=85 --output=var/tmp/map.xlsx
./console exp:url:suggest var/tmp/old-site.csv --top=5 --report=var/tmp/suggestions.json --output=var/tmp/map.csvOptions
| Option | Value | Help |
|---|---|---|
--output | required | The file to write (default the standard output; needed for xlsx and ods) |
--output-format | required | import, export: what the command prints, text (default) or json (the machine output exp-url/1); --format is the file's format there; from-sitemap, from-404, suggest: the format of the file written (csv, json, xlsx, ods, apache, nginx; default from --output, else csv) |
--format | required | import: the format of the file (csv, json, xlsx, ods, apache, nginx; default from its name or content); export: the format to write (default from --output, else csv); batches, undo, from-sitemap, from-404, suggest, test: text (default) or json (the machine output exp-url/1) |
--top | required | suggest: the suggestions per row (default 3) |
--fill-above | required | suggest: write the best suggestion into new_url when it scores this much or more (0 to 100; never a tie; default: never) |
--min-score | required | suggest: the lowest score suggested (0 to 100, default 30) |
--report | required | import: also write the plan, row by row, to this file (.json, or .csv); suggest, test: also write every row with its suggestions or its result to this file (.json, or .csv) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Arguments: [file].
Related
Generated by ./console exp:help:examples from bin/php/expurlsuggest.php, kernel/private/classes/commands/expurlsuggest.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.