| 1 |
19 |
dpavlin |
--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 |
13 |
dpavlin |
|
| 7 |
|
|
-- find all references to blade runner in other films |
| 8 |
51 |
dpavlin |
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 |
17 |
dpavlin |
|
| 10 |
|
|
-- find all references and count them to blade runner after 1990 |
| 11 |
51 |
dpavlin |
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 |
19 |
dpavlin |
|
| 13 |
|
|
-- example of new API which allows user to specify attributes |
| 14 |
51 |
dpavlin |
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 |
19 |
dpavlin |
|
| 16 |
31 |
dpavlin |
-- test sort order |
| 17 |
51 |
dpavlin |
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 |
31 |
dpavlin |
|
| 19 |
40 |
dpavlin |
-- test attributes delimited by {{!}} |
| 20 |
51 |
dpavlin |
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 |
41 |
dpavlin |
|
| 22 |
|
|
-- node API examples |
| 23 |
|
|
|
| 24 |
51 |
dpavlin |
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 |
41 |
dpavlin |
|
| 26 |
|
|
-- comparison of direct access and node API |
| 27 |
51 |
dpavlin |
-- explain analyze select title from pgest('##dir##/data/casket', 'blade runner', 'year NUMGT 1990', '@title STRA', 5, 0, array['@title']) as (title text); |
| 28 |
49 |
dpavlin |
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 |
54 |
dpavlin |
|
| 30 |
57 |
dpavlin |
-- example of using convert and hints |
| 31 |
58 |
dpavlin |
select uri,convert(title,'UTF-8', 'LATIN2') as title,year,hits,wordnum,time |
| 32 |
|
|
from pgest('http://localhost:1978/node/trivia', 'admin', 'admin', 0, |
| 33 |
|
|
'blade', '@title ISTRINC runner', null, null, null, |
| 34 |
|
|
array['@uri','@title','year','HINTS.HIT','HINTS.WORDNUM','HINTS.TIME']) as |
| 35 |
|
|
(uri text, title text, year int, hits int, wordnum text, time text); |
| 36 |
|
|
|