Skip to content

Commit

Permalink
Updated federated search html results mapping example
Browse files Browse the repository at this point in the history
  • Loading branch information
luccioman committed Feb 1, 2019
1 parent b342fdf commit 0dc5cfe
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions defaults/federatecfg/npmjs.html.map.properties
@@ -1,6 +1,5 @@
# www.npmjs.com HTML search results mapping # www.npmjs.com (2019-02-01) HTML search results mapping
# OpenSearch description : https://www.npmjs.com/opensearch.xml # search template URL : https://www.npmjs.com/search?q={searchTerms}
# 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 # 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 # When possible, it is preferable to use an OpenSearch URL providing results as standard RSS or Atom feed as mapping is generic
Expand All @@ -9,16 +8,16 @@
# Character encoding is assumed to be ISO-8859-1 # Character encoding is assumed to be ISO-8859-1


# Result node selector (required) # Result node selector (required)
# In this example, a list item such as : <li class="package-details css-ywvx7i" data-reactid="n"> # In this example, a section such as : <section class="package-list-item__capsule___3_4Eo flex flex-row-reverse pl1-ns pt3 pb2 ph1 bb b--black-10 ">...</section>
_result=.package-details _result=section[class*=package-list-item]


# Result link selector relative to the selected result block (required) # 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> # In this example, a link such as <div class="flex flex-row items-end pr3"><a target="_self" href="/package/packafename">...</a></div>
_sku=.name _sku=div.items-end a


# field mappings # field mappings
# YaCyFieldname = HTML text node selector, relative to the result block # 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 # In this example title is the text of the link so it has the same selector
title=.name title=h3[class*=package-list-item__title]
# In this example the description is in a paragraph tag such as <p class="description css-zqstoe">Package description</p> # In this example the description is in a paragraph tag such as <p class="description css-zqstoe">Package description</p>
description_txt=.description description_txt=p[class*=package-list-item__description]

0 comments on commit 0dc5cfe

Please sign in to comment.