Loading
Einstein Search
Solr-kyselyn muokkaaminen ja testaaminen

Solr-kyselyn muokkaaminen ja testaaminen

Lisää parametrejä, jotka viittaavat Atom XSL -tiedoston Solr-kyselyyn. Testaa sitten muutoksiasi varmistaaksesi, että tulokset näytetään XML Atom -muodossa.

  1. Lisää nämä parametrit Solr-kyselyyn: wt=xslt ja tr=file_name.xsl, jossa Atom XSL -tiedostosi nimi on tiedoston_nimi. Esimerkiksi tr=acme.xsl.
  2. Käytä tätä URL-osoitetta kyselysi testaamiseksi: http://localhost:8983/solr/techproducts/select?q=sd500&wt=xslt&tr=example_atom.xsl. Tässä testissä ydinnimi on techproducts ja hakutermi on sd500.
Esimerkki
Esimerkki

Alla on esimerkki Atom XML -muotoisesta vastauksesta.

<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Example Solr Atom 1.0 Feed</title>
   <subtitle>
     This has been formatted by the sample "example_atom.xsl" transform - use your own XSLT to get a nicer Atom feed.
   </subtitle>
   <author>
     <name>Apache Solr</name>
     <email>solr-user@lucene.apache.org</email>
   </author>
   <link rel="self" type="application/atom+xml" href="http://localhost:8983/solr/q=sd500&wt=xslt&tr=atom.xsl"/>
   <updated/>
   <id>tag:localhost,2007:example</id>
   <entry>
     <title>Canon PowerShot SD500</title>
     <link href="http://localhost:8983/solr/select?q=9885A004"/>
     <id>tag:localhost,2007:9885A004</id>
     <summary>
       3x zoop, 7.1 megapixel Digital ELPHmovie clips up to 640x480 @30 fps2.0" TFT LCD, 118,000 pixelsbuilt in flash, red-eye reduction
     </summary>
   <updated/>
   </entry>
</feed>
 
Ladataan
Salesforce Help | Article