Download the PHP package mapsight/pulp-search-index without Composer
On this page you can find all versions of the php package mapsight/pulp-search-index. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package pulp-search-index
Pulp Search Index
Search index of GeoJSON features for Pulp pipelines: build it from many sources, store it in a database, and search it as you type.
Features
- Small rows: One row per feature: id, title, subtitle, normalized words, place numbers, first coordinate. No geometry, no properties.
- German-friendly matching: Case, accents and punctuation do not count; umlauts, their ASCII spellings and ß/ss compare equally. Markup is stripped, script and style content never matches.
- Ranking: Source priority, exact place number, exact name, name prefix, all words in the name, then German alphabetical order with numbers by value. The same place in two sources appears once.
- Layer titles: A query word found in a title of the source (for example "stops") matches every place of that source.
- Database: Two tables in MySQL/MariaDB or SQLite, written in one transaction. Unchanged sources are not rewritten and keep their
updated_at.
Installation
Requires ext-intl (German collation) and mapsight/pulp-pdo.
Build and Store an Index
Each incoming file is one source, keyed by its file name. Its content may be a JSON string or a decoded FeatureCollection; its titles property (or the titles option) names the source.
The list of sources may come from anywhere, for example a configuration, or a CMS export of the map:
index() emits one file:
Without any source, it emits nothing, so a broken run never empties the database. Encode it with PulpJSON::encodeJSON() to keep a file instead of, or in addition to, the database.
toDatabase() creates search_index_sources and search_index_rows if needed (option prefix changes the names) and replaces the stored index in one transaction.
Search
$requestedlists sources as[priority, key], lower priority first;nullsearches every source with equal priority.- At most 40 places by default (
$limit). SearchIndexDatabase::titles($pdo, $keys)returns the titles of stored sources.SearchIndex::search()ranks an index held in memory the same way.
Same Results Elsewhere
Clients that build rows or rank places themselves, for example a browser searching the data already on its map, must follow the same rules. test/fixtures holds GeoJSON input, the expected rows, and expected rankings for a set of queries; check your implementation against them.
All versions of pulp-search-index with dependencies
ext-intl Version *
ext-mbstring Version *
ext-pdo Version *
mapsight/pulp Version *
mapsight/pulp-pdo Version *