Skip to content
Michael Rybintsev edited this page Aug 8, 2019 · 27 revisions

Summary

Search for document and folders

Operations

Searching for documents

When searching for a document the response will be an set of results, each with a score and a link to the document that was found.

Example

Request

GET /files/search/documents?query=something&workspaceids=1,2,3&from=2017-01-01T12%3A02%3A02Z&includecontent=false HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

<search>
    <link rel="self" href="..." />
    <results>
        <result>
            <score>100</score>
            <document title="something" description="document description">
                <link rel="self" href="..." />
                 ... other document elements ...
            </document>
        </result>
    </results>
</search>

Parameters

Name Description Methods Optional
query The term to search for (truncates to 150 characters). Searches Title, Description and Tag fields. Optionally searches Body field if includecontent is set. GET No
pagesize The maximum number of elements to return, between 1 - 100. Default: 100 GET Yes
workspaceids A comma separated lists of workspace ids GET Yes
from The date to start the search from in encoded ISO 8601 format GET Yes
to The date to search up until in encoded ISO 8601 format GET Yes
includecontent Whether to consider document content within the search (default is false) GET Yes

Filter by workspaces

The workspaceids parameter is optional. If you do not provide it search will return results from all the workspaces that the user has access to.

Although optional, we strongly encourage you to provide a list of workspaces to search within.

GET /files/search/documents?query=something&workspaceids=1,3 HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Properties

Name Description
result A result element is a representation of the single search result.

Link relations

Name Description Methods
self The current URI of this search. GET

Schema

start = results

results = element h:results {
	  link+,
          result+
}

result = element h:result {
  link+,
  element h:score{ xsd:float },
  element h:document{}
}

Searching for folders

When searching for folders the response will be an array of results, each with a score, and the folder that was found.

Example

Request

GET /files/search/folders?query=something&workspaceids=1&from=2017-01-01T12%3A02%3A02Z HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

<search>
    <link rel="self" href="..." />
    <results>
        <result> 
            <score>100</score>
            <folder title="something" description="folder description">
                <links rel="self" href="..." />
                <links rel="alternate" href="http://my.huddle.net/workspace/469/folders/123" type="text/html" />
                <actors name="document owner" email="[email protected]" rel="owner">
               		<links rel="self" href="https://..." />
               		<links rel="avatar" href="https://..." />
               		<links rel="alternate" href="https://..." type="text/html" />
                </actors>
		        <updated>Thu, 07 Feb 2013 12:12:58 GMT</updated>
        		<created>Thu, 06 Dec 2012 17:43:40 GMT</created>
        		<workspace title="workspace title">
        		        <links rel="self" href="https://..." />
	            </workspace>
            </folder>
        </result>
    </results>
</search>

Parameters

Name Description Methods Optional
query The term to search for (truncates to 150 characters) GET No
pagesize The maximum number of elements to return, between 1 - 100. Default: 100 GET Yes
workspaceids A comma separated lists of workspace ids GET Yes
from The date to start the search from in encoded ISO 8601 format GET Yes
to The date to search up until in encoded ISO 8601 format GET Yes

Filter by workspaces

The workspaceids parameter is optional. If you do not provide it search will return results from all the workspaces that the user has access to.

Searching for tasks

When searching for tasks the response will be an array of results, each with a score, and the task that was found. The task's title, description and comments.

Example

Request

GET /tasks/events/search?query=something&workspaceids=1&from=2013-01-01T12%3A02%3A02Z HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

XML Response

<search>
    <link rel="self" href="..." />
    <results>
        <result> 
            <score>100</score>
            <task title="something" description="task description">
                <links rel="self" href="..." />
                <links rel="alternate" href="http://my.huddle.net/workspace/469/tasks/123" type="text/html" />
                <actor name="Task Owner" email="[email protected]" rel="owner">
               		<links rel="self" href="https://..." />
               		<links rel="avatar" href="https://..." type="image/jpeg" />
               		<links rel="alternate" href="https://..." type="text/html" />
                </actor>
                <actor name="Task Updater" email="[email protected]" rel="updated-by">
               		<links rel="self" href="https://..." />
               		<links rel="avatar" href="https://..." type="image/jpeg" />
               		<links rel="alternate" href="https://..." type="text/html" />
                </actor>
                <status>NotStarted</status>
		        <updated>Thu, 07 Feb 2013 12:12:58 GMT</updated>
		        <created>Thu, 06 Dec 2012 17:43:40 GMT</created>
		        <workspace title="workspace title">
		            <links rel="self" href="https://..." />
		            <links rel="alternate" href="https://..." type="text/html" />
	            </workspace>
            </task>
        </result>
    </results>
</search>

JSON Response

{
    "results": [{
        "score": 100.0,
        "task": {
            "links": [
                { "rel": "self", "href": "..." },
                { "rel": "alternate", "href": "...", "type": "text/html" }
            ],
            "actors": [{
                "name": "Jimmy Snake",
                "email": "[email protected]",
                "rel": "owner",
                "links": [
                    { "rel": "self", "href": ".." },
                    { "rel": "avatar", "href": "..", "type": "image/jpeg" },
                    { "rel": "alternate", "href": "..", "type": "text/html" }
                ]
            }, {
                "name": "John Doe",
                "email": "[email protected]",
                "rel": "updated-by",
                "links": [
                    { "rel": "self", "href": ".." },
                    { "rel": "avatar", "href": "..", "type": "image/jpeg" },
                    { "rel": "alternate", "href": "..", "type": "text/html" }
                ]
            }],
            "title": "something",
            "description": "task description",
            "status": "NotStarted",
            "created": "Thu, 07 Feb 2013 12:12:58 GMT",
            "updated": "Thu, 06 Dec 2012 17:43:40 GMT",
            "workspace": {
                "title": "workspace title",
                "links": [
                    { "rel": "self", "href": "..." },
                    { "rel": "alternate", "href": "...", "type": "text/html }
                ]
            }
        }
    }],
    "links": [
        { "rel": "self", "href": "..." }
    ]
}

Parameters

Name Description Methods Optional
query The term to search for (truncates to 150 characters) GET No
pagesize The maximum number of elements to return, between 1 - 100. Default: 100 GET Yes
workspaceids A comma separated lists of workspace ids GET Yes
from The (task updated) date to start the search from in encoded ISO 8601 format GET Yes

Filter by workspaces

The workspaceids parameter is optional. If you do not provide it search will return results from all the workspaces that the user has access to.

Query Language

Wildcards * and ? not supported.

Words

Single Term (single word): hello

Phrase (group of words): "hello huddle"

Boolean Operators

OR

"hello huddle" Wednesday

"hello huddle" OR Wednesday

"hello huddle" OR "Wednesday morning"

AND

"hello huddle" AND Wednesday

"hello huddle" AND "Wednesday morning"

Escaping Special Characters

Lucene supports escaping special characters that are part of the query syntax. The current list special characters are:

    • & | ! ( ) { } [ ] ^ " ~ *? : *

To escape these character use the \ before the character. For example to search for (1+1):2 use the query:

(1+1):2

Classic
Clone this wiki locally