mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
bf16de29c1
Many OpenSearch systems do not provide results as standard RSS/Atom feeds but only as HTML. This modification add some support for custom OpenSearch HTML results through the use of mapping files (as already done for federated Solr search) relying on CSS-like selectors to retrieve information from HTML content. An example mapping file is provided to map results from the www.npmjs.com OpenSearch URL.
24 lines
1.4 KiB
Properties
24 lines
1.4 KiB
Properties
# www.npmjs.com HTML search results mapping
|
|
# OpenSearch description : https://www.npmjs.com/opensearch.xml
|
|
# OpenSearch template URL : https://www.npmjs.com/search?q={searchTerms}
|
|
|
|
# This is an example mapping file for OpenSearch systems or search APIs providing results only as HTML
|
|
# When possible, it is preferable to use an OpenSearch URL providing results as standard RSS or Atom feed as mapping is generic
|
|
# Selectors are using CSS or JQuery-like syntax, as described at https://jsoup.org/apidocs/org/jsoup/select/Selector.html
|
|
# Standard Java properties file syntax is used here instead of usual YaCy Configuration syntax to easily allow '#' characters in values (example : _result=div#result li)
|
|
# Character encoding is assumed to be ISO-8859-1
|
|
|
|
# Result node selector (required)
|
|
# In this example, a list item such as : <li class="package-details css-ywvx7i" data-reactid="n">
|
|
_result=.package-details
|
|
|
|
# Result link selector relative to the selected result block (required)
|
|
# In this example, a link such as <a href="https://www.npmjs.com/package/packageName" class="name css-1nx9rl1">packageName</a>
|
|
_sku=.name
|
|
|
|
# field mappings
|
|
# YaCyFieldname = HTML text node selector, relative to the result block
|
|
# In this example title is the text of the link so it has the same selector
|
|
title=.name
|
|
# In this example the description is in a paragraph tag such as <p class="description css-zqstoe">Package description</p>
|
|
description_txt=.description |