KohaCon13 searchengine plan

From Koha Wiki
Jump to navigation Jump to search

Some code to introduce another Search engine into Koha has been submitted by BibLibre more than one year ago. The work has not been continuated due to lack of time and funding.

Considering there's no change expected in a close future, investigating a step by step option is probably a good way to move ahead.


for now, searches are made using 2 subs in C4/Search.pm:

  • buildQuery => responsible for building the query sent to Zebra
  • getRecord => querying and building results, including facets

There's also a simplified search sub, SimpleSearch in C4/Search.pm that doesn't calculate facets.


A step-by-step move to introduce zebra/solr choice could be:

  • Commit QueryParser made by Jared, as replacement for buildQuery. It created a QueryParser object, that can be sent through Solr quite easily
  • Fix zebra facet things. Jared showed us how to fix zebra configuration file, so we can get facets directly from Zebra. that would remove a large part of getRecords sub code. (This improvement must still be funded)
  • change getRecord if ($searchEngine eq 'solr') { solr search } else { current zebra search }
  • Fix getRecord zebra to handle separately search and facets
  • Move zebra search & facet building to Koha/SearchEngine/Zebra/

At this time, we would be able to choose between Zebra and Solr, but the code would still be poorly organised.

  • Update all calls to getRecords to use Koha::SearchEngine->search()
  • Update all calls to SimpleSearch to use Koha::SearchEngine->search()
  • Move HistorySearch subs from C4/ to Koha namespace, and create Koha::SearchEngine->FindDuplicate()
  • Drop C4/Search.pm
  • happy dance !


If anyone is willing to fund this work, drop a mail to koha-devel mailing list !!!