(index ("list-documents" 0) ("put-document" 848) ("update-attributes" 1509) ("delete-document" 2194) ("find-documents" 2449) ("get-document" 6464) ("document-attribute" 7240) ("document-keywords" 7987) ("document-uri->id" 8667) ("register-admin-user" 8998) ("register-guest-user" 9227) ("register-guest-user" 9455) ("get-node-info" 9646) ("get-cache-usage" 10397) ("optimize-node" 10594) ("sync-node" 10716) ("list-nodes" 10960) ("add-node" 11548) ("delete-node" 11811) ("clear-node" 12027) ("list-users" 12168) ("add-user" 12743) ("delete-user" 13205) ("shutdown-master" 13354) ("sync-all-nodes" 13462) ("backup-master" 13584) ("rotate-log" 13718) ("read-attributes" 13813) ("read-attributes" 14180) ("write-draft" 14387) ("write-attributes" 14784))
(def (sig (procedure "(list-documents base-uri node #!key max prev)" (id list-documents))) (p "List the documents known to the " (tt "node") ".  Returns a list of alists containing the system attributes of each node: " (tt "@id") ", " (tt "@uri") ", " (tt "@digest") ", " (tt "@cdate") ", " (tt "@mdate") ", " (tt "@adate") ", " (tt "@title") ", " (tt "@author") ", " (tt "@type") ", " (tt "@lang") ", " (tt "@genre") ", " (tt "@size") ", " (tt "@weight") " and " (tt "@misc") ".  " (b "All attribute values are returned as plain strings") ".") (p "The " (tt "max") " argument controls the maximum number of results returned by this procedure.  It defaults to 10.  To get the next set of results, supply the " (tt "prev") " option.  Its value should be the value of the " (tt "@uri") " attribute of the last document in the previous result set."))
(def (sig (procedure "(put-document base-uri node contents attribs)" (id put-document))) (p "Store a new document, or replace an existing document at " (tt "node") ".") (p (tt "contents") " is a list of strings representing lines in the document. " (tt "attribs") " is an alist of document attributes.  The " (tt "@uri") " attribute must be present or the document will " (b "not") " be stored! If the " (tt "@uri") " is identical to an existing document, it is replaced.") (p "Example:") (highlight scheme "(put-document \"http://admin:admin@localhost:1978\" \"testnode\"\n              '(\"Hello there, this is another quick test\") '((@uri . \"test1\")))"))
(def (sig (procedure "(update-attributes base-uri node attribs)" (id update-attributes))) (p "Update an existing document's attributes at the given " (tt "node") ". " (tt "attribs") " is an alist containing the new attributes for the document.  The document is identified by the " (tt "@uri") " attribute.") (p "The attributes in the document are completely replaced by " (tt "attribs") ". This means that any attributes existing in the document but missing from " (tt "attribs") " will be removed from the document.") (highlight scheme "(update-attributes \"http://admin:admin@localhost:1978\" \"testnode\"\n                  '((@uri . \"test1\") (my-attribute . \"some-value\")))"))
(def (sig (procedure "(delete-document base-uri node #!key id uri)" (id delete-document))) (p "Delete the document identified by " (tt "id") " or " (tt "uri") " at " (tt "node") ".  You must supply one of " (tt "id") " or " (tt "uri") ", but not both."))
(def (sig (procedure "(find-documents base-uri node #!key phrase attr-phrases order max skip distinct depth wwidth hwidth awidth options auxiliary mask)" (id find-documents))) (p "Search for documents, using the options provided. If " (tt "phrase") " is not supplied and " (tt "attr-phrases") " is an empty list, zero documents are returned.  Otherwise, " (tt "phrase") " and " (tt "attr-phrases") " must " (i "all") " match a document in order for it to be returned. In other words, " (tt "phrase") " is ANDed with all the " (tt "attr-phrases") ".  The keys have the following meaning:") (dl (dt (tt "phrase")) (dd "This is the search phrase which is matched against the documents (a string)") (dt (tt "attr-phrases")) (dd "These are the search phrases which are matched against the document attributes (a list of strings). This list can contain up to 10 search conditions, but not more. It defaults to the empty list.") (dt (tt "order")) (dd "The order in which the results should be returned (a string).") (dt (tt "max")) (dd "The maximum number of results returned (a number). If not supplied, it defaults to 10.") (dt (tt "skip")) (dd "The number of documents to skip in the result set (a number). Defaults to 0.") (dt (tt "distinct")) (dd "The attribute name on which to filter distinctly (a symbol or string).") (dt (tt "depth")) (dd "The depth of the meta-search (a number).  Defaults to 0.") (dt (tt "wwidth")) (dd "The whole width (in characters) of search result snippets (a number).  Default depends on server configuration. If zero, no snippets are returned. If negative, whole documents are returned.") (dt (tt "hwidth")) (dd "The width of strings (in characters) in the snippet in the beginning of the text (a number). Default depends on server configuration.") (dt (tt "awidth")) (dd "The width of strings (in characters) around the snipper (a number). Default depends on server configuration.") (dt (tt "options")) (dd "Options for the search condition. (TODO)") (dt (tt "auxiliary")) (dd "Permission to adopt result of the auxiliary index (a number). By default, it is 32. (TODO)") (dt (tt "mask")) (dd "The mask of search targets (a number). 1 means the node itself, 2 means the first link, 4 means the second link, 8 means the third link, and power values of 2 and their summation compose the mask. (TODO)")) (p "See the " (link "http://fallabs.com/hyperestraier/uguide-en.html#searchcond" "documentation for search conditions") " for information on the syntax of " (tt "phrase") ", " (tt "attr-phrases") " and " (tt "order") ".") (p "This procedure returns two values.  The first value is a list containing the documents (the actual search results), the second value is a list with meta-information about the search result set.") (p "The documents are pairs with the matched snippets (a list of pairs) as car and the attributes (an alist) as cdr. The car of a snippet is either a string to be highlighted (the part of the string that was in the search phrase) or " (tt "#f") " if no appropriate highlighting can be made.  The cdr of a snippet is a matched string.") (p "Example:") (highlight scheme "(put-document \"http://admin:admin@localhost:1978\" \"testnode\"\n              '(\"Hello there, this is another quick test\") '((@uri . \"test1\")))\n(find-documents \"http://admin:admin@localhost:1978\" \"testnode\"\n                phrase: \"quick test\")\n=>\n((((#f . \"Hello there, this is another \") (\"quick test\" . \"quick test\"))\n  (#nodelabel . \"testnode\")\n  (#nodescore . \"10758\")\n  (#nodeurl . \"http://localhost:1978/node/testnode\")\n  (@digest . \"ec0e90969320452b97f55f97ad3a5cc7\")\n  (@id . \"8\")\n  (@uri . \"test1\")))\n((VERSION \"1.0\")\n (NODE \"http://localhost:1978/node/testnode\")\n (HIT \"1\")\n (HINT#1 \"test\" \"1\")\n (DOCNUM \"1\")\n (WORDNUM \"8\")\n (TIME \"0.004907\")\n (TIME#i \"0.000597\")\n (TIME#0 \"0.000749\")\n (LINK#0 \"http://localhost:1978/node/testnode\" \"testnode\" \"10000\" \"1\" \"8\" \"9129518\" \"1\")\n (VIEW \"SNIPPET\"))"))
(def (sig (procedure "(get-document base-uri node #!key id uri)" (id get-document))) (p "Fetch the document identified by " (tt "id") " or " (tt "uri") " at " (tt "node") ".  You must supply one of " (tt "id") " or " (tt "uri") ", but not both.  Returns two values: the document's contents (a list of strings, representing lines in the document) and the document's attributes (an alist with symbols as keys and strings as values).") (p "Example:") (highlight scheme "(get-document \"http://admin:admin@localhost:1978\" \"testnode\" uri: \"test1\")\n=>\n(\"Hello there, this is another quick test\")\n((#nodelabel . \"testnode\")\n (#nodeurl . \"http://localhost:1978/node/testnode\")\n (@digest . \"34736f47d003748e7c6896a5931070dc\")\n (@id . \"8\")\n (@uri . \"test1\"))"))
(def (sig (procedure "(document-attribute base-uri node attrib #!key id uri)" (id document-attribute))) (p "Fetch the attribute with name " (tt "attrib") " from the document identified by " (tt "id") " or " (tt "uri") " at " (tt "node") ". You must supply one of " (tt "id") " or " (tt "uri") ", but not both. " (tt "attrib") " may be either a symbol or a string. This procedure returns a string with the attribute's contents.") (p (b "Note:") " If the attribute does not exist, an exception of type " (tt "(exn estraier-client args)") " is thrown.") (p "Example:") (highlight scheme "(document-attribute \"http://admin:admin@localhost:1978\" \"testnode\"\n                    '@digest uri: \"test1\")\n=>\n\"34736f47d003748e7c6896a5931070dc\""))
(def (sig (procedure "(document-keywords base-uri node #!key id uri)" (id document-keywords))) (p "Fetch the keywords that belong to the document identified by " (tt "id") " or " (tt "uri") " at " (tt "node") ". You must supply one of " (tt "id") " or " (tt "uri") ", but not both.  Returns a list of pairs.  The car is a string with the keyword, the cdr is a number representing the keyword's assigned score.") (p "Example:") (highlight scheme "(document-keywords \"http://admin:admin@localhost:1978\" \"testnode\" uri: \"test1\")\n=>\n((\"another\" . 7882)\n (\"there\" . 1)\n (\",\" . 1)\n (\"this\" . 1)\n (\"is\" . 1)\n (\"quick\" . 1)\n (\"hello\" . 1)\n (\"test\" . 1))"))
(def (sig (procedure "(document-uri->id base-uri node uri)" (id document-uri->id))) (p "Look up the ID of a document by its " (tt "uri") " at " (tt "node") ".  Returns a string with the document's ID.") (p "Example:") (highlight scheme "(document-uri->id \"http://admin:admin@localhost:1978\" \"testnode\" \"test1\")\n=>\n\"8\""))
(def (sig (procedure "(register-admin-user base-uri node name)" (id register-admin-user))) (p "Register the user with the given " (tt "name") " to be an admin for " (tt "node") ". This does not affect the user's guest status."))
(def (sig (procedure "(register-guest-user base-uri node name)" (id register-guest-user))) (p "Register the user with the given " (tt "name") " to be a guest for " (tt "node") ". This does not affect the user's admin status."))
(def (sig (procedure "(register-guest-user base-uri node name)" (id register-guest-user))) (p "Remove a user with the given " (tt "name") " from the " (tt "node") "'s list of known users."))
(def (sig (procedure "(get-node-info base-uri node)" (id get-node-info))) (p "Get information about the given " (tt "node") ".  Returns an alist containing the following keys:") (dl (dt (tt "name")) (dd "The name of the node (string)") (dt (tt "label")) (dd "The label of the node (string)") (dt (tt "document-count")) (dd "The number of documents in the node's database (number)") (dt (tt "word-count")) (dd "The number of unique words in the node's database (number)") (dt (tt "size")) (dd "The size of the node's database (number) (in bytes?)") (dt (tt "admin-users")) (dd "The names of the users that are admin to this node (list of strings)") (dt (tt "guest-users")) (dd "The names of the users that are guests to this node (list of strings)")))
(def (sig (procedure "(get-cache-usage base-uri node)" (id get-cache-usage))) (p "Get the cache usage for the given " (tt "node") ".  Returns a number that indicates the cache size (in bytes?)."))
(def (sig (procedure "(optimize-node base-uri node)" (id optimize-node))) (p "Optimize the " (tt "node") "'s database."))
(def (sig (procedure "(sync-node base-uri node)" (id sync-node))) (p "Synchronize updating of the " (tt "node") "'s database. If you do not perform this, search results or listings might not include all the latest additions to the database."))
(def (sig (procedure "(list-nodes base-uri)" (id list-nodes))) (pre "") (p "List all nodes known to the node master.  Returns a list of node info alists.  Each node info alist contains the following symbolic keys:") (dl (dt (tt "name")) (dd "The name of the node (string)") (dt (tt "label")) (dd "The label of the node (string)") (dt (tt "document-count")) (dd "The number of documents in the node's database (number)") (dt (tt "word-count")) (dd "The number of unique words in the node's database (number)") (dt (tt "size")) (dd "The size of the node's database (number) (in bytes?)")))
(def (sig (procedure "(add-node base-uri name [label])" (id add-node))) (p "Create a new node server with the given " (tt "name") " and " (tt "label") " and add it to the master's pool of nodes.  If " (tt "label") " is omitted, it defaults to " (tt "name") "."))
(def (sig (procedure "(delete-node base-uri name)" (id delete-node))) (p "Delete the node server identified by " (tt "name") " from the master's pool of nodes.  This action destroys the node and all its contents."))
(def (sig (procedure "(clear-node base-uri name)" (id clear-node))) (p "Remove all documents from the node identified by " (tt "name") "."))
(def (sig (procedure "(list-users base-uri)" (id list-users))) (p "List all users known to the master.  Returns a list of user info alists.  Each user info alist contains the following symbolic keys:") (dl (dt (tt "name")) (dd "The name of the user") (dt (tt "password")) (dd "The encrypted password") (dt (tt "flags")) (dd "The user flags. The string contains \"b\" if the user is banned or \"s\" if it is a superuser.") (dt (tt "fullname")) (dd "The full name of the user.") (dt (tt "misc")) (dd "Miscellaneous information about the user.")) (p "All values are strings."))
(def (sig (procedure "(add-user base-uri username password #!key flags fullname misc)" (id add-user))) (p "Add a user with the given " (tt "username") " and " (tt "password") " to the master. The optional " (tt "flags") " key is a string containing a \"b\" if the user is to be banned or an \"s\" if the user is to be a superuser.  The " (tt "fullname") " specifies the user's full name and " (tt "misc") " specifies miscellaneous information about the user."))
(def (sig (procedure "(delete-user base-uri username)" (id delete-user))) (p "Delete the user with the given " (tt "username") " from the master."))
(def (sig (procedure "(shutdown-master base-uri)" (id shutdown-master))) (p "Shutdown the master server."))
(def (sig (procedure "(sync-all-nodes base-uri)" (id sync-all-nodes))) (p "Synchronize databases of all nodes to disk."))
(def (sig (procedure "(backup-master base-uri)" (id backup-master))) (p "Synchronize all databases to disk and make a full backup."))
(def (sig (procedure "(rotate-log base-uri)" (id rotate-log))) (p "Rotate the master's log."))
(def (sig (procedure "(read-attributes inport)" (id read-attributes))) (p "Read a document in " (link "http://fallabs.com/hyperestraier/uguide-en.html#formats" "\"draft format\"") " from the input-port " (tt "inport") ". Returns two values: the document contents (a list of strings representing the lines in the docuemnt) and the document's attributes (an alist)."))
(def (sig (procedure "(read-attributes inport)" (id read-attributes))) (p "Like " (tt "read-attributes") ", except this only reads the attributes and returns only one value: an alist with the attributes."))
(def (sig (procedure "(write-draft outport contents attributes)" (id write-draft))) (p "Write out a document in " (link "http://fallabs.com/hyperestraier/uguide-en.html#formats" "\"draft format\"") " to the specified output port " (tt "outport") ".  " (tt "attributes") " is an alist with the attributes of the document, " (tt "contents") " is a list of strings with the lines in the document."))
(def (sig (procedure "(write-attributes outport attributes)" (id write-attributes))) (p "Like " (tt "write-draft") ", except this only writes the attributes part (the \"header\", in a way) of the draft."))
