[OPEN-ILS-DEV] Populating newly created facet index

Elizabeth Longwell blongwel at eou.edu
Tue Sep 27 14:30:23 EDT 2011


Mike,

Thanks for the reply.  Part of the problem is that the marc tag (946
in my case) do not exist in the majority of bib records yet. I'm
trying to add to the bib, figuring that the indexing would happen
along with the bib update. I wasn't very clear in my initial post,
sorry. Right now I'm making batch updates to groups of record ids with
the marc batch edit feature in 2.1, but thought there probably was a
more efficient way on the back end :)

Beth

On Tue, Sep 27, 2011 at 9:35 AM, Mike Rylander <mrylander at gmail.com> wrote:
> On Tue, Sep 27, 2011 at 11:32 AM, Elizabeth Longwell <blongwel at eou.edu> wrote:
>> I've created a material type keyword facet index and would like to
>> populate it as quickly as possible. Can I add entries directly into a
>> table such as metabib.real_full_rec based on record id?
>
> Facet data is display-oriented, so the pre-ingested
> metabib.real_full_rec is probably not what you want.  I'd suggest
> using the oils_xpath_string function against the records directly,
> which will be much slower than metabib.real_full_rec but much faster
> than a full reindex.  Something like:
>
>  INSERT INTO metabib.facet_entry (source,field,value) SELECT
> id,123,oils_xpath_string('//*[@tag="999"]/*[@code="a"]',marc) FROM
> biblio.record_entry;
>
> Adjusting the xpath to taste and replacing '123' with the correct id
> from config.metabib_field.  Adding an id-range WHERE clause would let
> you do it in chunks.  In testing, I get 10k records in about 3
> seconds.
>
>> If so, how do I set the index_vector?
>
> There's no index_vector column on metabib.facet_entry, where the facet
> data lives.  Nothing to worry about there.
>
> --
> Mike Rylander
>  | Director of Research and Development
>  | Equinox Software, Inc. / Your Library's Guide to Open Source
>  | phone:  1-877-OPEN-ILS (673-6457)
>  | email:  miker at esilibrary.com
>  | web:  http://www.esilibrary.com
>


More information about the Open-ils-dev mailing list