Web service API

How to use PageSeeder's Web service API

autosuggest group

/groups/{group}/autosuggest [GET]

com.pageseeder.search.AutoSuggest

Description

This service returns the list of result suggestions from a prefix match on a set of preconfigured fields.

Auto-suggest configuration

The auto-suggestion function has been pre-configured to match terms in the following Index:

  • pstitle
  • psfilename
  • pscontent
  • psdocid

To use the auto-suggest on a specific set of fields or for more information about the auto-suggest feature, see Service: /groups/{group}/autosuggest/fields [GET] instead.

Parameters

NameDescriptionRequiredTypeDefault value
termThe prefix for the terms to use for the AutoSuggestyesstring

Note

Although the term parameter isn't strictly required, failing to specify a term will always return an empty result set.

Permission

Undocumented permissions requirements.

Response

If don't put the term it will show all the terms. The output has the following XML Document:

<auto-suggest term="">
    <search-results>
       <query lucene="[lucene query]">
            <suggestion-query>
               <terms>
                  <!-- List of possible matching terms -->
                      <term field="[index field name]"
                      text="[matching term]"/>
                      ...
               </terms>
               <condition>pstype:document</condition>
            </suggestion-query>
        </query>
        <metadata>
            <hits>
                <per-page>10</per-page>
                <total>3</total>
            </hits>
            <page>
                <first-hit>1</first-hit>
                <last-hit>3</last-hit>
                <current>1</current>
                <last>1</last>
            </page>
       </metadata>
       <documents>
          <!-- each suggested results as a Lucene document -->
          <document> Document data 1 </document>
       </documents>

       <documents>
          <!-- each suggested results as a Lucene document -->
          <document> Document data 2 </document>
       </documents>

       <documents>
          <!-- each suggested results as a Lucene document -->
          <document> Document data 3 </document>
       </documents>
           .
           .
           .
    </search-results>
</auto-suggest>

If term has value invalid, the return is:

<auto-suggest term="20">
    <search-results>
        <query lucene="+pstype:document +(pstitle:20 psfilename:20 psid:20)">
            <suggestion-query>
                <terms>
                    <term field="pstitle" text="20"/>
                    <term field="psfilename" text="20"/>
                    <term field="psdocid" text="20"/>
                    <term field="psid" text="20"/>
                </terms>
                <condition>pstype:document</condition>
            </suggestion-query>
        </query>
        <metadata>
            <hits>
                <per-page>10</per-page>
                <total>0</total>
            </hits>
            <page>
                <first-hit>1</first-hit>
                <last-hit>0</last-hit>
                <current>1</current>
                <last>1</last>
            </page>
        </metadata>
        <documents/>
    </search-results>
</auto-suggest>

Or if term has value right, the return is:

<auto-suggest term="">
    <search-results>
       <query lucene="[lucene query]">
            <suggestion-query>
               <terms>
                  <!-- List of possible matching terms -->
                      <term field="[index field name]"
                      text="[matching term]"/>
                      ...
               </terms>
               <condition>pstype:document</condition>
            </suggestion-query>
        </query>
        <metadata>
            <hits>
                <per-page>10</per-page>
                <total>3</total>
            </hits>
            <page>
                <first-hit>1</first-hit>
                <last-hit>3</last-hit>
                <current>1</current>
                <last>1</last>
            </page>
       </metadata>
       <documents>
          <!-- each suggested results as a Lucene document -->
          <document> Document data right. </document>
       </documents>
    </search-results>
</auto-suggest>

 

 

 

Error Handling

No specific errors expected for this service.

Created on , last edited on