Topic: Managing Zebra
Topic type:
Kete relies on Zebra for it's search results. Zebra is run as separate computer process from the Kete application. Here are some tips for how to manage it.
Originally written by Walter McGinnis, Kete Project Lead for Katipo Communications, Ltd.
Part of the Installation Guide
Kete needs a running and configured Zebra process in order to work. The Installation Guide outlines how to set up Zebra, but sometimes you may need to do additional maintenance.
For example if, you had to restart the host that runs your Kete site, Zebra will not be started automatically, you will have to do this yourself. Here's how:
If you are using the Simple Installation setup, do this:
$ cd ~/apps/your_app
$ rake zebra:start
Or if you are using Capistrano to manage your deployments, from your development enviroment you can do this:
$ cd ~/apps/your_app
$ cap deploy:zebra:start
As you might expect, the above "start" part of the commands can be replaced with "stop" and do what you would expect.
If you really get yourself in a pickle and mess up your Zebra search indexes there is a way to reset and start from scratch. However, it's a tad convoluted at this stage. Please contact Walter McGinnis and bug him to write it up!
Discuss This Topic
There are 21 comments in this discussion.
Read and join this discussion
In the file:
zebradb/zebrasrv-kill.sh
The command:
ps -o pid,ppid -ax
Might be:
ps -o pid,ppid ax
This is on Debian etch.
Hi Joe,
Thanks for the patch for Debian Etch. I really appreciate when people solve their own problems and then contribute back to the software. Great stuff.
I'll test this on Mac OS X and Solaris, if it works for all three I'll apply it as a bug fix to 1-0-stable branch.
In the future, this sort of thing probably belongs in a ticket. You can read how to add a ticket here:
Walter
Tags: Patches, tickets, Debian Etch
I'm looking for away to start Zebra and also the backgroundrb script automatically. Wonder if adding this to /etc/rc.local will do the trick.
/usr/local/bin/ruby /home/kete/site/script/backgroundrb start
/usr/local/bin/rake -f /home/kete/site/Rakefile /home/kete/site/ zebra:start
Assuming your rails root is in /home/kete/site/ and your ruby is in /usr/local/ like mine is. Is there a better way anyone knows to do this?
Hi John,
It's one of those things that has been on the todo list for a long time for us. You may have beat us to the punch.
It's seems like it is in the right direction. If you could give it a try and report back, that would be great.
Tags: rake, Zebra, backgroundrb, startup
Ahmad Maher
said ICU problem
the search in non english language not accurate
, can i use the ICU libraries with zebra and yaz search
I haven't tried. All the zebra configuration for Kete is under zebradb/conf/. Take a look there. The two main configuration files that I think you will need to change are zebra-public.cfg and zebra-private.cfg.
Let me know how you get on. I'm curious what is necessary to get Zebra to play nicely with arabic and other languages.
Ahmad Maher
said about yaz-icu
hello agian,
i want to add yaz-icu functionality to the zebra
http://www.indexdata.com/yaz/doc/yaz-icu.html
to support the arabic language in zebra
it can done by adding the icu xml file the path zebradb/etc
but this bath is not found
, i asked about ,if i can use the icu with the zebra conf ??
thanks,
I would add the file to the following path and see if it kicks in:
your_app/zebradb/tab/
This should be read in as having that file in that directory take precedence because it is earlier in your profilePath as specified in your zebra-*.cfg configuration files over the the default Zebra configuration that comes with the program's configuration.
Let me know if that works or not.
Tags: Arabic Zebra, Zebra, configuration
Ahmad Maher
said give error
hello ,
when i added the zebra conf file to the tab folder
this error appears
Unsupported Truncation attribute (120) 3
That actually sounds like progress. In other words we know that your icu file is taking effect.
Could you give me more context for that error please? Look for "query is" line in the log (probably log/development.log, but if you are in production mode log/production.log) just before the error happens and paste that in here.
How long is your icu file? Is it reasonable length to paste into discussion? That would probably be helpful to track things down.
My guess is the specific issue is related to Kete's use of truncation "@attr 5=3", but I'm not positive yet. This attribute to allow for partial matches is used in a large amount of Kete queries. In other words a search for "Bob" would match records with "Bobby" in them.
Tags: Arabic Zebra, Zebra, icu, configuration
this is the content of zebra log file :
02:52:23-29/09 zebrasrv(200) [session] Session - OK 200 tcp:::ffff:127.0.0.1 5103
02:52:23-29/09 zebrasrv(200) [request] Auth idPass kete -
02:52:23-29/09 zebrasrv(200) [request] Init OK - ID:81 Name:ZOOM-C/YAZ Version:3.0.46 0d8c31b34cd1bcf78c44ad669242f3967c76b379
02:52:23-29/09 zebrasrv(200) [request] Search public ERROR 120 1 1+0 RPN @attrset Bib-1 @attr 5=3 @attr 1=12 :Topic:
02:52:28-29/09 zebrasrv(200) [session] Connection closed by client
02:52:29-29/09 zebrasrv(201) [session] Session - OK 201 tcp:::ffff:127.0.0.1 5105
02:52:29-29/09 zebrasrv(201) [request] Auth idPass kete -
02:52:29-29/09 zebrasrv(201) [request] Init OK - ID:81 Name:ZOOM-C/YAZ Version:3.0.46 0d8c31b34cd1bcf78c44ad669242f3967c76b379
02:52:29-29/09 zebrasrv(201) [request] Search public ERROR 120 1 1+0 RPN @attrset Bib-1 @attr 5=3 @attr 1=12 :Topic:
-------------------------------------------------------------------------------------------------------------------
and yhis the guery is section in the development.log
what is query: " @attr 1=12 @attr 5=3 \":Topic:\" "
query is @attr 1=12 @attr 5=3 ":Topic:" , syntax XML
------------------------------------------------------------------------------
and i add these files :
default.idx
contains :
index w
completeness 0
position 1
alwaysmatches 1
firstinfield 1
charmap word-phrase-utf.chr
icuchain icu.xml
#firstinfield 1
# Phrase index
# Used if completeness is 'complete {sub}field' (@attr 6=2, @attr 6=1)
# and structure is word/phrase/word-list/free-form-text/document-text
index p
completeness 1
charmap word-phrase-utf.chr
firstinfield 1
icuchain icu.xml
# URX (URL) index
# Used if structure=urx (@attr 4=104)
index u
completeness 0
charmap urx.chr
icuchain icu.xml
# Numeric index
# Used if structure=numeric (@attr 4=109)
index n
completeness 0
charmap numeric.chr
icuchain icu.xml
# Null map index (no mapping at all)
# Used if structure=key (@attr 4=3)
index 0
completeness 0
position 1
charmap @
# Year
# Used if structure=year (@attr 4=4)
index y
completeness 0
charmap @
# Date
# Used if structure=date (@attr 4=5)
index d
completeness 0
charmap @
icuchain icu.xml
# Sort register
sort s
completeness 1
charmap sort-string-utf.chr
icuchain icu.xml
---------------------------------------------------------
icu.xml like the chain.xml in this link http://www.indexdata.com/yaz/doc/yaz-icu.html
Thanks for the details.
It would be good to eliminate the most likely cause first. Could you run the following from the command line from your applications root directory please?
$ rake zebra:load_initial_records # add RAILS_ENV=production if appropriate
Usually when we get an "attribute unsupported" error from Zebra it means that the indexes haven't been bootstrapped with seed records. I'm pretty sure this is not your problem, but I think it would be good to verify that that is not the cause.
hello ,
i used this command :
rake zebra:load_initial_records
but there is no change , the error is the same before
Unsupported Truncation attribute (120) 3
and the zebra log error is the same
Search public ERROR 120 1 1+0 RPN @attrset Bib-1 @attr 5=3 @attr 1=12 :Topic:
Tags: Arabic Zebra
Ok, it's good to verify that that is not the cause.
I'll see if I can replicate the issue over here. If I need further information, I 'll email you.
hello walter
i changed the truncation attr from 5=3 to 5= 100 to truncate none ,
the truncation error solved , but the search stoped completely
> hello walter
>
> i changed the truncation attr from 5=3 to 5= 100 to truncate none ,
>
> the truncation error solved , but the search stoped completely
Yep, you can turn truncation off, but that effectively breaks Kete's search functionality. It relies on truncation. I believe I have mentioned this privately in email in the past.
We have two options:
* somehow get truncation support in the ICU functionality of Zebra through that software's open source project
* fundamentally change Kete's design for search.
I'm not sure which will take more work to be honest. It is a bit of roadblock though. I would enquire with the IndexData about what it would take for them to get 5=3 truncation working with your set up.
After we get an answer on that we can evaluate which is a better answer. Unfortunately I can't currently offer resources for adding this right now. However, I am talking with a project that may be interested long term.
Wish I had better news,
Walter
hello walter ,
thanks for your interest
i want to disable the truncation , how can i do that ?
and when i use 5=100 in QUALIFYING_ATTRIBUTE_SPECS => 'partial' => "@attr 5=100 "
the search and indexing stops,
what can i use for disabling the truncation ?
thanks ,
That's my point. You can't disable truncation and have Kete search work. There was a design decision (narrowing results by type such as Topic, StillImage, etc. among other things) in search that relies on truncation.
So if you disable truncation it will break Kete's searching capabilities.
See my comment above about the two options.
Hi Walter,
I found in the web that you had encountered the captioned issue. Has this been resolved yet?
> I found in the web that you had encountered the captioned issue. Has this been
> resolved yet?
I'm afraid not. We need to work with IndexData (maintainers of Zebra) to get the ICU issue sorted. It's a significant amount of development work and we'll need to raise funds to support it.
If you would like to support this work, please contact me by email: walter -at- katipo -dot- co -dot- nz.
Joe Atzberger
said Zebra shutdown error
For whatever reason, I get some errors stopping zebra.
kete@kohavm77:~/apps/kete_stable_dev$ sudo rake zebra:stop
(in /home/kete/apps/kete_stable_dev)
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
kete@kohavm77:~/apps/kete_stable_dev$ sudo rake zebra:stop
(in /home/kete/apps/kete_stable_dev)
cat: /home/kete/apps/kete_stable_dev/log/zebra.pid: No such file or directory
awk: line 1: syntax error at or near )
awk: line 1: syntax error at or near }
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
rm: cannot remove `/home/kete/apps/kete_stable_dev/log/zebra.pid': No such file or directory
The second error seems to indicate that the former operation succeeded.
The errors are the same without sudo.
Tags: Zebra, Kete, zebra:start, zebra:stop, rake, ps, error