Page 1 of 1

[ADC-Ext 1.0.8] Advanced search (ASCH)

Posted: 25 Jun 2013, 15:57
by maksis
This extension is mainly meant for allowing searches in partial lists. Supporting clients should advertise the "ASCH" support in their INF (that is sent to the hub).


New SCH parameters:

Matching options (only applies to search terms, not excluded words):
MT0: Match full path (partial match)
MT1: Match file/directory name only (partial match)
MT2: Match file/directory name only (exact match)


PP1 - The responder should send the parent path of the matching item. For files the result should be for the containing files and for directories the result is for the parent directory. The responder should
check that only one result is sent for each directory. This is useful when searching in a partial list, so the requester can then download the partial list from a correct path and locate the matching items
in the directory by itself (less search results to send).

OT - Older than. Newest possible (absolute) time for a responded item. Unix time.
NT - Newer than. The oldest possible (absolute) time for a responded item. Unix time.

MR - Maximum number of wanted results (can only be used for D type searches?). The responder may also choose to send less results if the requested count isn't reasonable.
PA - Path in the share where to search from (relative to the unnamed root). This can only be used for D type searches.
RE1 - Require a reply. This can only be used for D type searches.

The reply is a DSTA message that contains the following extra parameters:

FC - This should be DSCH (added also for error messages)
TO - Token of the search
RC - Number of results sent

If no results were found, the reply should still be sent with the success code (with "RC0")


New RES parameters:

FI - Number of files in a directory (recursive, directory search results only)
FO - Number of folders in a directory (recursive, directory search results only)
DA - Modify date of a file/folder (depending on the result type). Unix time.

Re: Advanced search (ASCH)

Posted: 01 Jul 2013, 17:04
by Pretorian
The following is what I intend to push to ADC-Ext with. I think a lot of stuff can be generalized, so I'll post later on it.
=== Advanced search

This extension will increase searching capability in BASE. The extension also imply that searching in partial file lists are now easier.

Signal ASCH in the INF's SU field.

The SCH command is extended to request a response (STA) indicating how many search results were sent. This will allow clients to indicate that all search results have been received (and can aptly indicate as such to the user). STA severity 0 and code 00 should be used.

Additional SCH fields:
[options="autowidth"]
|=====
|MT |Matching options. Only applies to search terms (AD) and not excluded terms (EX).
|PP |Indicating whether the responding party should send the parent path of the matching item. For files the result should be for the containing files and for directories the result is for the parent directory. The responder should check that only one result is sent for each directory. This is useful when searching in a partial list, so the requester can then download the partial list from a correct path and locate the matching items in the directory by itself (less search results to send).
|OT |Older than. Newest possible (absolute) time for a responded item. Time specified is seconds since the Unix epoch.
|NT |Newer than. Oldest possible (absolute) time for a responded item. Time specified is seconds since the Unix epoch.
|MR |Maximum number of wanted results (implementations should be conservative in which message type). The responder may also choose to send less results if the requested count isn't reasonable.
|PA |Path in the share where to search from (relative to the unnamed root). This only makes sense for certain message types.
|RE |Require a STA reply. This only makes sense for certain message types.
|=====

MT field:
[options="autowidth"]
|=====
|1 |Match full path (partial match).
|2 |Match file/directory name only (partial match).
|3 |Match file/directory name only (exact match).
|=====

PP field:
[options="autowidth"]
|=====
|1 |Send parent path.
|=====

RE field:
[options="autowidth"]
|=====
|1 |Require a reply.
|=====

Additional RES fields:
[options="autowidth"]
|=====
|FI |Number of files in a directory (recursive, directory search results only).
|FO |Numbers of folders in a directory (recursive, directory search results only).
|DA |Modified date of a file or directory. Time specified is seconds since the Unix epoch.
|=====

Additional STA fields:
[options="autowidth"]
|=====
|FC |The FCC of the search command (e.g. BSCH, DSCH).
|TO |Search token.
|RC |Number of results sent. The client receiving the search should still send the STA with a 0 here, in the event that there were not hits to the aformentioned search.
|=====