Article View: news.software.nntp
Article #9885Re: Suggested API for querying Usenet servers
From: J.B. Nicholson-Owens
Date: Mon, 05 Aug 1996 00:00
Date: Mon, 05 Aug 1996 00:00
176 lines
10255 bytes
10255 bytes
Before I get into replying, I should note that I've had some changes of heart since I wrote that proposed search API. I'll get into the ideas at the end of my response, but much of what's here shouldn't need to change radically. On 7 Jul 1996 23:17:41 -0700, Mary Conner <trif@serv.net> wrote: > Since Newsgroups: is just another header, the FROM part is strictly > not necessary, but I can see the usefulness in making the search more > efficient by making sure the server only searches in certain > directories. Actually, "search[ing] in certain directories" is an implementation detail I'd rather keep out of any syntax specification (and out of my thoughts when dreaming up worthwhile API changes) since that makes it harder for new server developers to implement some or all of this API. As for the "FROM" keyword, I think you're right and "FROM" has been dropped entirely. > My personal preference would be to not do any sorting in the server > itself and let client software handle it. Unfortunately, the client might not be able to sort data unless the data to sort on is returned. I've responded to the corollary to this--what to return--below. Just as in a relational database, the returned data might not have the information necessary to sort the items. > A means to easily invert the select (i.e. an exclusion instead of a selection) > might be a good feature. Since I've only used a superset of SQL, I am not > sure if the NOT(<condition>) construct is allowed in strict SQL. What query (with this syntax) that uses NOT(<condition>) can't be specified with "<>"? > From the point of view of a newsreader, I do not see too much use > being got out of being able to select which "headers" are returned. Currently, that might be so, but this searching API stems from a desire to read news sorted and grouped any way *the reader* wants, not necessarily newsgroups. I, for one, don't like being forced to read certain groups. A lot of the time I want to follow a conversation thread regardless of where the thread goes. Or I want to see the recent articles written by some user(s), regardless of where they appear. Now that that's out of the way, I'll address your point. Returning a standard set of headers means wasted data if you don't want those headers or additional requests if the headers you want aren't there. Current software might want those headers, but more advanced software (software that doesn't force the user to do group-level newsreading) could do with customized header retrieval. > In fact, given the > tendency for GUI newsreader authors to simply neglect to show users > *any* headers, I'd hesitate to do anything that would encourage this > practice. To me, that's their problem. No matter what protocol is used, there will always be developers who do not provide the users with the information they should be providing. > For my own work the things that I am most concerned with are the pattern > matching specifications. Full reg-exp searches are a necessity, and it > would be extremely nice to be able to specify that idiotic spam that > went around where the spammer used the last three characters of the > newsgroup name as part of the From: and the Subject: of the posting, > obviously in an attempt to defeat both killfiles and the spam cancellers. I would like a fuller regular expression set as well, and I'll certainly reconsider what to include (probably what perl provides). Like I said in the intro, much of the limits in this came from mSQL's SELECT (which offers an extremely limited regular expression set of characters, probably doing what SQL-92 specifies). It was an unintentional shortcoming that the original suggestion did not include fuller regexp. > I'm extremely leary of making CONTAINS so easy to use, since searches > that are pegged to either the start or the end of a string are far more > efficient. I'd prefer to require syntax like email-address=*@blarg.com*, > since it would be more likely that the user would then use *@blarg.com > instead of contains(blarg.com). I think having fuller regexp support would make this problem go away. "@blarg.com$" or ".*@blarg.com" would work to match anyone with an e-mail address ending in blarg.com. > I can see it useful to have a special construct to be able to specify > original articles or followups in a subject search without having to > use a contains. Would using References: work for you? The References: header won't be there if the post is starting a new thread, but it will contain the message IDs of other posts on that branch of the thread if that post is a followup. There are some things I am considering and I'd like some feedback on these ideas too. I'll mention as many good and bad points as I can think of while I list these ideas. In no particular order: * Body searches Searching the entire body of an article takes a lot of work on the part of the server both to maintain an index of the articles and to perform the searches on the index. Using the headers seems like a more pragmatic approach to searching huge (and constantly changing) article collections, like the collections of articles at a Usenet news server. * Making good use of the Keywords: header. (two parts) (1) I think it's time we (all Usenet users) encourage good use of the Keywords: header. To help against spelling errors, I thought it might be useful to either include Soundex codes (in lieu of real key words) in this header or make up a new header as a companion to the Keywords: header. Like Xref:, this new header would not be propagated between servers, just between servers and clients. It would work like this--you post an article with a Keywords: header of "alpha,beta,gamma" and this new header (call it X-Soundex-Keywords: for the time being) would hold "A410,B300,G500" (the Soundex hash of the three keywords in the same order). You can't go from the hash back to the word--you can't do a reverse Soundex search--but when performing a search based on keywords, you can compute the Soundex hash of the search criteria for this header and compare against the X-Soundex-Keywords: header. Advantage: If either you or the article author misspelled any keywords but the misspellings map to the same hash, you can still find the article you want. This is one of the big pluses of Soundex in general. Advantage: Soundex is PD and widely implemented in ready-to-use forms (for instance, perl has it in the standard distribution). It has been used for large-scale databases in the past (some US states use it as to generate the first segment of driver's license numbers). Disadvantages: Soundex is primarily for English speakers. I don't think it recognizes any characters other than the 26 letters of the alphabet English speakers use. This will not work well for non-English newsgroups. However, if there is an international Soundex perhaps this idea could still work (I'm not sure what exactly an international Soundex would look like or how it would work, but I hope I've conveyed the vague idea of what I'm aiming for). I would be interested in offering this header strictly as an experiment because I'm interested to see how useful this phonetic search would be but at the same time I'm hesitant because I don't want to promote an English-only Usenet. (2) The best keywords for an article are chosen by the person posting that article, unfortunately too few users use the Keywords: header. Since we don't have the technology to let the computer comprehend an article and prepare a sensible list of keywords, perhaps we should consider scanning the article body for "interesting" words, using a subset of them as the default for the Keywords: header. It would work something like this--you prepare an article without a Keywords: header and post it. Your posting software (or the server) scans the body of your article plus the content of the Subject: and Summary: headers for uncommon words by comparing all the words to a list of known "uninteresting" words. An English list would include Re:, and, or, if, but, some, for, each, etc. The words not mentioned in this list would be deemed "interesting" words and sorted by length and number of occurrences. The most frequently occurring "interesting" words are counted and if they are few in number, they are used as the basis of a Keywords: header. The user is prompted with this list and encouraged to make appropriate changes (which might include scrapping the entry altogether and choosing to have no Keywords: header at all). Obviously, certain groups will need to be excluded from certain aspects of this search (there's no point in searching the body of posts to binary newsgroups, for instance) and multiple lists of "uninteresting" words will be needed for different languages, but I don't think this poses a significant problem. I'd really appreciate it if someone familar with Library Science would comment on this. These ideas mean some changes to my inital API--searching the body would become optional for implementors. Header searches would be the main focus, and allowing searches on *all* the headers wouldn't even be necessary, just the common headers plus Keywords:, Summary: and X-Soundex-Keywords: (if that ever became a reality).
Technical Details
Message-ID:
<slrn50aran.6pm.jbn@mystery-train.cu-online.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<slrn4u0au3.sj4.jbn@mystery-train.cu-online.com> <4rq965$97j@imp.serv.net>Show Full Headers
Complete Article Headers
Message-ID: <slrn50aran.6pm.jbn@mystery-train.cu-online.com> Subject: Re: Suggested API for querying Usenet servers Date: Mon, 05 Aug 1996 00:00:00 +0000 From: jbn@mystery-train.cu-online.com (J.B. Nicholson-Owens) References: <slrn4u0au3.sj4.jbn@mystery-train.cu-online.com> <4rq965$97j@imp.serv.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 172096249 Distribution: inet Summary: A slight shift in strategy for the search API brings up new ideas. Organization: Organizing Organisms & Organs Keywords: search,nntp,proposal,soundex,usenet,keywords,automatic Newsgroups: news.software.nntp