/[pgestraier]/trunk/test.sql
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/test.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 57 - (hide annotations)
Thu May 11 16:19:38 2006 UTC (18 years ago) by dpavlin
File size: 2575 byte(s)
initial implementation of hints using (fake) atribute names in form HINTS.something
(e.g. HITS.HIT or HINTS.WORDNUM...)
1 dpavlin 19 --select * from pgest(null, 'a OR b OR c', '', 0, 0);
2     --select * from pgest('##dir##/data/casket', 'a OR b OR c', '', 0, 10);
3     --select * from pgest('##dir##/data/casket', 'a OR b OR c', '', 20, 0);
4     --select * from pgest('##dir##/data/casket', 'a OR b OR c', null, 20, 0);
5     --select * from pgest('##dir##/data/casket', 'a OR b OR c', '@uri ISTREW .txt', 100, 0);
6 dpavlin 13
7     -- find all references to blade runner in other films
8 dpavlin 51 select uri,title,year from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, 'blade runner', '@title !ISTRINC blade runner', null, null, null, array['@uri','@title','year']) as (uri text, title text, year int);
9 dpavlin 17
10     -- find all references and count them to blade runner after 1990
11 dpavlin 51 select count(title),title from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, 'blade runner', 'year NUMGT 1990', null, null, null, array['@title']) as (title text) group by title order by title;
12 dpavlin 19
13     -- example of new API which allows user to specify attributes
14 dpavlin 51 select count(title),year from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, 'blade runner', null, null, null, null, array['@title','year']) as (title text, year text) group by year order by year asc;
15 dpavlin 19
16 dpavlin 31 -- test sort order
17 dpavlin 51 select title from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, 'blade runner', 'year NUMGT 1990', '@title STRA', 5, 0, array['@title']) as (title text);
18 dpavlin 31
19 dpavlin 40 -- test attributes delimited by {{!}}
20 dpavlin 51 select title from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, 'blade runner', 'year NUMGT 1990{{!}}@title ISTRINC blade', null, null, null, array['@title']) as (title text);
21 dpavlin 41
22     -- node API examples
23    
24 dpavlin 51 select title from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 1, 'blade runner', 'year NUMGT 1990', '@title STRA', 10, 5, array['@title']) as (title text);
25 dpavlin 41
26     -- comparison of direct access and node API
27 dpavlin 51 -- explain analyze select title from pgest('##dir##/data/casket', 'blade runner', 'year NUMGT 1990', '@title STRA', 5, 0, array['@title']) as (title text);
28 dpavlin 49 explain analyze select title from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, 'blade runner', 'year NUMGT 1990', '@title STRA', 5, 0, array['@title']) as (title text);
29 dpavlin 54
30 dpavlin 57 -- example of using convert and hints
31     select uri,convert(title,'UTF-8', 'LATIN2'),year,hits,h1,h2 from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, 'blade runner', '@title !ISTRINC blade runner', null, 5, 0, array['@uri','@title','year','HINTS.HIT','HINTS.WORDNUM','HINTS.TIME']) as (uri text, title text, year int, hits int, h1 text, h2 text);

  ViewVC Help
Powered by ViewVC 1.1.26