Skip to content

Commit

Permalink
manual search docs added
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 13, 2019
1 parent 84519ed commit 286d7e1
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 8 deletions.
Binary file modified build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified build/.doctrees/jibia_search.doctree
Binary file not shown.
40 changes: 39 additions & 1 deletion build/_sources/jibia_search.rst.txt
Expand Up @@ -38,4 +38,42 @@ Besides the token parameter, several other parameters can be set in the script t
This value can be set to true or false. If this is set to true the search results will use predefined style. The parameter defaults to true.

result_classname
This parameter can be set to define the class name for autocomplete suggestions. This parameter defaults to "search_result".
This parameter can be set to define the class name for autocomplete suggestions. This parameter defaults to "search_result".


Example of manual autocomplete handling
=============================
If you wish to have more control over what happens under the hood, instead you can write the logic for this yourself.
To do this you first have to load your product feed into Jibia. You can do that with the following request:

::
curl -X POST \
https://api.jibia.nl/api/initialize_search \
-H 'Content-Type: application/json' \
-d '{"feed_url": FEED_URL}'
.. glossary::

feed_url
The URL to your product feed.

This request returns a token you can use for the search. Save this token somewhere. It might take several minutes before your feed is fully initialized.

The autocomplete can be called with the following request:

::

curl -X GET \
'https://api.jibia.nl/api/do_search?query={QUERY}&token={TOKEN}&n={N}'

.. glossary::

query
The query for the autocomplete.

token
The token from the response of your call to initialize_search

n
The amount of autocomplete results

30 changes: 29 additions & 1 deletion build/genindex.html
Expand Up @@ -81,6 +81,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html">Search</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#simple-html-example">Simple HTML Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#example-of-manual-autocomplete-handling">Example of manual autocomplete handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="contact.html">Contact</a></li>
</ul>

Expand Down Expand Up @@ -148,10 +149,29 @@
<h1 id="index">Index</h1>

<div class="genindex-jumpbox">
<a href="#R"><strong>R</strong></a>
<a href="#F"><strong>F</strong></a>
| <a href="#Q"><strong>Q</strong></a>
| <a href="#R"><strong>R</strong></a>
| <a href="#S"><strong>S</strong></a>
| <a href="#T"><strong>T</strong></a>

</div>
<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="jibia_search.html#term-feed-url"><strong>feed_url</strong></a>
</li>
</ul></td>
</tr></table>

<h2 id="Q">Q</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="jibia_search.html#term-query"><strong>query</strong></a>
</li>
</ul></td>
</tr></table>

<h2 id="R">R</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
Expand All @@ -168,6 +188,14 @@ <h2 id="S">S</h2>
</ul></td>
</tr></table>

<h2 id="T">T</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="jibia_search.html#term-token"><strong>token</strong></a>
</li>
</ul></td>
</tr></table>



</div>
Expand Down
2 changes: 2 additions & 0 deletions build/index.html
Expand Up @@ -81,6 +81,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html">Search</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#simple-html-example">Simple HTML Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#example-of-manual-autocomplete-handling">Example of manual autocomplete handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="contact.html">Contact</a></li>
</ul>

Expand Down Expand Up @@ -159,6 +160,7 @@ <h1>Contact<a class="headerlink" href="#contact" title="Permalink to this headli
<ul>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html">Search</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#simple-html-example">Simple HTML Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#example-of-manual-autocomplete-handling">Example of manual autocomplete handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="contact.html">Contact</a></li>
</ul>
</div>
Expand Down
38 changes: 34 additions & 4 deletions build/jibia_search.html
Expand Up @@ -29,7 +29,7 @@
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Recommendations" href="recommendations.html" />
<link rel="next" title="Contact" href="contact.html" />
<link rel="prev" title="Welcome to Jibia’s documentation!" href="index.html" />


Expand Down Expand Up @@ -82,8 +82,7 @@
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Search</a></li>
<li class="toctree-l1"><a class="reference internal" href="#simple-html-example">Simple HTML Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="recommendations.html">Recommendations</a></li>
<li class="toctree-l1"><a class="reference internal" href="recommendations.html#simple-html-example">Simple HTML Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="#example-of-manual-autocomplete-handling">Example of manual autocomplete handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="contact.html">Contact</a></li>
</ul>

Expand Down Expand Up @@ -176,6 +175,37 @@ <h1>Simple HTML Example<a class="headerlink" href="#simple-html-example" title="
<dt id="term-result-classname">result_classname</dt>
<dd>This parameter can be set to define the class name for autocomplete suggestions. This parameter defaults to “search_result”.</dd>
</dl>
</div>
<div class="section" id="example-of-manual-autocomplete-handling">
<h1>Example of manual autocomplete handling<a class="headerlink" href="#example-of-manual-autocomplete-handling" title="Permalink to this headline"></a></h1>
<p>If you wish to have more control over what happens under the hood, instead you can write the logic for this yourself.
To do this you first have to load your product feed into Jibia. You can do that with the following request:</p>
<dl class="docutils">
<dt>::</dt>
<dd><dl class="first last docutils">
<dt>curl -X POST </dt>
<dd><a class="reference external" href="https://api.jibia.nl/api/initialize_search">https://api.jibia.nl/api/initialize_search</a> -H ‘Content-Type: application/json’ -d ‘{“feed_url”: FEED_URL}’</dd>
</dl>
</dd>
</dl>
<dl class="glossary docutils">
<dt id="term-feed-url">feed_url</dt>
<dd>The URL to your product feed.</dd>
</dl>
<p>This request returns a token you can use for the search. Save this token somewhere. It might take several minutes before your feed is fully initialized.</p>
<p>The autocomplete can be called with the following request:</p>
<dl class="docutils">
<dt>curl -X GET </dt>
<dd><a class="reference external" href="https://api.jibia.nl/api/do_search">https://api.jibia.nl/api/do_search</a>?query={QUERY}&amp;token={TOKEN}&amp;n={N}’</dd>
</dl>
<dl class="glossary docutils">
<dt id="term-query">query</dt>
<dd>The query for the autocomplete.</dd>
<dt id="term-token">token</dt>
<dd><p class="first">The token from the response of your call to initialize_search</p>
<p class="last">The amount of autocomplete results</p>
</dd>
</dl>
</div>


Expand All @@ -186,7 +216,7 @@ <h1>Simple HTML Example<a class="headerlink" href="#simple-html-example" title="

<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">

<a href="recommendations.html" class="btn btn-neutral float-right" title="Recommendations" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="contact.html" class="btn btn-neutral float-right" title="Contact" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>


<a href="index.html" class="btn btn-neutral" title="Welcome to Jibia’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
Expand Down
Binary file modified build/objects.inv
Binary file not shown.
1 change: 1 addition & 0 deletions build/search.html
Expand Up @@ -80,6 +80,7 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html">Search</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#simple-html-example">Simple HTML Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="jibia_search.html#example-of-manual-autocomplete-handling">Example of manual autocomplete handling</a></li>
<li class="toctree-l1"><a class="reference internal" href="contact.html">Contact</a></li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion build/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 39 additions & 1 deletion source/jibia_search.rst
Expand Up @@ -38,4 +38,42 @@ Besides the token parameter, several other parameters can be set in the script t
This value can be set to true or false. If this is set to true the search results will use predefined style. The parameter defaults to true.

result_classname
This parameter can be set to define the class name for autocomplete suggestions. This parameter defaults to "search_result".
This parameter can be set to define the class name for autocomplete suggestions. This parameter defaults to "search_result".


Example of manual autocomplete handling
=============================
If you wish to have more control over what happens under the hood, instead you can write the logic for this yourself.
To do this you first have to load your product feed into Jibia. You can do that with the following request:

::
curl -X POST \
https://api.jibia.nl/api/initialize_search \
-H 'Content-Type: application/json' \
-d '{"feed_url": FEED_URL}'
.. glossary::

feed_url
The URL to your product feed.

This request returns a token you can use for the search. Save this token somewhere. It might take several minutes before your feed is fully initialized.

The autocomplete can be called with the following request:

::

curl -X GET \
'https://api.jibia.nl/api/do_search?query={QUERY}&token={TOKEN}&n={N}'

.. glossary::

query
The query for the autocomplete.

token
The token from the response of your call to initialize_search

n
The amount of autocomplete results

0 comments on commit 286d7e1

Please sign in to comment.