project help search
API Support | Available since | Last updated | Output |
---|---|---|---|
5.9802 | 6.1000 | xml, json |
Description
Search the default help index and any [project]-help groups in this or ancestor projects and automatically add the following filter ({group}
can be a group or project).
psodcumenttype:help
Please note, the API of this class is not stable yet. Some parameter names may change, the XML output may also change slightly in future releases.
Select the index
The current implementation of PageSeeder produces one Lucene index per group. The index is selected by the group on the request. If there is a project on the request all the groups under the project that the member has access to will be selected. For a project the groups parameter can be used to narrow the groups selected. It must be a comma-separated list of group names.
The query
The query can be of two types: predicate or question. The parameter type specifies that type.
The parameters used for a predicate query are predicate and defaultfield. The predicate specified ust be parseable by the Lucene classic parser. See http://lucene.apache.org/core/5_2_1/queryparser/org/apache/lucene/queryparser/classic/package-summary.html
for more info.
The parameters for a question query are question and questionfields which will form the main predicate for the search.
The question is typically one or multiple terms, separated with spaces, and may also come directly from the user.
Each term in the question will be converted into Lucene Term s for each field specified in the fields parameters. The fields parameter would typically include the title ( pstitle
) and content ( pscontent
) for a full text search. The fields should be indexed by Lucene; and it is preferable that they are analyzed. In order to generate extracts, they must be stored.
For a question type, the Lucene query produced will be the equivalent of:
+(field1:term1 field1:term2 field2:term1 field2:term2 ...)
Using filters
The filters parameter is a comma-separated list of Lucene index terms including the field name: [field]:[term]
.
For example, the filters parameter value psauthor:john,pspriority:high
will only display results by author 'john' and have priority 'high'.
When filtering, the Lucene query produced will be the equivalent of:
+facet1:value1 +facet2:value2 ...)
Ranges
The ranges parameter can be used to filter using a set of ranges. It is a comma-separated list of range searches with format:
field:[|{(lower)?;(upper)?}|]
where [ or ] means include limit value and { or } means exclude limit value. For example:
ranges=psproperty-expires:[2015-03-20;2016-01-01],psproperty-title:[A;C} ranges=psxrefcount:{50;],psreversexrefcount:[;10]
Organising search results
Results can be paged and ordered.
The page and pagesize controls which part of the search results will be returned. They must be positive integer values and will default to 1
and 100
respectively.
The sortfields parameter is a comma-separated list of fields to sort the results; the results are sorted by relevance if no sortfields parameter is specified.
Parameters
Name | Description | Required | Type | Default value |
---|---|---|---|---|
document-type | Return results with this value in psmetadata-document_type OR match pageid | no | string | |
fieldsize | The max length allowed in a result field (max 10000) | no | integer | 1000 |
filters | A comma-separated list of field:term pairs to use as filters | no | strings | |
page | The current page to view | no | integer | 1 |
pageid | Return results with this value in psmetadata-page_id OR match document-type | no | string | |
pagesize | How many results does a page contain | no | integer | 100 |
question | The question to search for | no | string | |
questionfields | A comma-separated list of fields to search the question in | no | strings | pstitle,pscontent |
questionoperator | ||||
ranges | A comma-separated list of range searches | no | strings | |
sortfields | A comma-separated list of fields to sort the results | no | strings | |
suggestsize | The max number of suggestions to load (only for question query) | no | integer | 20 |
Permission
The user must be logged in and results will only be returned from projects where they are a member of a group.
Response
The XML response is:
<search> <query> ... </query> <suggestions> ... </suggestions> <facets> ... </facets> <results> ... </results> </search>
For details see Service: /groups/{group}/search [GET].
Error Handling
0x1501 | If there is an invalid group specified |
---|---|
0x1502 | If there are no indexes selected |
0x1503 | If the predicate is not valid |
0x1504 | If a sort field cannot be used for sorting |
0x1506 | If a numeric field is specified as a facet |
0x6502 | Missing catalog, please re-index group |