[Koha] Reindex ElasticSearch

Thomas Klausner domm at plix.at
Sun Sep 22 00:04:11 NZST 2024


Hi!

On Fri, Sep 20, 2024 at 06:06:39PM -0600, Marcos René Álvarez Moreno wrote:
 
> 1) Is it possible to index only one updated record in the Koha DB with
> elasticsearch?

See rebuild_elasticsearch.pl --help

    -bn|--bnumber
        Only index the supplied biblionumber, mostly for testing purposes.
        May be repeated.

    -ai|--authid
        Only index the supplied authority id, mostly for testing purposes.
        May be repeated.

And I added `--where` which should be available sind 24.05 (or maybe earlier?)
    -w|--where
        Pass some additional SQL to limit the records to be indexed.


> 2) can elasticsearch index only an updated document already defined in
> the elastic index?

I don't think that's possible right now, but you could call ES directly to see if a document exists and the call rebuild_elasticsearch.pl if it does.

Try something like:

  curl http://localhost:9200/{instance}_biblios/_doc/{biblionumber}

Of course you have to set your actual ES URL, the instancename and the biblionumber you want to try.

You could then pack this into a script... (but in a script I'd rather use LWP::UserAgent instead of `curl`)

Greetings,
domm

-- 
Thomas Klausner               domm                  https://domm.plix.at
Just another ( Perl | Postgres | Bicycle | Food | Photo | Vinyl ) Hacker

Flooded Donaukanal in Vienna
[ 2024-09-15 10:00 > https://domm.plix.at/potd/2024-09-15.html ]

First microblog / toot from new Framework laptop :-)
[ 2024-09-13 19:52 > https://domm.plix.at/microblog.html ]


More information about the Koha mailing list