Run against special zebra on test:8017
[ZOOM-Perl-moved-to-github.git] / archive / test-server / update-client
1 From mike  Wed Nov 30 17:50:48 2005
2 MIME-Version: 1.0
3 Envelope-to: mike@indexdata.com
4 Delivery-date: Wed, 30 Nov 2005 17:49:30 +0100
5 Date: Wed, 30 Nov 2005 17:49:11 +0100
6 From: Adam Dickmeiss <adam@indexdata.dk>
7 X-Accept-Language: en-us, da, en
8 To: Zebra Information Server <zebralist@indexdata.dk>
9 Subject: Re: [Zebralist] indexing data from yaz client
10 In-Reply-To: <20051117161003.M83503@reverseorder.net>
11 Content-Type: text/plain; charset=us-ascii; format=flowed
12 Reply-To: Zebra Information Server <zebralist@indexdata.dk>
13 Sender: zebralist-bounces@indexdata.dk
14 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on bagel.indexdata.dk
15 X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 
16         autolearn=unavailable version=3.0.4
17 X-Spam-Level: 
18
19 scuzzy wrote:
20 > Is there a way to initiate a re-index of the database through the yaz link? 
21 > furthermore, is there a way to index content that is not a physical file, but
22 > rather something sent to zebra via the yaz client/link.
23
24 > I've tried a few things, but I'm not sure how to do this.
25
26 The extended services are not enabled by default in zebra - due to the 
27 fact that they modify the system.
28
29 In order to allow anybody to update, use
30 perm.anonymous: rw
31 in zebra.cfg.
32
33 Or, even better, allow only updates for a particular admin user. For 
34 user 'admin', you could use:
35 perm.admin: rw
36 passwd: passwordfile
37
38 And in passwordfile, specify users and passwords ..
39 admin:secret
40
41 We can now start a yaz-client admin session and create a database:
42
43 $ yaz-client localhost:9999 -u admin/secret
44 Authentication set to Open (admin/secret)
45 Connecting...OK.
46 Sent initrequest.
47 Connection accepted by v3 target.
48 ID     : 81
49 Name   : Zebra Information Server/GFS/YAZ
50 Version: Zebra 1.4.0/1.63/2.1.9
51 Options: search present delSet triggerResourceCtrl scan sort 
52 extendedServices namedResultSets
53 Elapsed: 0.007046
54 Z> adm-create
55 Admin request
56 Got extended services response
57 Status: done
58 Elapsed: 0.045009
59
60 Now Default was created..  We can now insert an XML file (esdd0006.grs 
61 from example/gils/records) and index it:
62
63 Z> update insert 1 esdd0006.grs
64 Got extended services response
65 Status: done
66 Elapsed: 0.438016
67
68 The 3rd parameter.. 1 here .. is the opaque record id from Ext update. 
69 It a record ID that _we_ assign to the record in question. If we do not 
70 assign one the usual rules for match apply (recordId: from zebra.cfg).
71
72 Actually, we should have a way to specify "no opaque record id" for 
73 yaz-client's update command.. We'll fix that.
74
75 Elapsed: 0.438016
76 Z> f utah
77 Sent searchRequest.
78 Received SearchResponse.
79 Search was a success.
80 Number of hits: 1, setno 1
81 SearchResult-1: term=utah cnt=1
82 records returned: 0
83 Elapsed: 0.014179
84
85 Let's delete the beast:
86
87 Z> update delete 1
88 No last record (update ignored)
89 Z> update delete 1 esdd0006.grs
90 Got extended services response
91 Status: done
92 Elapsed: 0.072441
93 Z> f utah
94 Sent searchRequest.
95 Received SearchResponse.
96 Search was a success.
97 Number of hits: 0, setno 2
98 SearchResult-1: term=utah cnt=0
99 records returned: 0
100 Elapsed: 0.013610
101
102 If shadow register is enabled you must run the adm-commit command in 
103 order write your changes..
104
105 / Adam
106
107
108 > Any help would be appreciated.
109
110 > Daine Mamacos
111 > --
112 > random signature
113
114
115
116 > _______________________________________________
117 > Zebralist mailing list
118 > Zebralist@indexdata.dk
119 > http://www.indexdata.dk/mailman/listinfo/zebralist
120
121
122
123
124 _______________________________________________
125 Zebralist mailing list
126 Zebralist@indexdata.dk
127 http://www.indexdata.dk/mailman/listinfo/zebralist
128
129 From mike  Tue Nov 29 11:38:15 2005
130 MIME-Version: 1.0
131 Envelope-to: mike@miketaylor.org.uk
132 Delivery-date: Tue, 29 Nov 2005 11:36:14 +0100
133 Date: Tue, 29 Nov 2005 11:36:14 +0100
134 From: Adam Dickmeiss <adam@indexdata.dk>
135 X-Accept-Language: en-us, da, en
136 To: Mike Taylor <mike@miketaylor.org.uk>
137 Subject: Re: zoomtest9.c
138 In-Reply-To: <200511241610.jAOGAuSh015366@localhost.localnet>
139 Content-Type: text/plain; charset=us-ascii; format=flowed
140 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on bagel.indexdata.dk
141 X-Spam-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
142         version=3.0.4
143 X-Spam-Level: 
144
145 Mike Taylor wrote:
146 > Hi, Adam, thanks for making this very helpful example code.  A few
147 > followup quesations.
148
149 > 1. What's the difference between "replace" and "update"?
150
151 For replace, and error is returned if the record does not already exist. 
152 For (special)update it will be inserted or updated/replaced..
153
154 > 2. What format should the records be in?  If I have a choice (e.g. XML
155 >    or MARC) how do I specify which I am using?
156
157 Currently it's XML only. We could have a way to inject other formats.. 
158 Ideally what Zebra would like is a filter name reather than a record 
159 syntax.. In actual fact updating _is_ a weird thing.. if you inject a 
160 record that's already being mangled by presentation... For example, 
161 consider a case where a ISO2709/MARC is inserted by zebraidx update... 
162 Later a client retireves the same record but now it's in DublinCore.. 
163 What happens if it gets updated? I guess it's just a DDTH.
164
165 > 3. Are there options that should be checked after calling send()
166 Don't think so.
167 > 4. Do we have a running server that I can test this against?  Or does
168 >    any Zebra installation support it, so I can run my own?
169 You should be able to run it against any Zebra server but you need to 
170 allow-updated in the config. (It would be too much of a security risk if 
171 anybody could update). Add something like this:
172
173 # Flags for the non-authenticated user. w=write (allows ES Updates)
174 perm.anonymous: rw
175
176 > 5. What steps are taken to authenticate the request?
177
178 > ... this is complicated stuff, isn't it?  :-)
179 And undocumented stuff.
180
181 / Adam
182
183 >  _/|_  ___________________________________________________________________
184 > /o ) \/  Mike Taylor  <mike@miketaylor.org.uk>  http://www.miketaylor.org.uk
185 > )_v__/\  "I have no idea what a `strong' or a `weak' verb is, and I truly
186 >        hope I never find out what a `turbo verb' is, but I usually have
187 >        a pretty good idea what the *right* verb is" -- Jane MacDonald.
188
189
190